[Libsysio-commit] RedStorm_merge: libsysio/drivers/redstorm Makefile.am fs_redstorm.c fs_redstorm.h
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:30
|
Update of /cvsroot/libsysio/libsysio/drivers/redstorm In directory sc8-pr-cvs1:/tmp/cvs-serv8570/drivers/redstorm Added Files: Tag: RedStorm_merge Makefile.am fs_redstorm.c fs_redstorm.h mountFiles.c start_sysio.c Log Message: merge changes from Mike Levenhagen --- NEW FILE --- lib_LIBRARIES = libsysio_redstorm.a EXTRA_DIST = fs_redstorm.h libsysio_redstorm_a_SOURCES = fs_redstorm.c start_sysio.c mountFiles.c include $(top_srcdir)/Rules.make --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* [...1218 lines suppressed...] static void redstorm_inop_gone(struct inode *ino) { struct redstorm_inode *nino = I2NI(ino); if (nino->ni_fd) (void )close(nino->ni_fd); free(ino->i_private); } static void redstorm_fsop_gone(struct filesys *fs __IS_UNUSED) { /* * Do nothing. There is no private part maintained for the * redstorm file interface. */ } --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Questions or comments about this library should be sent to: * * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 * Albuquerque, NM 87185-1110 * * le...@sa... */ /* * Native file system driver support. */ #ident "$Id: fs_redstorm.h,v 1.1.2.1 2003/09/05 16:36:17 rklundt Exp $" extern int _sysio_redstorm_init(void); extern void start_sysio(void); extern void mountFiles(void); --- NEW FILE --- #ident "$Id: mountFiles.c,v 1.1.2.1 2003/09/05 16:36:17 rklundt Exp $" #include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/param.h> #include <sys/mount.h> #include <catamount/lprintf.h> #include "fs_redstorm.h" void mountFiles(void) { if ((mkdir("/home", 0777)) != 0 && errno != EEXIST) { lprintf("mountFiles() mkdir failed\n"); while(1); } if ((mkdir("/tmp", 0777)) != 0 && errno != EEXIST) { lprintf("mountFiles() mkdir failed\n"); while(1); } if ((mkdir("/etc", 0777)) != 0 && errno != EEXIST) { lprintf("mountFiles() mkdir failed\n"); while(1); } if ((mount("redstorm", "/home", 0, "/home")) != 0) { lprintf("mountFiles() mount failed\n"); while(1); } if ((mount("redstorm", "/tmp", 0, "/tmp")) != 0) { lprintf("mountFiles() mount failed\n"); while(1); } if ((mount("redstorm", "/etc", 0, "/etc" )) != 0) { lprintf("mountFiles() mount failed\n"); while(1); } } --- NEW FILE --- #ident "$Id: start_sysio.c,v 1.1.2.1 2003/09/05 16:36:17 rklundt Exp $" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <dev.h> #include <stdfd.h> #include <sysio.h> #include <mount.h> #include <errno.h> #include <catamount/lprintf.h> #include "fs_redstorm.h" void start_sysio(void) { static int sysio_init_done = 0; int i, fd[3]; struct stdio { char *path; mode_t mode; int flags; int dev; } std[3] = { { "/dev/stdin", (S_IFCHR | 0444), O_RDONLY, SYSIO_MKDEV(SYSIO_C_STDFD_MAJOR, 0) }, { "/dev/stdout", (S_IFCHR | 0222), O_WRONLY, SYSIO_MKDEV(SYSIO_C_STDFD_MAJOR, 1) }, { "/dev/stderr", (S_IFCHR | 0222), O_WRONLY, SYSIO_MKDEV(SYSIO_C_STDFD_MAJOR, 2) } }; if (sysio_init_done) return; sysio_init_done = 1; if (_sysio_init() != 0) { lprintf("_sysio_init failed\n"); return; } if (_sysio_incore_init() != 0) { lprintf("_sysio_incore_init() failed\n"); return; } if ((_sysio_mount_root("0777+0+0", "incore", 0, NULL)) != 0) { lprintf("_sysio_mount_root() failed\n"); return; } if ((mkdir("/dev", 0777)) != 0 && errno != EEXIST) { lprintf("mkdir(\"/dev\") failed\n"); return; } for (i = 0; i < 3; i++) { if (mknod(std[i].path, std[i].mode, std[i].dev) == 0) { if ( ( fd[i] = open(std[i].path, std[i].flags )) < 0 ) { lprintf("start_sysio() open failed errno %i \n",errno); return; } } else { lprintf("start_sysio() mknod failed errno %i %s\n",errno, std[i].path ); } } } |