[Libsysio-commit] namespace_assembly: libsysio/src init.c mount.c
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-02-09 13:14:34
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29233/src Modified Files: Tag: namespace_assembly init.c mount.c Log Message: Namespace assembly at boot project: Adds the ability to craft an initial, arbitrarily complex, name space. Governed by the presence of the SYSIO_NAMESPACE environment variable formatted per Sonja Tideman's trial specification. For an example, see .../misc/init-env.sh. The mounts, namespace, and stdfd tests were all removed. They've been deprecated or obsoleted by this project. The remaining tests have been updated. They no longer require the complicated initialization they previously used in order to get a root set up. Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.3.12.2 retrieving revision 1.3.12.3 diff -u -w -b -B -p -r1.3.12.2 -r1.3.12.3 --- init.c 30 Jan 2004 21:54:22 -0000 1.3.12.2 +++ init.c 9 Feb 2004 13:11:18 -0000 1.3.12.3 @@ -9,7 +9,7 @@ * 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. + * Cplant(TM) Copyright 1998-2004 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 @@ -41,16 +41,25 @@ * le...@sa... */ [...1086 lines suppressed...] + * Get the command. + */ + buf = (char *)get_token(buf + 1, 0, "}", IGNORE_WHITE, tok); + if (!buf) { + err = -EINVAL; + break; } - return 0; + /* + * Perform. + */ + err = do_command(tok); + if (err) + break; + } + free(tok); + return err; } - - Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -w -b -B -p -r1.9 -r1.9.2.1 --- mount.c 27 Oct 2003 23:49:10 -0000 1.9 +++ mount.c 9 Feb 2004 13:11:18 -0000 1.9.2.1 @@ -270,7 +270,8 @@ _sysio_mount_root(const char *source, } int -mount(const char *source, +_sysio_mount(struct pnode *cwd, + const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, @@ -293,18 +294,16 @@ mount(const char *source, * Look up the target path node. */ INTENT_INIT(&intent, INT_GETATTR, NULL, NULL); - err = _sysio_namei(_sysio_cwd, target, 0, &intent, &tgt); + err = _sysio_namei(cwd, target, 0, &intent, &tgt); if (err) - goto out; + return err; if (tgt == _sysio_root) { /* * Attempting to mount over root. */ err = -EBUSY; - P_RELE(tgt); - } - + } else { /* * Do the deed. */ @@ -314,9 +313,28 @@ mount(const char *source, data, tgt, &mnt); + } if (err) P_RELE(tgt); -out: + return err; +} + +int +mount(const char *source, + const char *target, + const char *filesystemtype, + unsigned long mountflags, + const void *data) +{ + int err; + + err = + _sysio_mount(_sysio_cwd, + source, + target, + filesystemtype, + mountflags, + data); if (err) { errno = -err; err = -1; |