libsysio-commit Mailing List for libsysio (Page 14)
Brought to you by:
lward
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
(28) |
Jun
(25) |
Jul
(30) |
Aug
(60) |
Sep
(52) |
Oct
(100) |
Nov
(15) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(89) |
Feb
(48) |
Mar
(22) |
Apr
(59) |
May
(16) |
Jun
(15) |
Jul
(50) |
Aug
(26) |
Sep
(40) |
Oct
(27) |
Nov
(12) |
Dec
|
2005 |
Jan
(24) |
Feb
(11) |
Mar
|
Apr
|
May
(3) |
Jun
(6) |
Jul
|
Aug
(14) |
Sep
(21) |
Oct
(10) |
Nov
|
Dec
|
2006 |
Jan
(8) |
Feb
(5) |
Mar
(2) |
Apr
(6) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2007 |
Jan
(3) |
Feb
(5) |
Mar
(20) |
Apr
(41) |
May
(21) |
Jun
(3) |
Jul
(5) |
Aug
(12) |
Sep
(21) |
Oct
(5) |
Nov
(16) |
Dec
|
2008 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(23) |
May
|
Jun
(22) |
Jul
(13) |
Aug
|
Sep
|
Oct
(9) |
Nov
(3) |
Dec
(13) |
2009 |
Jan
(14) |
Feb
(10) |
Mar
(2) |
Apr
(11) |
May
(7) |
Jun
(1) |
Jul
(1) |
Aug
(36) |
Sep
(12) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Ruth K. <rk...@us...> - 2007-03-26 18:35:53
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32194 Modified Files: chdir.c Log Message: correct return code check and pass up to higher levels Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- chdir.c 23 Mar 2007 23:50:37 -0000 1.26 +++ chdir.c 26 Mar 2007 18:35:50 -0000 1.27 @@ -102,8 +102,8 @@ _sysio_p_chdir(struct pnode *pno) if (!(pno->p_base->pb_ino && S_ISDIR(pno->p_base->pb_ino->i_stbuf.st_mode))) return -ENOTDIR; - if (!_sysio_permitted(pno, X_OK)) - return -EACCES; + if ((err = _sysio_permitted(pno, X_OK)) != 0) + return err; /* * Release old if set. |
From: Klundt, R. <rk...@sa...> - 2007-03-26 18:04:06
|
On this one, the Rules.make file is defining _XOPEN_SOURCE=3D600. But = the configure step does not have that defined. So it can prompt the ssize_t readlink and pass that test in the catamount build. Then when the compile comes around the ssize_t readlink is seen and conflicts with the int version due to that define. Don't know/remember why that is in Rules.make? Ruth =20 -----Original Message----- From: lib...@li... [mailto:lib...@li...] On Behalf Of Lee Ward Sent: Friday, March 23, 2007 2:02 PM To: lib...@li... Subject: [Libsysio-commit] HEAD: libsysio/src readlink.c Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12453/src Modified Files: readlink.c Log Message: The configure test for readlink was broken. The readlink module was improperly forcing the BSD variance. This is in compliance with the proper POSIX options. One note: The GNU includes just don't define a prototype for readlink sans extensions. The choices made here should be the correct ones. Your mileage may vary... Index: readlink.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/libsysio/libsysio/src/readlink.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- readlink.c 2 Jan 2007 20:44:10 -0000 1.7 +++ readlink.c 23 Mar 2007 20:02:13 -0000 1.8 @@ -41,9 +41,6 @@ * le...@sa... */ =20 -#if defined(__linux__) -#define _BSD_SOURCE -#endif #include <unistd.h> #include <errno.h> #include <assert.h> ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDE V _______________________________________________ Libsysio-commit mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libsysio-commit |
From: Lee W. <lw...@us...> - 2007-03-23 23:50:45
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9103/src Modified Files: chdir.c Log Message: BUG: The last component of the path argument to chdir() was not being checked. Fixed now. Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- chdir.c 3 May 2006 22:34:46 -0000 1.25 +++ chdir.c 23 Mar 2007 23:50:37 -0000 1.26 @@ -102,6 +102,8 @@ _sysio_p_chdir(struct pnode *pno) if (!(pno->p_base->pb_ino && S_ISDIR(pno->p_base->pb_ino->i_stbuf.st_mode))) return -ENOTDIR; + if (!_sysio_permitted(pno, X_OK)) + return -EACCES; /* * Release old if set. |
From: Lee W. <lw...@us...> - 2007-03-23 20:02:19
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12453/src Modified Files: readlink.c Log Message: The configure test for readlink was broken. The readlink module was improperly forcing the BSD variance. This is in compliance with the proper POSIX options. One note: The GNU includes just don't define a prototype for readlink sans extensions. The choices made here should be the correct ones. Your mileage may vary... Index: readlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/readlink.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- readlink.c 2 Jan 2007 20:44:10 -0000 1.7 +++ readlink.c 23 Mar 2007 20:02:13 -0000 1.8 @@ -41,9 +41,6 @@ * le...@sa... */ -#if defined(__linux__) -#define _BSD_SOURCE -#endif #include <unistd.h> #include <errno.h> #include <assert.h> |
From: Lee W. <lw...@us...> - 2007-03-23 20:02:16
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12453 Modified Files: configure.in Log Message: The configure test for readlink was broken. The readlink module was improperly forcing the BSD variance. This is in compliance with the proper POSIX options. One note: The GNU includes just don't define a prototype for readlink sans extensions. The choices made here should be the correct ones. Your mileage may vary... Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- configure.in 2 Jan 2007 20:44:10 -0000 1.26 +++ configure.in 23 Mar 2007 20:02:13 -0000 1.27 @@ -240,12 +240,15 @@ fi AC_MSG_CHECKING(if readlink returns ssize_t) AC_TRY_COMPILE([ - include <unistd.h> +#include <unistd.h> ],[ - ssize_t readlink(const char *, char *, size_t); +static void test_code() { + ssize_t rtn; + rtn = readlink("old", "new"); +} ], readlink_returns_ssize_t="yes", - readlink_returns_ssize_t="yes" + readlink_returns_ssize_t="no" ) AC_MSG_RESULT($readlink_returns_ssize_t) if test x$readlink_returns_ssize_t = xyes; then |
From: Lee W. <lw...@us...> - 2007-03-23 19:05:55
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18240/src Modified Files: access.c Log Message: Bug in permission checking. It would allow the desired access if caller was owner, in group, or other and proper bit was set. Now, more in line with what is supposed to happen, it checks owner and applies mask. If the test fails, it returns failure. Then, it proceeds to groups checks, and fails there if caller is in one of the groups. Then, it proceeds to the "other" check. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- access.c 1 Jun 2006 21:28:57 -0000 1.13 +++ access.c 23 Mar 2007 19:05:50 -0000 1.14 @@ -74,6 +74,7 @@ _sysio_check_permission(struct pnode *pn struct intnl_stat *stat; gid_t *gids; int ngids; + int group_matched; /* * Check amode. @@ -95,38 +96,43 @@ _sysio_check_permission(struct pnode *pn ino = pno->p_base->pb_ino; assert(ino); - err = 0; /* assume success */ - + err = -EACCES; /* assume error */ + stat = &ino->i_stbuf; + do { /* * Owner? */ - stat = &ino->i_stbuf; - if (stat->st_uid == crp->creds_uid && - (stat->st_mode & mask) == mask) - goto out; + if (stat->st_uid == crp->creds_uid) { + if ((stat->st_mode & mask) == mask) + err = 0; + break; + } /* * Group? */ mask >>= 3; + group_matched = 0; gids = crp->creds_gids; ngids = crp->creds_ngids; while (ngids) { ngids--; - if (stat->st_gid == *gids++ && - (stat->st_mode & mask) == mask) - goto out; + if (stat->st_gid == *gids++) { + group_matched = 1; + if ((stat->st_mode & mask) == mask) + err = 0; } + } + if (group_matched) + break; /* * Other? */ mask >>= 3; if ((stat->st_mode & mask) == mask) - goto out; - - err = -EACCES; /* fail */ -out: + err = 0; + } while (0); if (err) return err; |
From: Lee W. <lw...@us...> - 2007-03-15 02:53:38
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19858/src Modified Files: rename.c Log Message: Fixed a bug in rename, reported by Cray (SPR 737687), when a file is renamed to a hard link of itself. I.e.: link old, new rename old, new The rename function was not releasing the pnodes when it detected the source and target were the same. Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- rename.c 25 Jan 2005 18:56:15 -0000 1.11 +++ rename.c 15 Mar 2007 02:53:34 -0000 1.12 @@ -127,7 +127,7 @@ SYSIO_INTERFACE_NAME(rename)(const char * If old == new, we're done. */ if (old->p_base->pb_ino == new->p_base->pb_ino) - goto out; + goto short_out; if (new->p_base->pb_ino) { /* @@ -175,8 +175,10 @@ SYSIO_INTERFACE_NAME(rename)(const char if (new->p_base->pb_ino) I_GONE(new->p_base->pb_ino); new->p_base->pb_ino = old->p_base->pb_ino; + old->p_base->pb_ino = NULL; I_REF(new->p_base->pb_ino); +short_out: error1: P_RELE(new); error2: @@ -184,7 +186,6 @@ error2: error3: if (err) goto out; - _sysio_p_gone(old); /* kill it! */ out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } |
From: Lee W. <lw...@us...> - 2007-03-14 21:03:15
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4132 Modified Files: Makefile.am Added Files: test_chown.c Log Message: Added a test for the chown() call. --- 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-2007 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... */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #if defined(SYSIO_LABEL_NAMES) #include "sysio.h" #endif #include "test.h" /* * Test chown call * * Usage: chown <path> <uid> <gid> * */ static void usage(void); int main(int argc, char *const argv[]) { int (*chown_func)(const char *, uid_t, gid_t); int (*stat_func)(const char *, struct stat *); int i; int err; int n; char *path; uid_t uid; gid_t gid; struct stat stbuf; extern int _test_sysio_startup(void); chown_func = SYSIO_INTERFACE_NAME(chown); stat_func = SYSIO_INTERFACE_NAME(stat); /* * Parse command line arguments. */ while ((i = getopt(argc, argv, "")) != -1) switch (i) { default: usage(); } /* * Init sysio lib. */ err = _test_sysio_startup(); if (err) { errno = -err; perror("sysio startup"); exit(1); } n = argc - optind; if (n < 3) usage(); path = argv[optind++]; uid = atoi(argv[optind++]); gid = atoi(argv[optind++]); do { err = (*chown_func)(path, uid, gid); if (err != 0) { perror(path); break; } err = (*stat_func)(path, &stbuf); if (err != 0) { perror(path); break; } (void )printf("uid now %ld, gid now %ld\n", (long )stbuf.st_uid, (long )stbuf.st_gid); } while (0); /* * Clean up. */ _test_sysio_shutdown(); return err ? -1 : 0; } static void usage() { (void )fprintf(stderr, "Usage: chown" " <path> <uid> <gid>\n"); exit(1); } Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.27 retrieving revision 1.28 diff -u -w -b -B -p -r1.27 -r1.28 --- Makefile.am 3 May 2006 22:31:04 -0000 1.27 +++ Makefile.am 14 Mar 2007 21:03:12 -0000 1.28 @@ -1,6 +1,7 @@ noinst_PROGRAMS = test_copy test_stats test_path test_list \ test_getcwd test_link test_unlink test_symlink test_rename \ - test_regions test_stddir test_fcntl_lock test_mknod test_mkdir + test_regions test_stddir test_fcntl_lock test_mknod test_mkdir \ + test_chown CLEANFILES=drv_data.c @@ -97,6 +98,10 @@ test_mkdir_SOURCES=test_mkdir.c $(CMNSRC test_mkdir_CFLAGS=$(CFL) test_mkdir_DEPENDENCIES=$(LIBS) +test_chown_SOURCES=test_chown.c $(CMNSRC) +test_chown_CFLAGS=$(CFL) +test_chown_DEPENDENCIES=$(LIBS) + drv_data.c: $(CONFIG_DEPENDENCIES) $(top_srcdir)/tests/gendrvdata.sh test -z "drv_data.c" && rm -f drv_data.c; \ $(SHELL) $(top_srcdir)/tests/gendrvdata.sh $(DRIVERS) > drv_data.c |
From: Lee W. <lw...@us...> - 2007-03-14 20:16:34
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23822 Modified Files: getdirentries.c Log Message: Cray SPR 734717 reports (as the 2nd bug discussed) that the return and errno are incorrect if a bad file descriptor is passed to getdirentries(). Fixed, using supplied patch. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- getdirentries.c 13 Mar 2007 23:41:24 -0000 1.21 +++ getdirentries.c 14 Mar 2007 20:16:31 -0000 1.22 @@ -98,8 +98,9 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdiren SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - return -EBADF; + if (!(fil && fil->f_ino)) { + SYSIO_INTERFACE_RETURN(-1, -EBADF); + } cc = filldirents(fil, buf, nbytes, basep); SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); @@ -168,8 +169,9 @@ SYSIO_INTERFACE_NAME(getdirentries)(int SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - return -EBADF; + if (!(fil && fil->f_ino)) { + SYSIO_INTERFACE_RETURN(-1, -EBADF); + } count = cc = filldirents(fil, buf, nbytes, &b); d64p = (void *)buf; |
From: Lee W. <lw...@us...> - 2007-03-14 19:14:39
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5568/drivers/incore Modified Files: fs_incore.c Log Message: Fixed a serious bug reported by Wally Wang at Cray (SPR #731860): The incore driver will match a directory entry containing a name equal to or longer than the one we are searching for. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- fs_incore.c 9 Mar 2007 23:15:37 -0000 1.26 +++ fs_incore.c 14 Mar 2007 19:14:33 -0000 1.27 @@ -778,18 +778,29 @@ incore_directory_probe(void *data, static struct intnl_dirent * incore_directory_match(struct intnl_dirent *de, - size_t reclen __IS_UNUSED, + size_t reclen, struct lookup_data *ld) { + size_t len; #if defined(BSD) || defined(REDSTORM) if (IFTODT(de->d_type) == DT_WHT) return NULL; #endif - if ( #ifdef _DIRENT_HAVE_D_NAMLEN - ld->name->len == de->d_namlen && + len = de->d_namlen; +#else + { + const char *cp, *end; + + cp = de->d_name; + end = (const char *)de + reclen; + while (cp < end && *cp != '\0') + cp++; + len = cp - de->d_name; + } #endif + if (ld->name->len == len && strncmp(de->d_name, ld->name->name, ld->name->len) == 0) return de; ld->de = de; |
From: Lee W. <lw...@us...> - 2007-03-13 23:41:31
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4187 Modified Files: getdirentries.c Log Message: Removed redundant copyright notice. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- getdirentries.c 4 Aug 2005 20:17:10 -0000 1.20 +++ getdirentries.c 13 Mar 2007 23:41:24 -0000 1.21 @@ -17,28 +17,6 @@ */ /* - * ############################################################################# - * # - * # 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-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 - * # 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 |
From: Lee W. <lw...@us...> - 2007-03-09 23:15:40
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31045/drivers/incore Modified Files: fs_incore.c Log Message: Nope. I'm not going to do it. I just can't break the backward compatibility in good conscience. The incore type mount directive must either have both uid and gid or neither. If both, the original syntax is used. Specifically, the usage now is: "incore:[+<uid>+<gid>] Which is backward compatible. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- fs_incore.c 9 Mar 2007 19:35:27 -0000 1.25 +++ fs_incore.c 9 Mar 2007 23:15:37 -0000 1.26 @@ -552,12 +552,12 @@ _sysio_incore_fsswop_mount(const char *s mode = (mode_t )ul & 07777; uid = getuid(); /* default */ gid = getgid(); /* default */ - while (*cp != '\0') { + if (*cp != '\0') { /* * Get user and/or group. */ - if (*cp == '+') { - if ((ul == ULONG_MAX && errno == ERANGE) || + if (*cp != '+' || + (ul == ULONG_MAX && errno == ERANGE) || (unsigned long)mode != ul || mode > 07777) return -EINVAL; @@ -568,8 +568,8 @@ _sysio_incore_fsswop_mount(const char *s errno == ERANGE) || (long )uid != l) return -EINVAL; - } - if (*cp == '-') { + if (*cp != '+') + return -EINVAL; source = cp; l = strtol(source, &cp, 0); gid = (gid_t )l; @@ -577,7 +577,7 @@ _sysio_incore_fsswop_mount(const char *s errno == ERANGE) || (long )gid != l) return -EINVAL; - } + if (*cp != '\0') return -EINVAL; } |
From: Lee W. <lw...@us...> - 2007-03-09 19:36:25
|
Update of /cvsroot/libsysio/libsysio/misc In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2357/misc Modified Files: init-env.sh Log Message: Changed to remove hard permissions from incore file systems. Just inherits the callers uid and gid, now. Index: init-env.sh =================================================================== RCS file: /cvsroot/libsysio/libsysio/misc/init-env.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- init-env.sh 14 Oct 2004 14:59:29 -0000 1.6 +++ init-env.sh 9 Mar 2007 19:36:21 -0000 1.7 @@ -15,19 +15,19 @@ if [ "x${SYSIO_AUTOMOUNT}" == "xyes" ]; # file system. Further automounts in the sub-mounts are not enabled. # _extras=" \ - {mnt, dev=\"incore:0755+0+0\",dir=\"/mnt\",fl=2} \ - {creat, ft=dir,nm=\"/mnt/home\",pm=04755,ow=0,gr=0} \ + {mnt, dev=\"incore:0755\",dir=\"/mnt\",fl=2} \ + {creat, ft=dir,nm=\"/mnt/home\",pm=04755} \ {creat, ft=file,nm=\"/mnt/home/.mount\",pm=0600, \ str=\"native:/home\"} \ " fi export SYSIO_NAMESPACE="\ {mnt, dev=\"native:/\",dir=/,fl=${_root_flags:-0}} \ - {mnt, dev=\"incore:0755+0+0\",dir=\"/dev\"} \ + {mnt, dev=\"incore:0755\",dir=\"/dev\"} \ {creat, ft=chr,nm=\"/dev/stdin\",pm=0400,mm=0+0} \ {creat, ft=chr,nm=\"/dev/stdout\",pm=0200,mm=0+1} \ {creat, ft=chr,nm=\"/dev/stderr\",pm=0200,mm=0+2} \ - {creat, ft=dir,nm=\"/dev/fd\",pm=0755,ow=0,gr=0} \ + {creat, ft=dir,nm=\"/dev/fd\",pm=0755} \ {creat, ft=chr,nm=\"/dev/fd/0\",pm=0400,mm=0+0} \ {open, nm=\"/dev/fd/0\",fd=0,m=0} \ {creat, ft=chr,nm=\"/dev/fd/1\",pm=0200,mm=0+1} \ |
From: Lee W. <lw...@us...> - 2007-03-09 19:35:31
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32320/drivers/incore Modified Files: fs_incore.c Log Message: Various permission checks are implemented in the library now. When run as a normal user (almost always the case) we now need a way to create incore file systems with owner and group set to that of the creator instead of some hard value from an init string. This change: 1) Makes the user and group modifiers to the type argument optional. 2) Changes the syntax of that modifier -- BEWARE! It is now [+<uid>][-<gid>]. Existing init strings will definately break with this change. I hate saying it but it will be because "it's not a bug, it's a feature." Ugh. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- fs_incore.c 4 Aug 2005 20:17:09 -0000 1.24 +++ fs_incore.c 9 Mar 2007 19:35:27 -0000 1.25 @@ -546,29 +546,40 @@ _sysio_incore_fsswop_mount(const char *s * Source is a specification for the root attributes of this * new file system in the format: * - * <permissions>+<owner>+<group> + * <permissions>[+<owner>][-<group>] */ ul = strtoul(source, &cp, 0); mode = (mode_t )ul & 07777; - if (*cp != '+' || - (ul == ULONG_MAX && errno == ERANGE) || + uid = getuid(); /* default */ + gid = getgid(); /* default */ + while (*cp != '\0') { + /* + * Get user and/or group. + */ + if (*cp == '+') { + if ((ul == ULONG_MAX && errno == ERANGE) || (unsigned long)mode != ul || mode > 07777) return -EINVAL; source = cp; l = strtol(source, &cp, 0); uid = (uid_t )l; - if (*cp != '+' || - ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) || + if (((l == LONG_MIN || l == LONG_MAX) && + errno == ERANGE) || (long )uid != l) return -EINVAL; + } + if (*cp == '-') { source = cp; l = strtol(source, &cp, 0); gid = (gid_t )l; - if (*cp || - ((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) || + if (((l == LONG_MIN || l == LONG_MAX) && + errno == ERANGE) || (long )gid != l) return -EINVAL; + } + return -EINVAL; + } err = 0; |
From: Lee W. <lw...@us...> - 2007-02-14 18:50:24
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22001 Modified Files: sysio-cmn.h Log Message: Bug fix from "Miles" at Cray; Reversed the test to order the read and write bytes transferred arguments to _add_iostats(). Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- sysio-cmn.h 3 May 2006 22:34:46 -0000 1.11 +++ sysio-cmn.h 14 Feb 2007 18:50:17 -0000 1.12 @@ -188,13 +188,13 @@ extern void _sysio_run_trace_q(void *q, do { } while (0) #endif -/* accounting for IO stats read and write char count */ +/* Accounting for IO stats; Read and write character count. */ #if defined(REDSTORM) #define _SYSIO_UPDACCT(w, cc) \ do { \ if ((cc) < 0) \ break; \ - if (!w) \ + if (w) \ _add_iostats(0, (size_t )(cc)); \ else \ _add_iostats((size_t )(cc), 0); \ |
From: Lee W. <lw...@us...> - 2007-02-05 16:25:29
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25174 Modified Files: Tag: unification inode.h Log Message: Changed the PNOP_OPEN macro. It uses the parent only when flags has O_CREAT set. Otherwise, the targeted path-node is used. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.27.2.1 retrieving revision 1.27.2.2 diff -u -w -b -B -p -r1.27.2.1 -r1.27.2.2 --- inode.h 5 Feb 2007 15:54:27 -0000 1.27.2.1 +++ inode.h 5 Feb 2007 16:25:24 -0000 1.27.2.2 @@ -314,7 +314,9 @@ struct pnode { _PNOP_MKCALL((_pno), readlink, \ (_pno), (_buf), (_bufsiz)) #define PNOP_OPEN(_pno, _flags, _mode) \ - _PNOP_MKCALL((_pno)->p_parent, open, \ + _PNOP_MKCALL((((_flags) & O_CREAT) ? \ + (_pno)->p_parent : \ + (_pno)), open, \ (_pno), (_flags), (_mode)) #define PNOP_CLOSE(_pno) \ _PNOP_MKCALL((_pno), close, \ |
From: Lee W. <lw...@us...> - 2007-02-05 15:54:37
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6564/src Modified Files: Tag: unification chdir.c chmod.c chown.c dev.c fcntl.c file.c file_hack.c fsync.c getdirentries.c init.c inode.c ioctl.c ioctx.c link.c lseek.c mkdir.c mknod.c module.mk mount.c namei.c open.c readlink.c rename.c rmdir.c rw.c stat.c statvfs.c statvfs64.c symlink.c truncate.c unlink.c utime.c Removed Files: Tag: unification stat64.c Log Message: The open file table now maintains a link to the path-node, or `pnode', instead of the inode. This is done in order to enable support for per-mount options. The issue is that bound-mounts could not have independent options. We had lost the linkage between the mount that a particular alias came from and, so, could not act on per-mount flags. As part of this, all calls through the VFS have been wrapped by macros. They all begin with PNOP_. For instance, the inop_mkdir call is wrapped with PNOP_MKDIR now. These modifications, while intrusive, require no changes to the existing drivers. However, there are many calls that take both a path-node and an inode, and at some time in the future, the path-node, only, will be passed. You might be pro-active in altering the various entry-points so that the inode is ignored -- It's always available now. Of course, that can't be done for the IO routines, which take only an inode. Note, though, that the ioctx structure now carries the path-node, in addition. Perhaps use that? In short, I'm going to deprecate the passing of inodes through the VFS in favor of the path-node at some point. Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -w -b -B -p -r1.25 -r1.25.2.1 --- chdir.c 3 May 2006 22:34:46 -0000 1.25 +++ chdir.c 5 Feb 2007 15:54:27 -0000 1.25.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.14 retrieving revision 1.14.10.1 diff -u -w -b -B -p -r1.14 -r1.14.10.1 --- chmod.c 27 Jul 2004 15:00:43 -0000 1.14 +++ chmod.c 5 Feb 2007 15:54:27 -0000 1.14.10.1 @@ -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-2007 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 @@ -55,7 +55,7 @@ #include "sysio-symbols.h" static int -do_chmod(struct pnode *pno, struct inode *ino, mode_t mode) +do_chmod(struct pnode *pno, mode_t mode) { int err; struct intnl_stat stbuf; @@ -64,7 +64,7 @@ do_chmod(struct pnode *pno, struct inode (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); stbuf.st_mode = mode & 07777; mask = SETATTR_MODE; - err = _sysio_setattr(pno, ino, mask, &stbuf); + err = _sysio_setattr(pno, mask, &stbuf); return err; } @@ -79,7 +79,7 @@ SYSIO_INTERFACE_NAME(chmod)(const char * err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; - err = do_chmod(pno, pno->p_base->pb_ino, mode); + err = do_chmod(pno, mode); P_RELE(pno); out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); @@ -106,7 +106,7 @@ SYSIO_INTERFACE_NAME(fchmod)(int fd, mod goto out; } - err = do_chmod(NULL, fil->f_ino, mode); + err = do_chmod(fil->f_pno, mode); out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.13 retrieving revision 1.13.10.1 diff -u -w -b -B -p -r1.13 -r1.13.10.1 --- chown.c 27 Jul 2004 15:00:43 -0000 1.13 +++ chown.c 5 Feb 2007 15:54:27 -0000 1.13.10.1 @@ -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-2007 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 @@ -55,7 +55,7 @@ #include "sysio-symbols.h" static int -_do_chown(struct pnode *pno, struct inode *ino, uid_t owner, gid_t group) +_do_chown(struct pnode *pno, uid_t owner, gid_t group) { int err; struct intnl_stat stbuf; @@ -71,7 +71,7 @@ _do_chown(struct pnode *pno, struct inod stbuf.st_gid = group; mask |= SETATTR_GID; } - err = _sysio_setattr(pno, ino, mask, &stbuf); + err = _sysio_setattr(pno, mask, &stbuf); return err; } @@ -87,7 +87,7 @@ SYSIO_INTERFACE_NAME(chown)(const char * if (err) goto out; - err = _do_chown(pno, pno->p_base->pb_ino, owner, group); + err = _do_chown(pno, owner, group); P_RELE(pno); out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); @@ -114,7 +114,7 @@ SYSIO_INTERFACE_NAME(fchown)(int fd, uid goto out; } - err = _do_chown(NULL, fil->f_ino, owner, group); + err = _do_chown(fil->f_pno, owner, group); out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -u -w -b -B -p -r1.10 -r1.10.4.1 --- dev.c 4 Aug 2005 20:17:10 -0000 1.10 +++ dev.c 5 Feb 2007 15:54:27 -0000 1.10.4.1 @@ -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-2007 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 Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -w -b -B -p -r1.25 -r1.25.2.1 --- fcntl.c 24 Mar 2006 16:34:07 -0000 1.25 +++ fcntl.c 5 Feb 2007 15:54:27 -0000 1.25.2.1 @@ -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-2005 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -73,13 +73,13 @@ _sysio_lustre_fcntl(int fd, int cmd, va_ #endif static int -_sysio_fcntl_raw_call(struct inode *ino, int *r, int cmd, ...) +_sysio_fcntl_raw_call(struct pnode *pno, int *r, int cmd, ...) { va_list ap; int err; va_start(ap, cmd); - err = ino->i_ops.inop_fcntl(ino, cmd, ap, r); + err = PNOP_FCNTL(pno, cmd, ap, r); va_end(ap); return err; } @@ -125,7 +125,7 @@ _sysio_fcntl_lock(struct file *fil, int return -EINVAL; } err = - _sysio_fcntl_raw_call(fil->f_ino, &rtn, cmd, &flock); + _sysio_fcntl_raw_call(fil->f_pno, &rtn, cmd, &flock); if (err) return err; /* @@ -141,7 +141,7 @@ _sysio_fcntl_lock(struct file *fil, int case SEEK_END: fl->l_start = flock.l_start; fl->l_start -= - fil->f_ino->i_stbuf.st_size; + fil->f_pno->p_base->pb_ino->i_stbuf.st_size; break; default: abort(); @@ -208,9 +208,7 @@ _sysio_vfcntl(int fd, int cmd, va_list a * Refresh the cached attributes. */ err = - fil->f_ino->i_ops.inop_getattr(NULL, - fil->f_ino, - &buf); + PNOP_GETATTR(fil->f_pno, &buf); if (err) { rtn = -1; break; @@ -264,7 +262,7 @@ _sysio_vfcntl(int fd, int cmd, va_list a break; #endif default: - err = fil->f_ino->i_ops.inop_fcntl(fil->f_ino, cmd, ap, &rtn); + err = PNOP_FCNTL(fil->f_pno, cmd, ap, &rtn); break; } Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -w -b -B -p -r1.20 -r1.20.2.1 --- file.c 3 Jan 2006 13:26:33 -0000 1.20 +++ file.c 5 Feb 2007 15:54:27 -0000 1.20.2.1 @@ -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-2007 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 @@ -66,7 +66,7 @@ static size_t _sysio_oftab_size = 0; * Create and initialize open file record. */ struct file * -_sysio_fnew(struct inode *ino, int flags) +_sysio_fnew(struct pnode *pno, int flags) { struct file *fil; @@ -74,9 +74,9 @@ _sysio_fnew(struct inode *ino, int flags if (!fil) return NULL; - _SYSIO_FINIT(fil, ino, flags); + _SYSIO_FINIT(fil, pno, flags); F_REF(fil); - I_REF(fil->f_ino); + P_REF(fil->f_pno); return fil; } @@ -90,10 +90,10 @@ _sysio_fgone(struct file *fil) int err; assert(!fil->f_ref); - assert(fil->f_ino); - err = (*fil->f_ino->i_ops.inop_close)(fil->f_ino); + assert(fil->f_pno); + err = PNOP_CLOSE(fil->f_pno); assert(!err); - I_RELE(fil->f_ino); + P_RELE(fil->f_pno); free(fil); } @@ -108,7 +108,7 @@ _sysio_fcompletio(struct ioctx *ioctx, s if (ioctx->ioctx_cc <= 0) return; - assert(ioctx->ioctx_ino == fil->f_ino); + assert(ioctx->ioctx_ino == fil->f_pno->p_base->pb_ino); off = fil->f_pos + ioctx->ioctx_cc; if (fil->f_pos && off <= fil->f_pos) abort(); Index: file_hack.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file_hack.c,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -w -b -B -p -r1.10 -r1.10.2.1 --- file_hack.c 4 Jan 2006 13:16:18 -0000 1.10 +++ file_hack.c 5 Feb 2007 15:54:27 -0000 1.10.2.1 @@ -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-2007 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 @@ -97,7 +97,7 @@ static inline oftab_t *select_oftab(int * Create and initialize open file record. */ struct file * -_sysio_fnew(struct inode *ino, int flags) +_sysio_fnew(struct pnode *pno, int flags) { struct file *fil; @@ -105,9 +105,9 @@ _sysio_fnew(struct inode *ino, int flags if (!fil) return NULL; - _SYSIO_FINIT(fil, ino, flags); + _SYSIO_FINIT(fil, pno, flags); F_REF(fil); - I_REF(ino); + P_REF(pno); return fil; } @@ -121,9 +121,9 @@ _sysio_fgone(struct file *fil) int err; assert(!fil->f_ref); - assert(fil->f_ino); - err = (*fil->f_ino->i_ops.inop_close)(fil->f_ino); - I_RELE(fil->f_ino); + assert(fil->f_pno); + err = PNOP_CLOSE(fil->f_pno); + P_RELE(fil->f_pno); assert(!err); free(fil); } @@ -139,7 +139,7 @@ _sysio_fcompletio(struct ioctx *ioctx, s if (ioctx->ioctx_cc <= 0) return; - assert(ioctx->ioctx_ino == fil->f_ino); + assert(ioctx->ioctx_ino == fil->f_pno->p_base->pb_ino); off = fil->f_pos + ioctx->ioctx_cc; if (fil->f_pos && off <= fil->f_pos) abort(); Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.8 retrieving revision 1.8.8.1 diff -u -w -b -B -p -r1.8 -r1.8.8.1 --- fsync.c 21 Sep 2004 16:18:30 -0000 1.8 +++ fsync.c 5 Feb 2007 15:54:27 -0000 1.8.8.1 @@ -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-2007 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 @@ -60,9 +60,9 @@ SYSIO_INTERFACE_NAME(fsync)(int fd) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) + if (!(fil && fil->f_pno)) SYSIO_INTERFACE_RETURN(-1, -EBADF); - err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino); + err = PNOP_SYNC(fil->f_pno); SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } @@ -75,8 +75,8 @@ SYSIO_INTERFACE_NAME(fdatasync)(int fd) SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) + if (!(fil && fil->f_pno)) SYSIO_INTERFACE_RETURN(-1, -EBADF); - err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino); + err = PNOP_DATASYNC(fil->f_pno); SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.20 retrieving revision 1.20.4.1 diff -u -w -b -B -p -r1.20 -r1.20.4.1 --- getdirentries.c 4 Aug 2005 20:17:10 -0000 1.20 +++ getdirentries.c 5 Feb 2007 15:54:27 -0000 1.20.4.1 @@ -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-2004 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -92,14 +92,14 @@ filldirents(struct file *fil, _SYSIO_OFF_T opos; ssize_t cc; - if (!S_ISDIR(fil->f_ino->i_stbuf.st_mode)) + if(!fil->f_pno->p_base->pb_ino) + return -EBADF; + if (!S_ISDIR(fil->f_pno->p_base->pb_ino->i_stbuf.st_mode)) return -ENOTDIR; opos = fil->f_pos; cc = - (*fil->f_ino->i_ops.inop_filldirentries)(fil->f_ino, - &fil->f_pos, - buf, nbytes); + PNOP_FILLDIRENTRIES(fil->f_pno, &fil->f_pos, buf, nbytes); if (cc < 0) return cc; *basep = opos; @@ -120,9 +120,6 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdiren SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - return -EBADF; - cc = filldirents(fil, buf, nbytes, basep); SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); } @@ -190,9 +187,6 @@ SYSIO_INTERFACE_NAME(getdirentries)(int SYSIO_INTERFACE_ENTER; fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - return -EBADF; - count = cc = filldirents(fil, buf, nbytes, &b); d64p = (void *)buf; dp = (void *)buf; Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.30 retrieving revision 1.30.2.1 diff -u -w -b -B -p -r1.30 -r1.30.2.1 --- init.c 4 May 2006 02:31:05 -0000 1.30 +++ init.c 5 Feb 2007 15:54:27 -0000 1.30.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -547,7 +547,6 @@ do_creat(char *args) CREATE_FILE = 4 } op; int intent_mode; - struct inode *ino; int i; len = strlen(args); @@ -639,7 +638,6 @@ do_creat(char *args) err = _sysio_open(pno, O_CREAT|O_EXCL, mode); if (err) break; - ino = pno->p_base->pb_ino; if (v[6].ovi_value) { struct iovec iovec; struct intnl_xtvec xtvec; @@ -655,13 +653,12 @@ do_creat(char *args) IOCTX_INIT(&io_context, 1, 1, - ino, + pno, &iovec, 1, &xtvec, 1); _sysio_ioctx_enter(&io_context); err = - (*ino->i_ops.inop_write)(pno->p_base->pb_ino, - &io_context); + PNOP_WRITE(pno, &io_context); if (!err) { ssize_t cc; @@ -673,7 +670,7 @@ do_creat(char *args) } else _sysio_ioctx_complete(&io_context); } - i = (*ino->i_ops.inop_close)(ino); + i = PNOP_CLOSE(pno); if (!err) err = i; break; @@ -821,7 +818,7 @@ do_chmd(char *args) err = _sysio_namei(dir, v[0].ovi_value, ND_NOPERMCHECK, NULL, &pno); if (err) return err; - err = _sysio_setattr(pno, pno->p_base->pb_ino, SETATTR_MODE, &stbuf); + err = _sysio_setattr(pno, SETATTR_MODE, &stbuf); P_RELE(pno); return err; @@ -873,7 +870,7 @@ do_open(char *args) err = _sysio_open(pno, m, 0); if (err) break; - fil = _sysio_fnew(pno->p_base->pb_ino, m); + fil = _sysio_fnew(pno, m); if (!fil) { err = -ENOMEM; break; Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -w -b -B -p -r1.25 -r1.25.2.1 --- inode.c 1 Jun 2006 21:28:57 -0000 1.25 +++ inode.c 5 Feb 2007 15:54:27 -0000 1.25.2.1 @@ -396,7 +396,6 @@ _sysio_pb_new(struct qstr *name, struct cp = (char *)pb + sizeof(struct pnode_base); (void )strncpy(cp, name->name, name->len); pb->pb_name.name = cp; - assert(name->hashval); pb->pb_name.hashval = name->hashval; LIST_INSERT_HEAD(&names[name->hashval % NAMES_TABLE_LEN], pb, @@ -435,12 +434,6 @@ pb_destroy(struct pnode_base *pb) if (pb->pb_parent) LIST_REMOVE(pb, pb_sibs); -#ifndef NDEBUG - /* - * This can help us catch pb-nodes that are free'd redundantly. - */ - pb->pb_name.hashval = 0; -#endif free(pb); } @@ -516,8 +509,6 @@ _sysio_p_new_alias(struct pnode *parent, { struct pnode *pno; - assert(!pb->pb_name.name || pb->pb_name.hashval); - pno = free_pnodes.lh_first; if (!pno) { more_pnodes(); @@ -562,35 +553,56 @@ _sysio_p_gone(struct pnode *pno) } /* + * Disconnect name referenced by the given path node from our reflection of + * the graph. + */ +void +_sysio_pb_disconnect(struct pnode_base *pb) +{ + /* + * We can't really do this. Callers aren't prepared to have + * path nodes disappear out from underneath. Then, there might be + * referenced aliases. Instead, we arrange things so that the + * referenced path-base node will never be found by the graph + * search routines again. + */ + pb->pb_parent = pb; +} + +/* * (Re)Validate passed path node. */ int _sysio_p_validate(struct pnode *pno, struct intent *intnt, const char *path) { struct inode *ino; - struct pnode_base *rootpb; int err; ino = pno->p_base->pb_ino; + err = PNOP_LOOKUP(pno, &ino, intnt, path); + if (!err) { + if (pno->p_base->pb_ino == NULL) { /* - * An invalid pnode will not have an associated inode. We'll use - * the FS root inode, then -- It *must* be valid. + * Make valid. */ - rootpb = pno->p_mount->mnt_root->p_base; - assert(rootpb->pb_ino); - err = - rootpb->pb_ino->i_ops.inop_lookup(pno, - &ino, - intnt, - path); - /* - * If the inode lookup returns a different inode, release the old if - * present and point to the new. - */ - if (err || pno->p_base->pb_ino != ino) { - if (pno->p_base->pb_ino) - I_RELE(pno->p_base->pb_ino); pno->p_base->pb_ino = ino; + } else if (pno->p_base->pb_ino != ino) { + /* + * Path resolves to a different inode, now. The + * currently attached inode, then, is stale. + */ + err = -ESTALE; + I_RELE(ino); + } + } + if (err && pno->p_base->pb_ino) { + /* + * Something has gone wrong with a valid path-base node. We + * need to disconnect the underlying path-base node from the + * tree. Setting the hash value of the name to zero will + * cause the graph search routines to ignore the node. + */ + _sysio_pb_disconnect(pno->p_base); } return err; } @@ -608,9 +620,13 @@ _sysio_p_find_alias(struct pnode *parent int err; struct pnode *pno; + if (!parent) + return -ENOENT; + /* * Find the named child. */ + pb = NULL; if (name->len) { /* * Try the names table. @@ -625,20 +641,6 @@ _sysio_p_find_alias(struct pnode *parent break; pb = pb->pb_names.le_next; } - } else { - /* - * Brute force through the parent's list of children. - */ - pb = parent->p_base->pb_children.lh_first; - while (pb) { - if (pb->pb_parent == parent->p_base && - pb->pb_name.len == name->len && - strncmp(pb->pb_name.name, - name->name, - name->len) == 0) - break; - pb = pb->pb_sibs.le_next; - } } if (!pb) { /* @@ -663,8 +665,7 @@ _sysio_p_find_alias(struct pnode *parent } if (!pno) { /* - * Hmm. No alias. Just create an invalid one, to be - * validated later. + * Hmm. No alias. Create one. */ pno = _sysio_p_new_alias(parent, pb, parent->p_mount); if (!pno) @@ -676,7 +677,7 @@ _sysio_p_find_alias(struct pnode *parent } /* - * Prune idle path base nodes freom the passed sub-tree, including the root. + * Prune idle path base nodes from the passed sub-tree, including the root. */ static void _sysio_prune(struct pnode_base *rpb) @@ -744,8 +745,6 @@ _sysio_p_prune(struct pnode *root) continue; } assert(!pno->p_cover); /* covered => ref'd! */ - assert(!pno->p_base->pb_name.name || - pno->p_base->pb_name.hashval); /* * Ok to prune. */ @@ -812,9 +811,9 @@ _sysio_p_prune(struct pnode *root) char * _sysio_pb_path(struct pnode_base *pb, const char separator) { - char *buf; size_t len, n; struct pnode_base *tmp; + char *buf; char *cp; /* @@ -829,15 +828,21 @@ _sysio_pb_path(struct pnode_base *pb, co if (n) len++; tmp = tmp->pb_parent; - } while (tmp); + } while (tmp && tmp != tmp->pb_parent); if (!len) len++; + if (tmp && tmp->pb_parent == tmp) + len = 0; /* * Alloc space. */ buf = malloc(len + 1); if (!buf) return NULL; + if (tmp && tmp->pb_parent == tmp) { + buf[0] = '\0'; + return buf; + } /* * Fill in the path buffer -- Backwards, since we're starting * from the end. @@ -865,19 +870,9 @@ _sysio_pb_path(struct pnode_base *pb, co */ int _sysio_setattr(struct pnode *pno, - struct inode *ino, unsigned mask, struct intnl_stat *stbuf) { - /* - * It is possible that pno is null (for ftruncate call). - */ - - if (pno) - assert(!ino || pno->p_base->pb_ino == ino); - if (!ino) - ino = pno->p_base->pb_ino; - assert(ino); if (pno && IS_RDONLY(pno)) return -EROFS; @@ -886,7 +881,7 @@ _sysio_setattr(struct pnode *pno, * Determining permission to change the attributes is * difficult, at best. Just try it. */ - return (*ino->i_ops.inop_setattr)(pno, ino, mask, stbuf); + return PNOP_SETATTR(pno, mask, stbuf); } /* Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.12 retrieving revision 1.12.8.1 diff -u -w -b -B -p -r1.12 -r1.12.8.1 --- ioctl.c 21 Sep 2004 16:18:31 -0000 1.12 +++ ioctl.c 5 Feb 2007 15:54:27 -0000 1.12.8.1 @@ -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-2007 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 @@ -70,7 +70,7 @@ SYSIO_INTERFACE_NAME(ioctl)(int fd, unsi } va_start(ap, request); - err = fil->f_ino->i_ops.inop_ioctl(fil->f_ino, request, ap); + err = PNOP_IOCTL(fil->f_pno, request, ap); va_end(ap); out: Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.24 retrieving revision 1.24.4.1 diff -u -w -b -B -p -r1.24 -r1.24.4.1 --- ioctx.c 16 Jun 2005 21:21:42 -0000 1.24 +++ ioctx.c 5 Feb 2007 15:54:27 -0000 1.24.4.1 @@ -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-2004 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -101,7 +101,7 @@ _sysio_ioctx_enter(struct ioctx *ioctx) * Allocate and initialize a new IO context. */ struct ioctx * -_sysio_ioctx_new(struct inode *ino, +_sysio_ioctx_new(struct pnode *pno, int wr, const struct iovec *iov, size_t iovlen, @@ -114,12 +114,12 @@ _sysio_ioctx_new(struct inode *ino, if (!ioctx) return NULL; - I_REF(ino); + P_REF(pno); IOCTX_INIT(ioctx, 0, wr, - ino, + pno, iov, iovlen, xtv, xtvlen); @@ -184,7 +184,7 @@ _sysio_ioctx_done(struct ioctx *ioctx) if (ioctx->ioctx_done) return 1; - if (!(*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)) + if (!PNOP_IODONE(ioctx->ioctx_pno, ioctx)) return 0; ioctx->ioctx_done = 1; return 1; @@ -264,8 +264,6 @@ _sysio_ioctx_complete(struct ioctx *ioct if (ioctx->ioctx_fast) return; - - I_RELE(ioctx->ioctx_ino); - + P_RELE(ioctx->ioctx_pno); free(ioctx); } Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -u -w -b -B -p -r1.12 -r1.12.4.1 --- link.c 25 Jan 2005 18:56:14 -0000 1.12 +++ link.c 5 Feb 2007 15:54:28 -0000 1.12.4.1 @@ -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-2007 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 @@ -89,7 +89,7 @@ SYSIO_INTERFACE_NAME(link)(const char *o * driver is implemented using differentiated inode operations based * on file type, such as incore does. */ - err = old->p_parent->p_base->pb_ino->i_ops.inop_link(old, new); + err = PNOP_LINK(old, new); if (err) goto error2; /* Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -w -b -B -p -r1.27 -r1.27.2.1 --- lseek.c 28 Oct 2005 17:59:31 -0000 1.27 +++ lseek.c 5 Feb 2007 15:54:28 -0000 1.27.2.1 @@ -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-2005 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -82,10 +82,7 @@ _sysio_lseek_prepare(struct file *fil, * in the inode record for this. Give the * driver a chance to refresh them. */ - err = - (*fil->f_ino->i_ops.inop_getattr)(NULL, - fil->f_ino, - &stbuf); + err = PNOP_GETATTR(fil->f_pno, &stbuf); if (err) return err; @@ -114,7 +111,7 @@ _sysio_lseek(struct file *fil, pos = _sysio_lseek_prepare(fil, offset, whence, max); if (pos < 0) return pos; - pos = (fil->f_ino->i_ops.inop_pos)(fil->f_ino, pos); + pos = PNOP_POS(fil->f_pno, pos); if (pos < 0) return pos; fil->f_pos = pos; Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -w -b -B -p -r1.19 -r1.19.2.1 --- mkdir.c 1 Jun 2006 21:28:57 -0000 1.19 +++ mkdir.c 5 Feb 2007 15:54:28 -0000 1.19.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -58,7 +58,6 @@ int _sysio_mkdir(struct pnode *pno, mode_t mode) { int err; - struct inode *parenti; if (pno->p_base->pb_ino) return -EEXIST; @@ -68,9 +67,7 @@ _sysio_mkdir(struct pnode *pno, mode_t m return err; mode |= S_IFDIR; - parenti = pno->p_parent->p_base->pb_ino; - assert(parenti); - return (*parenti->i_ops.inop_mkdir)(pno, mode); + return PNOP_MKDIR(pno, mode); } int Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -u -w -b -B -p -r1.18 -r1.18.2.1 --- mknod.c 3 May 2006 22:31:04 -0000 1.18 +++ mknod.c 5 Feb 2007 15:54:28 -0000 1.18.2.1 @@ -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-2007 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 @@ -82,9 +82,7 @@ _sysio_mknod(struct pnode *pno, mode_t m if (IS_RDONLY(pno)) return -EROFS; - return (*pno->p_parent->p_base->pb_ino->i_ops.inop_mknod)(pno, - mode, - dev); + return PNOP_MKNOD(pno, mode, dev); } int Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.10 retrieving revision 1.10.8.1 diff -u -w -b -B -p -r1.10 -r1.10.8.1 --- module.mk 25 Oct 2004 14:29:16 -0000 1.10 +++ module.mk 5 Feb 2007 15:54:28 -0000 1.10.8.1 @@ -23,7 +23,7 @@ SRCDIR_SRCS = src/access.c src/chdir.c s src/link.c src/lseek.c src/mkdir.c \ src/mknod.c src/mount.c src/namei.c \ src/open.c src/rw.c src/reconcile.c src/rename.c \ - src/rmdir.c src/stat64.c src/stat.c \ + src/rmdir.c src/stat.c \ src/stddir.c src/readdir.c src/readdir64.c \ src/symlink.c src/readlink.c \ src/truncate.c src/unlink.c src/utime.c \ Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.21 retrieving revision 1.21.4.1 diff -u -w -b -B -p -r1.21 -r1.21.4.1 --- mount.c 25 Jan 2005 00:37:14 -0000 1.21 +++ mount.c 5 Feb 2007 15:54:28 -0000 1.21.4.1 @@ -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-2004 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -680,18 +680,18 @@ _sysio_automount(struct pnode *mntpno) IOCTX_INIT(&iocontext, 1, 0, - ino, + mntpno, &iovec, 1, &xtvec, 1); _sysio_ioctx_enter(&iocontext); - err = (*ino->i_ops.inop_read)(ino, &iocontext); + err = PNOP_READ(mntpno, &iocontext); if (err) { _sysio_ioctx_complete(&iocontext); - (void )(*ino->i_ops.inop_close)(ino); + (void )PNOP_CLOSE(mntpno); goto out; } cc = _sysio_ioctx_wait(&iocontext); - err = (*ino->i_ops.inop_close)(ino); + err = PNOP_CLOSE(mntpno); if (err) goto out; if (cc < 0) { Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.23 retrieving revision 1.23.2.1 diff -u -w -b -B -p -r1.23 -r1.23.2.1 --- namei.c 4 May 2006 02:32:08 -0000 1.23 +++ namei.c 5 Feb 2007 15:54:28 -0000 1.23.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -94,6 +94,12 @@ lookup(struct pnode *parent, int err; struct pnode *pno; + assert(parent != NULL); + /* + * The parent must be valid and should be connected or a root. + */ + if (parent->p_base->pb_parent == parent->p_base) + return -ENOENT; if (!parent->p_base->pb_ino) return -ENOTDIR; @@ -125,6 +131,10 @@ lookup(struct pnode *parent, if (err) return err; } + if (pno->p_base->pb_parent == pno->p_base) { + P_RELE(pno); + return -ENOENT; + } /* * While covered, move to the covering node. @@ -256,10 +266,7 @@ _sysio_path_walk(struct pnode *parent, s err = -ENOMEM; break; } - cc = - ino->i_ops.inop_readlink(nd->nd_pno, - lpath, - MAXPATHLEN); + cc = PNOP_READLINK(nd->nd_pno, lpath, MAXPATHLEN); if (cc < 0) { free(lpath); err = (int )cc; Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -u -w -b -B -p -r1.28 -r1.28.2.1 --- open.c 3 May 2006 22:34:46 -0000 1.28 +++ open.c 5 Feb 2007 15:54:28 -0000 1.28.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -77,7 +77,6 @@ _sysio_open(struct pnode *pno, int flags int ro; int w; int err; - struct inode *ino; ro = IS_RDONLY(pno); w = flags & (O_WRONLY|O_RDWR); @@ -89,35 +88,29 @@ _sysio_open(struct pnode *pno, int flags } if (w && ro) return -EROFS; - ino = pno->p_base->pb_ino; - if ((flags & O_CREAT) && !ino) { - struct pnode *parent; - + if ((flags & O_CREAT) && !pno->p_base->pb_ino) { /* * Must create it. */ if (ro) return -EROFS; - parent = pno->p_parent; - err = _sysio_p_validate(parent, NULL, NULL); - if (!err) { - ino = parent->p_base->pb_ino; - assert(ino); - err = (*ino->i_ops.inop_open)(pno, flags, mode); - } + err = _sysio_p_validate(pno->p_parent, NULL, NULL); + if (!err) + err = PNOP_OPEN(pno, flags, mode); } else if ((flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) err = -EEXIST; - else if (!ino) + else if (!pno->p_base->pb_ino) err = _sysio_p_validate(pno, NULL, NULL); #ifdef O_NOFOLLOW - else if (flags & O_NOFOLLOW && S_ISLNK(ino->i_stbuf.st_mode)) + else if (flags & O_NOFOLLOW && + S_ISLNK(pno->p_base->pb_ino->i_stbuf.st_mode)) err = -ELOOP; #endif else { /* * Simple open of pre-existing file. */ - err = (*ino->i_ops.inop_open)(pno, flags, mode); + err = PNOP_OPEN(pno, flags, mode); } return err; @@ -188,7 +181,7 @@ SYSIO_INTERFACE_NAME(open)(const char *p /* * Get a file descriptor. */ - fil = _sysio_fnew(pno->p_base->pb_ino, flags); + fil = _sysio_fnew(pno, flags); if (!fil) { rtn = -ENOMEM; goto error; Index: readlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/readlink.c,v retrieving revision 1.6 retrieving revision 1.6.8.1 diff -u -w -b -B -p -r1.6 -r1.6.8.1 --- readlink.c 14 Oct 2004 14:59:29 -0000 1.6 +++ readlink.c 5 Feb 2007 15:54:28 -0000 1.6.8.1 @@ -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-2004 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -61,7 +61,6 @@ SYSIO_INTERFACE_NAME(readlink)(const cha struct intent intent; int err; struct pnode *pno; - struct inode *ino; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; @@ -69,12 +68,11 @@ SYSIO_INTERFACE_NAME(readlink)(const cha err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno); if (err) goto out; - ino = pno->p_base->pb_ino; - if (!S_ISLNK(ino->i_stbuf.st_mode)) { + if (!S_ISLNK(pno->p_base->pb_ino->i_stbuf.st_mode)) { err = -EINVAL; goto error; } - err = (*ino->i_ops.inop_readlink)(pno, buf, bufsiz); + err = PNOP_READLINK(pno, buf, bufsiz); error: P_RELE(pno); out: Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.11 retrieving revision 1.11.4.1 diff -u -w -b -B -p -r1.11 -r1.11.4.1 --- rename.c 25 Jan 2005 18:56:15 -0000 1.11 +++ rename.c 5 Feb 2007 15:54:28 -0000 1.11.4.1 @@ -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-2007 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 @@ -161,21 +161,15 @@ SYSIO_INTERFACE_NAME(rename)(const char err = -EBUSY; goto error1; } - /* - * Use the parent node operations to request the task in case the - * driver is implemented using differentiated inode operations based - * on file type, such as incore does. - */ - err = old->p_parent->p_base->pb_ino->i_ops.inop_rename(old, new); + err = PNOP_RENAME(old, new); if (err) goto error1; /* - * Reflect the successful rename in the active name space graph. + * Reflect the successful rename in the active name space graph by + * "losing" the existing, relevant, parts of the graph. A subsequent + * lookup will reestablish the proper graph. */ - if (new->p_base->pb_ino) - I_GONE(new->p_base->pb_ino); - new->p_base->pb_ino = old->p_base->pb_ino; - I_REF(new->p_base->pb_ino); + _sysio_pb_disconnect(old->p_base); error1: P_RELE(new); Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -w -b -B -p -r1.20 -r1.20.2.1 --- rmdir.c 3 May 2006 22:34:46 -0000 1.20 +++ rmdir.c 5 Feb 2007 15:54:28 -0000 1.20.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -60,7 +60,6 @@ SYSIO_INTERFACE_NAME(rmdir)(const char * struct intent intent; int err; struct pnode *pno; - struct inode *ino; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; @@ -79,20 +78,13 @@ SYSIO_INTERFACE_NAME(rmdir)(const char * err = -EBUSY; goto error; } - /* - * Use the parent node operations to request the task in case the - * driver is implemented using differentiated inode operations based - * on file type, such as incore does. - */ - err = (*pno->p_parent->p_base->pb_ino->i_ops.inop_rmdir)(pno); + err = PNOP_RMDIR(pno); if (err) goto error; /* - * Invalidate the path-base node and kill the i-node. + * Disconnect the path node from the existing graph. */ - ino = pno->p_base->pb_ino; - pno->p_base->pb_ino = NULL; - I_GONE(ino); + _sysio_pb_disconnect(pno->p_base); error: P_RELE(pno); out: Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.16 retrieving revision 1.16.4.1 diff -u -w -b -B -p -r1.16 -r1.16.4.1 --- rw.c 25 Jan 2005 00:37:14 -0000 1.16 +++ rw.c 5 Feb 2007 15:54:28 -0000 1.16.4.1 @@ -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-2004 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -57,8 +57,12 @@ #include "sysio-symbols.h" -#define IIOXOP_READ(ino) (ino)->i_ops.inop_read, 0 -#define IIOXOP_WRITE(ino) (ino)->i_ops.inop_write, 1 +#define _IIOXOP_F(_fil, _fbase) \ + ((_fil)->f_pno->p_base->pb_ino ? \ + (_fil)->f_pno->p_base->pb_ino->i_ops.inop_##_fbase : \ + NULL) +#define IIOXOP_READ(_fil) _IIOXOP_F((_fil), read), 0 +#define IIOXOP_WRITE(_fil) _IIOXOP_F((_fil), write), 1 /* * Decoding the interface routine names: @@ -96,7 +100,6 @@ _sysio_iiox(int (*f)(struct inode *, str void (*completio)(struct ioctx *, void *), struct ioctx **ioctxp) { - struct inode *ino; ssize_t cc; struct ioctx *ioctx; int err; @@ -110,8 +113,7 @@ _sysio_iiox(int (*f)(struct inode *, str : !(fil->f_flags & O_WRONLY))) return -EBADF; - ino = fil->f_ino; - if (!ino) { + if (!fil->f_pno->p_base->pb_ino) { /* * Huh? It's dead. */ @@ -128,7 +130,8 @@ _sysio_iiox(int (*f)(struct inode *, str _SYSIO_OFF_T_MAX); if (cc < 0) return cc; - ioctx = _sysio_ioctx_new(ino, wr, iov, iov_count, xtv, xtv_count); + ioctx = + _sysio_ioctx_new(fil->f_pno, wr, iov, iov_count, xtv, xtv_count); if (!ioctx) return -ENOMEM; if ((iov_free && @@ -146,7 +149,8 @@ _sysio_iiox(int (*f)(struct inode *, str (void (*)(struct ioctx *, void *))completio, fil))) || - (err = (*f)(ino, ioctx))) { + (err = (f == NULL ? -ESTALE : 0)) || + (err = (*f)(fil->f_pno->p_base->pb_ino, ioctx))) { /* * Release the callback queue. Don't want it run after all. */ @@ -258,7 +262,7 @@ SYSIO_INTERFACE_NAME(ireadv)(int fd, con SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); err = - _sysio_iiov(IIOXOP_READ(fil->f_ino), + _sysio_iiov(IIOXOP_READ(fil), fil, iov, count, NULL, xtv, free_xtv, @@ -286,7 +290,7 @@ SYSIO_INTERFACE_NAME(readv)(int fd, cons SYSIO_INTERFACE_RETURN(-1, -EBADF); err = - _sysio_iiov(IIOXOP_READ(fil->f_ino), + _sysio_iiov(IIOXOP_READ(fil), fil, iov, count, NULL, &xtvector, NULL, @@ -341,7 +345,7 @@ SYSIO_INTERFACE_NAME(iread)(int fd, void SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); } err = - _sysio_iiov(IIOXOP_READ(fil->f_ino), + _sysio_iiov(IIOXOP_READ(fil), fil, iov, 1, free_iov, xtv, free_xtv, @@ -373,7 +377,7 @@ SYSIO_INTERFACE_NAME(read)(int fd, void iovector.iov_base = buf; iovector.iov_len = count; err = - _sysio_iiov(IIOXOP_READ(fil->f_ino), + _sysio_iiov(IIOXOP_READ(fil), fil, &iovector, 1, NULL, &xtvector, NULL, @@ -454,7 +458,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipreadv) SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); err = - _sysio_ipiov(IIOXOP_READ(fil->f_ino), + _sysio_ipiov(IIOXOP_READ(fil), fil, iov, count, NULL, offset, @@ -505,7 +509,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(preadv)) SYSIO_INTERFACE_RETURN(-1, -EBADF); err = - _sysio_ipiov(IIOXOP_READ(fil->f_ino), + _sysio_ipiov(IIOXOP_READ(fil), fil, iov, count, NULL, offset, @@ -564,7 +568,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipread)) iov->iov_base = buf; xtv->xtv_len = iov->iov_len = count; err = - _sysio_ipiov(IIOXOP_READ(fil->f_ino), + _sysio_ipiov(IIOXOP_READ(fil), fil, iov, 1, free_iov, offset, @@ -623,7 +627,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(pread))( iovec.iov_base = buf; xtvec.xtv_len = iovec.iov_len = count; err = - _sysio_ipiov(IIOXOP_READ(fil->f_ino), + _sysio_ipiov(IIOXOP_READ(fil), fil, &iovec, 1, NULL, offset, @@ -690,7 +694,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ireadx)) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EINVAL); err = - _sysio_iiox(IIOXOP_READ(fil->f_ino), + _sysio_iiox(IIOXOP_READ(fil), fil, iov, iov_count, NULL, xtv, xtv_count, NULL, @@ -742,7 +746,7 @@ SYSIO_INTERFACE_NAME(ireadx)(int fd, } err = - _sysio_iiox(IIOXOP_READ(fil->f_ino), + _sysio_iiox(IIOXOP_READ(fil), fil, iov, iov_count, NULL, ixtv, xtv_count, free_xtv, @@ -833,7 +837,7 @@ SYSIO_INTERFACE_NAME(iwritev)(int fd, SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); err = - _sysio_iiov(IIOXOP_WRITE(fil->f_ino), + _sysio_iiov(IIOXOP_WRITE(fil), fil, iov, count, NULL, xtv, free_xtv, @@ -861,7 +865,7 @@ SYSIO_INTERFACE_NAME(writev)(int fd, con SYSIO_INTERFACE_RETURN(-1, -EBADF); err = - _sysio_iiov(IIOXOP_WRITE(fil->f_ino), + _sysio_iiov(IIOXOP_WRITE(fil), fil, iov, count, NULL, &xtvector, NULL, @@ -908,7 +912,7 @@ SYSIO_INTERFACE_NAME(iwrite)(int fd, con SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); } err = - _sysio_iiov(IIOXOP_WRITE(fil->f_ino), + _sysio_iiov(IIOXOP_WRITE(fil), fil, iov, 1, free_iov, xtv, free_xtv, @@ -940,7 +944,7 @@ SYSIO_INTERFACE_NAME(write)(int fd, cons iovector.iov_base = (void *)buf; iovector.iov_len = count; err = - _sysio_iiov(IIOXOP_WRITE(fil->f_ino), + _sysio_iiov(IIOXOP_WRITE(fil), fil, &iovector, 1, NULL, &xtvector, NULL, @@ -982,7 +986,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipwritev SYSIO_INTERFACE_RETURN(IOID_FAIL, -ENOMEM); err = - _sysio_ipiov(IIOXOP_WRITE(fil->f_ino), + _sysio_ipiov(IIOXOP_WRITE(fil), fil, iov, count, NULL, offset, @@ -1033,7 +1037,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(pwritev) SYSIO_INTERFACE_RETURN(-1, -EBADF); err = - _sysio_ipiov(IIOXOP_WRITE(fil->f_ino), + _sysio_ipiov(IIOXOP_WRITE(fil), fil, iov, count, NULL, offset, @@ -1092,7 +1096,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ipwrite) iov->iov_base = (void *)buf; xtv->xtv_len = iov->iov_len = count; err = - _sysio_ipiov(IIOXOP_WRITE(fil->f_ino), + _sysio_ipiov(IIOXOP_WRITE(fil), fil, iov, 1, free_iov, offset, @@ -1151,7 +1155,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(pwrite)) iovec.iov_base = (void *)buf; xtvec.xtv_len = iovec.iov_len = count; err = - _sysio_ipiov(IIOXOP_WRITE(fil->f_ino), + _sysio_ipiov(IIOXOP_WRITE(fil), fil, &iovec, 1, NULL, offset, @@ -1214,7 +1218,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(iwritex) SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF); err = - _sysio_iiox(IIOXOP_WRITE(fil->f_ino), + _sysio_iiox(IIOXOP_WRITE(fil), fil, iov, iov_count, NULL, xtv, xtv_count, NULL, @@ -1265,7 +1269,7 @@ SYSIO_INTERFACE_NAME(iwritex)(int fd, } err = - _sysio_iiox(IIOXOP_WRITE(fil->f_ino), + _sysio_iiox(IIOXOP_WRITE(fil), fil, iov, iov_count, NULL, ixtv, xtv_count, free_xtv, Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.17 retrieving revision 1.17.8.1 diff -u -w -b -B -p -r1.17 -r1.17.8.1 --- stat.c 14 Oct 2004 14:59:29 -0000 1.17 +++ stat.c 5 Feb 2007 15:54:28 -0000 1.17.8.1 @@ -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-2007 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,6 +41,7 @@ * le...@sa... */ +#include <string.h> #include <errno.h> #include <assert.h> #include <sys/types.h> @@ -54,6 +55,141 @@ #include "sysio-symbols.h" +#if !defined(_STAT_VER) +#define _STAT_VER 0 +#endif + +static int +_sysio_fxstat(int ver, int fildes, struct intnl_stat *stat_buf) +{ + struct file *fil; + int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + + SYSIO_INTERFACE_ENTER; + if (ver != _STAT_VER) { + err = -ENOSYS; + goto out; + } + + err = 0; + fil = _sysio_fd_find(fildes); + if (!fil) { + err = -EBADF; + goto out; + } + /* + * Never use the attributes cached in the inode record. We + * want fresh ones. + */ + err = PNOP_GETATTR(fil->f_pno, stat_buf); +out: + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); +} + +static int +_sysio_xstatnd(int ver, + const char *filename, + struct intnl_stat *stat_buf, + unsigned ndflags) +{ + struct intent intent; + int err; + struct pnode *pno; + SYSIO_INTERFACE_DISPLAY_BLOCK; + + SYSIO_INTERFACE_ENTER; + if (ver != _STAT_VER) { + err = -ENOSYS; + goto out; + } + + INTENT_INIT(&intent, INT_GETATTR, NULL, NULL); + err = _sysio_namei(_sysio_cwd, filename, ndflags, &intent, &pno); + if (err) + goto out; + /* + * Leverage the INT_GETATTR intent above. We are counting + * on the FS driver to either make sure the attributes cached in + * the inode are always correct or refresh them in the lookup, above. + */ + (void )memcpy(stat_buf, + &pno->p_base->pb_ino->i_stbuf, + sizeof(struct intnl_stat)); + P_RELE(pno); +out: + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); +} + +#if _LARGEFILE64_SOURCE + +#ifndef REDSTORM +#undef fstat64 +#undef stat64 +#undef lstat64 +#endif + +#undef __fxstat64 +#undef __xstat64 +#undef __lxstat64 + +int +PREPEND(__, SYSIO_INTERFACE_NAME(fxstat64))(int __ver, + int __fildes, + struct stat64 *__stat_buf) +{ + + return _sysio_fxstat(__ver, __fildes, __stat_buf); +} + +#ifndef REDSTORM +int +SYSIO_INTERFACE_NAME(fstat64)(int fd, struct stat64 *buf) +{ + + return PREPEND(__, SYSIO_INTERFACE_NAME(fxstat64))(_STAT_VER, fd, buf); +} +#endif + +int +PREPEND(__, SYSIO_INTERFACE_NAME(xstat64))(int __ver, + const char *__filename, + struct stat64 *__stat_buf) +{ + return _sysio_xstatnd(__ver, __filename, __stat_buf, 0); +} + +#ifndef REDSTORM +int +SYSIO_INTERFACE_NAME(stat64)(const char *filename, struct stat64 *buf) +{ + + return PREPEND(__, SYSIO_INTERFACE_NAME(xstat64))(_STAT_VER, + filename, + buf); +} +#endif + +int +PREPEND(__, SYSIO_INTERFACE_NAME(lxstat64))(int __ver, + const char *__filename, + struct stat64 *__stat_buf) +{ + return _sysio_xstatnd(__ver, __filename, __stat_buf, ND_NOFOLLOW); +} + +#ifndef REDSTORM +int +SYSIO_INTERFACE_NAME(lstat64)(const char *filename, struct stat64 *buf) +{ + + return PREPEND(__, SYSIO_INTERFACE_NAME(lxstat64))(_STAT_VER, + filename, + buf); +} +#endif +#endif /* !_LARGEFILE64_SOURCE */ + #ifndef REDSTORM #undef fstat #undef stat @@ -64,10 +200,6 @@ #undef __xstat #undef __lxstat -#if !defined(_STAT_VER) -#define _STAT_VER 0 -#endif - #if _LARGEFILE64_SOURCE static void convstat(struct stat64 *st64_buf, struct stat *st_buf) @@ -94,43 +226,23 @@ PREPEND(__, SYSIO_INTERFACE_NAME(fxstat) int __fildes, struct stat *__stat_buf) { - struct file *fil; - int err; struct intnl_stat *buf; + int err; #if _LARGEFILE64_SOURCE struct stat64 st64; #endif - SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; - if (__ver != _STAT_VER) { - err = -ENOSYS; - goto out; - } - - err = 0; - fil = _sysio_fd_find(__fildes); - if (!fil) { - err = -EBADF; - goto out; - } #if _LARGEFILE64_SOURCE buf = &st64; #else buf = __stat_buf; #endif - /* - * Never use the attributes cached in the inode record. Give the - * driver a chance to refresh them. - */ - err = - fil->f_ino->i_ops.inop_getattr(NULL, fil->f_ino, buf); + err = _sysio_fxstat(__ver, __fildes, buf); #if _LARGEFILE64_SOURCE if (!err) convstat(buf, __stat_buf); #endif -out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + return err; } #ifdef REDSTORM @@ -164,36 +276,23 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xstat)) const char *__filename, struct stat *__stat_buf) { - struct intent intent; + struct intnl_stat *buf; int err; - struct pnode *pno; - struct inode *ino; - SYSIO_INTERFACE_DISPLAY_BLOCK; - - SYSIO_INTERFACE_ENTER; - if (__ver != _STAT_VER) { - err = -ENOSYS; - goto out; - } +#if _LARGEFILE64_SOURCE + struct stat64 st64; +#endif - INTENT_INIT(&intent, INT_GETATTR, NULL, NULL); - err = _sysio_namei(_sysio_cwd, __filename, 0, &intent, &pno); - if (err) - goto out; - /* - * Leverage the INT_GETATTR intent above. We are counting - * on the FS driver to either make sure the attributes cached in - * the inode are always correct or refresh them in the lookup, above. - */ - ino = pno->p_base->pb_ino; #if _LARGEFILE64_SOURCE - convstat(&ino->i_stbuf, __stat_buf); + buf = &st64; #else - (void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat)); + buf = __stat_buf; #endif - P_RELE(pno); -out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + err = _sysio_xstatnd(__ver, __filename, buf, 0); +#if _LARGEFILE64_SOURCE + if (!err) + convstat(buf, __stat_buf); +#endif + return err; } #ifdef REDSTORM @@ -228,36 +327,23 @@ PREPEND(__, SYSIO_INTERFACE_NAME(lxstat) const char *__filename, struct stat *__stat_buf) { - struct intent intent; + struct intnl_stat *buf; int err; - struct pnode *pno; - struct inode *ino; - SYSIO_INTERFACE_DISPLAY_BLOCK; - - SYSIO_INTERFACE_ENTER; - if (__ver != _STAT_VER) { - err = -ENOSYS; - goto out; - } +#if _LARGEFILE64_SOURCE + struct stat64 st64; +#endif - INTENT_INIT(&intent, INT_GETATTR, NULL, NULL); - err = _sysio_namei(_sysio_cwd, __filename, ND_NOFOLLOW, &intent, &pno); - if (err) - goto out; - /* - * Leverage the INT_GETATTR intent above. We are counting - * on the FS driver to either make sure the attributes cached in - * the inode are always correct or refresh them in the lookup, above. - */ - ino = pno->p_base->pb_ino; #if _LARGEFILE64_SOURCE - convstat(&ino->i_stbuf, __stat_buf); + buf = &st64; #else - (void )memcpy(__stat_buf, &ino->i_stbuf, sizeof(struct intnl_stat)); + buf = __stat_buf; #endif - P_RELE(pno); -out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + err = _sysio_xstatnd(__ver, __filename, buf, ND_NOFOLLOW); +#if _LARGEFILE64_SOURCE + if (!err) + convstat(buf, __stat_buf); +#endif + return err; } #ifdef REDSTORM Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.12 retrieving revision 1.12.10.1 diff -u -w -b -B -p -r1.12 -r1.12.10.1 --- statvfs.c 27 Jul 2004 15:00:48 -0000 1.12 +++ statvfs.c 5 Feb 2007 15:54:28 -0000 1.12.10.1 @@ -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-2007 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 @@ -94,7 +94,7 @@ SYSIO_INTERFACE_NAME(statvfs)(const char if (err) goto out; - err = pno->p_base->pb_ino->i_ops.inop_statvfs(pno, NULL, _call_buf); + err = PNOP_STATVFS(pno, _call_buf); P_RELE(pno); if (err) goto err; @@ -134,7 +134,7 @@ SYSIO_INTERFACE_NAME(fstatvfs)(int fd, s goto out; } - err = filp->f_ino->i_ops.inop_statvfs(NULL, filp->f_ino, _call_buf); + err = PNOP_STATVFS(filp->f_pno, _call_buf); if (err) goto err; #ifndef INTNL_STATVFS_IS_NATURAL Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.14 retrieving revision 1.14.10.1 diff -u -w -b -B -p -r1.14 -r1.14.10.1 --- statvfs64.c 27 Jul 2004 15:00:48 -0000 1.14 +++ statvfs64.c 5 Feb 2007 15:54:28 -0000 1.14.10.1 @@ -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-2007 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 @@ -66,7 +66,7 @@ SYSIO_INTERFACE_NAME(statvfs64)(const ch if (err) goto out; - err = pno->p_base->pb_ino->i_ops.inop_statvfs(pno, NULL, buf); + err = PNOP_STATVFS(pno, buf); P_RELE(pno); out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); @@ -93,7 +93,7 @@ SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, goto out; } - err = filp->f_ino->i_ops.inop_statvfs(NULL, filp->f_ino, buf); + err = PNOP_STATVFS(filp->f_pno, buf); out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); } Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -w -b -B -p -r1.16 -r1.16.2.1 --- symlink.c 3 May 2006 22:34:46 -0000 1.16 +++ symlink.c 5 Feb 2007 15:54:28 -0000 1.16.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -80,13 +80,7 @@ ... [truncated message content] |
From: Lee W. <lw...@us...> - 2007-02-05 15:54:37
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6564/include Modified Files: Tag: unification file.h inode.h Log Message: The open file table now maintains a link to the path-node, or `pnode', instead of the inode. This is done in order to enable support for per-mount options. The issue is that bound-mounts could not have independent options. We had lost the linkage between the mount that a particular alias came from and, so, could not act on per-mount flags. As part of this, all calls through the VFS have been wrapped by macros. They all begin with PNOP_. For instance, the inop_mkdir call is wrapped with PNOP_MKDIR now. These modifications, while intrusive, require no changes to the existing drivers. However, there are many calls that take both a path-node and an inode, and at some time in the future, the path-node, only, will be passed. You might be pro-active in altering the various entry-points so that the inode is ignored -- It's always available now. Of course, that can't be done for the IO routines, which take only an inode. Note, though, that the ioctx structure now carries the path-node, in addition. Perhaps use that? In short, I'm going to deprecate the passing of inodes through the VFS in favor of the path-node at some point. Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -w -b -B -p -r1.16 -r1.16.2.1 --- file.h 3 May 2006 22:34:46 -0000 1.16 +++ file.h 5 Feb 2007 15:54:27 -0000 1.16.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -73,7 +73,7 @@ * operations that may be performed. */ struct file { - struct inode *f_ino; /* path node */ + struct pnode *f_pno; /* path node */ _SYSIO_OFF_T f_pos; /* current stream pos */ unsigned f_ref; /* ref count */ int f_flags; /* open/fcntl flags */ @@ -102,11 +102,11 @@ struct file { /* * Init file record. * - * NB: Don't forget to take a reference to the inode too! + * NB: Don't forget to take a reference to the pnode too! */ -#define _SYSIO_FINIT(fil, ino, flags) \ +#define _SYSIO_FINIT(fil, pno, flags) \ do { \ - (fil)->f_ino = (ino); \ + (fil)->f_pno = (pno); \ (fil)->f_pos = 0; \ (fil)->f_ref = 0; \ (fil)->f_flags = (flags); \ @@ -127,7 +127,7 @@ struct file { struct ioctx; -extern struct file *_sysio_fnew(struct inode *ino, int flags); +extern struct file *_sysio_fnew(struct pnode *pno, int flags); extern void _sysio_fgone(struct file *fil); extern void _sysio_fcompletio(struct ioctx *ioctx, struct file *fil); extern int _sysio_fd_close(int fd); Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -w -b -B -p -r1.27 -r1.27.2.1 --- inode.h 3 May 2006 22:34:46 -0000 1.27 +++ inode.h 5 Feb 2007 15:54:27 -0000 1.27.2.1 @@ -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-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2007 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 @@ -279,6 +279,92 @@ struct pnode { } while (0) /* + * Pnode meta-call. + */ +#define _PNOP_MKCALL(_pno, _fbase, ...) \ + ((_pno)->p_base->pb_ino ? \ + (*(_pno)->p_base->pb_ino->i_ops.inop_##_fbase)(__VA_ARGS__) : \ + -ESTALE) + +/* + * Operations + */ +#define PNOP_LOOKUP(_pno, _inop, _intnt, _path) \ + _PNOP_MKCALL((_pno)->p_parent, lookup, \ + (_pno), (_inop), (_intnt), (_path)) +#define PNOP_GETATTR(_pno, _stbuf) \ + _PNOP_MKCALL((_pno), getattr, \ + (_pno), (_pno)->p_base->pb_ino, (_stbuf)) +#define PNOP_SETATTR(_pno, _mask, _stbuf) \ + _PNOP_MKCALL((_pno), setattr, \ + (_pno), (_pno)->p_base->pb_ino, (_mask), (_stbuf)) +#define PNOP_FILLDIRENTRIES(_pno, _posp, _buf, _nbytes) \ + _PNOP_MKCALL((_pno), filldirentries, \ + (_pno)->p_base->pb_ino, (_posp), (_buf), (_nbytes)) +#define PNOP_MKDIR(_pno, _mode) \ + _PNOP_MKCALL((_pno)->p_parent, mkdir, \ + (_pno), (_mode)) +#define PNOP_RMDIR(_pno) \ + _PNOP_MKCALL((_pno), rmdir, \ + (_pno)) +#define PNOP_SYMLINK(_pno, _data) \ + _PNOP_MKCALL((_pno)->p_parent, symlink, \ + (_pno), (_data)) +#define PNOP_READLINK(_pno, _buf, _bufsiz) \ + _PNOP_MKCALL((_pno), readlink, \ + (_pno), (_buf), (_bufsiz)) +#define PNOP_OPEN(_pno, _flags, _mode) \ + _PNOP_MKCALL((_pno)->p_parent, open, \ + (_pno), (_flags), (_mode)) +#define PNOP_CLOSE(_pno) \ + _PNOP_MKCALL((_pno), close, \ + (_pno)->p_base->pb_ino) +#define PNOP_LINK(_old, _new) \ + _PNOP_MKCALL((_old)->p_parent, link, \ + (_old), (_new)) +#define PNOP_UNLINK(_pno) \ + _PNOP_MKCALL((_pno), unlink, \ + (_pno)) +#define PNOP_RENAME(_old, _new) \ + _PNOP_MKCALL((_old)->p_parent, rename, \ + (_old), (_new)) +#define PNOP_READ(_pno, _ioctx) \ + _PNOP_MKCALL((_pno), read, \ + (_pno)->p_base->pb_ino, (_ioctx)) +#define PNOP_WRITE(_pno, _ioctx) \ + _PNOP_MKCALL((_pno), write, \ + (_pno)->p_base->pb_ino, (_ioctx)) +#define PNOP_POS(_pno, _off) \ + _PNOP_MKCALL((_pno), pos, \ + (_pno)->p_base->pb_ino, (_off)) +#define PNOP_IODONE(_pno, _ioctx) \ + _PNOP_MKCALL((_pno), iodone, \ + (_ioctx)) +#define PNOP_FCNTL(_pno, _cmd, _ap, _rtn) \ + _PNOP_MKCALL((_pno), fcntl, \ + (_pno)->p_base->pb_ino, (_cmd), (_ap), (_rtn)) +#define PNOP_SYNC(_pno) \ + _PNOP_MKCALL((_pno), sync, \ + (_pno)->p_base->pb_ino) +#define PNOP_DATASYNC(_pno) \ + _PNOP_MKCALL((_pno), datasync, \ + (_pno)->p_base->pb_ino) +#define PNOP_IOCTL(_pno, _request, _ap) \ + _PNOP_MKCALL((_pno), ioctl, \ + (_pno)->p_base->pb_ino, (_request), (_ap)) +#define PNOP_MKNOD(_pno, _mode, _dev) \ + _PNOP_MKCALL((_pno)->p_parent, mknod, \ + (_pno), (_mode), (_dev)) +#ifdef _HAVE_STATVFS +#define PNOP_STATVFS(_pno, _buf) \ + _PNOP_MKCALL((_pno), statvfs, \ + (_pno), (_pno)->p_base->pb_ino, (_buf)) +#endif +#define PNOP_GONE(_pno) \ + _PNOP_MKCALL((_pno), gone, \ + (_pno)->p_base->pb_ino) + +/* * An intent record allows callers of namei and lookup to pass some information * about what they want to accomplish in the end. */ @@ -369,7 +455,8 @@ struct ioctx { ioctx_fast : 1, /* from stack space */ ioctx_done : 1, /* transfer complete */ ioctx_write : 1; /* op is a write */ - struct inode *ioctx_ino; /* i-node */ + struct pnode *ioctx_pno; /* p-node */ + struct inode *ioctx_ino; /* i-node (deprecate) */ const struct iovec *ioctx_iov; /* scatter/gather vec */ size_t ioctx_iovlen; /* iovec length */ const struct intnl_xtvec *ioctx_xtv; /* extents */ @@ -383,12 +470,13 @@ struct ioctx { /* * Init IO context record. */ -#define IOCTX_INIT(ioctx, fast, wr, ino, iov, iovlen, xtv, xtvlen) \ +#define IOCTX_INIT(ioctx, fast, wr, pno, iov, iovlen, xtv, xtvlen) \ do { \ (ioctx)->ioctx_fast = (fast); \ (ioctx)->ioctx_done = 0; \ (ioctx)->ioctx_write = (wr) ? 1 : 0; \ - (ioctx)->ioctx_ino = (ino); \ + (ioctx)->ioctx_pno = (pno); \ + (ioctx)->ioctx_ino = (pno)->p_base->pb_ino; \ (ioctx)->ioctx_iov = (iov); \ (ioctx)->ioctx_iovlen = (iovlen); \ (ioctx)->ioctx_xtv = (xtv); \ @@ -424,25 +512,25 @@ extern struct inode *_sysio_i_find(struc struct file_identifier *fid); extern void _sysio_i_gone(struct inode *ino); extern void _sysio_i_undead(struct inode *ino); +extern struct pnode_base *_sysio_pb_new(struct qstr *name, + struct pnode_base *parent, + struct inode *ino); +extern void _sysio_pb_gone(struct pnode_base *pb); extern int _sysio_p_find_alias(struct pnode *parent, struct qstr *name, struct pnode **pnop); extern int _sysio_p_validate(struct pnode *pno, struct intent *intnt, const char *path); -extern struct pnode_base *_sysio_pb_new(struct qstr *name, - struct pnode_base *parent, - struct inode *ino); -extern void _sysio_pb_gone(struct pnode_base *pb); extern struct pnode *_sysio_p_new_alias(struct pnode *parent, struct pnode_base *pb, struct mount *mnt); extern void _sysio_p_gone(struct pnode *pno); +extern void _sysio_pb_disconnect(struct pnode_base *pb); extern size_t _sysio_p_prune(struct pnode *root); extern int _sysio_p_kill_all(struct pnode *root); extern char *_sysio_pb_path(struct pnode_base *pb, char separator); extern int _sysio_setattr(struct pnode *pno, - struct inode *ino, unsigned mask, struct intnl_stat *stbuf); extern void _sysio_do_noop(void); @@ -467,7 +555,7 @@ extern int _sysio_namei(struct pnode *pn extern int _sysio_p_chdir(struct pnode *pno); extern int _sysio_ioctx_init(void); extern void _sysio_ioctx_enter(struct ioctx *ioctx); -extern struct ioctx *_sysio_ioctx_new(struct inode *ino, +extern struct ioctx *_sysio_ioctx_new(struct pnode *pno, int wr, const struct iovec *iov, size_t iovlen, |
From: Lee W. <lw...@us...> - 2007-02-05 15:54:35
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6564 Modified Files: Tag: unification configure.in Log Message: The open file table now maintains a link to the path-node, or `pnode', instead of the inode. This is done in order to enable support for per-mount options. The issue is that bound-mounts could not have independent options. We had lost the linkage between the mount that a particular alias came from and, so, could not act on per-mount flags. As part of this, all calls through the VFS have been wrapped by macros. They all begin with PNOP_. For instance, the inop_mkdir call is wrapped with PNOP_MKDIR now. These modifications, while intrusive, require no changes to the existing drivers. However, there are many calls that take both a path-node and an inode, and at some time in the future, the path-node, only, will be passed. You might be pro-active in altering the various entry-points so that the inode is ignored -- It's always available now. Of course, that can't be done for the IO routines, which take only an inode. Note, though, that the ioctx structure now carries the path-node, in addition. Perhaps use that? In short, I'm going to deprecate the passing of inodes through the VFS in favor of the path-node at some point. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -w -b -B -p -r1.25 -r1.25.2.1 --- configure.in 19 Dec 2006 21:22:33 -0000 1.25 +++ configure.in 5 Feb 2007 15:54:27 -0000 1.25.2.1 @@ -161,7 +161,7 @@ AC_ARG_WITH(sockets, AC_HELP_STRING([--with-sockets], [build sockets interface driver (EXPERIMENTAL)]), [ case "${withval}" in - yes) ;; + yes) AC_MSG_ERROR(the sockets driver is broken right now);; no) ;; *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;; esac], |
From: Lee W. <lw...@us...> - 2007-01-02 20:44:17
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2466 Modified Files: configure.in Log Message: Fix return type for readlink with newer versions of glibc >From Oleg Drokin at Cluster File Systems: [...] newer glibc version readlink returns ssize_t instead of int, and thus libsysio cannot be compiled anymore due to conflicting declarations. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- configure.in 19 Dec 2006 21:22:33 -0000 1.25 +++ configure.in 2 Jan 2007 20:44:10 -0000 1.26 @@ -238,6 +238,20 @@ if test "$machine" = rs6000; then machine="powerpc" fi +AC_MSG_CHECKING(if readlink returns ssize_t) +AC_TRY_COMPILE([ + include <unistd.h> +],[ + ssize_t readlink(const char *, char *, size_t); +], + readlink_returns_ssize_t="yes", + readlink_returns_ssize_t="yes" +) +AC_MSG_RESULT($readlink_returns_ssize_t) +if test x$readlink_returns_ssize_t = xyes; then + AC_DEFINE(HAVE_POSIX_1003_READLINK, 1, [readlink returns ssize_t]) +fi + # If we can't provoke the declaration of stat64 then we assume the # environment supports 64-bit file support naturally. Beware! AC_MSG_CHECKING(whether _LARGEFILE64_SOURCE definition is required) |
From: Lee W. <lw...@us...> - 2007-01-02 20:44:15
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2466/src Modified Files: readlink.c Log Message: Fix return type for readlink with newer versions of glibc >From Oleg Drokin at Cluster File Systems: [...] newer glibc version readlink returns ssize_t instead of int, and thus libsysio cannot be compiled anymore due to conflicting declarations. Index: readlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/readlink.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- readlink.c 14 Oct 2004 14:59:29 -0000 1.6 +++ readlink.c 2 Jan 2007 20:44:10 -0000 1.7 @@ -55,7 +55,11 @@ #include "inode.h" #include "sysio-symbols.h" +#ifdef HAVE_POSIX_1003_READLINK +ssize_t +#else int +#endif SYSIO_INTERFACE_NAME(readlink)(const char *path, char *buf, size_t bufsiz) { struct intent intent; |
From: Lee W. <lw...@us...> - 2007-01-02 20:44:14
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2466/include Modified Files: sysio.h Log Message: Fix return type for readlink with newer versions of glibc >From Oleg Drokin at Cluster File Systems: [...] newer glibc version readlink returns ssize_t instead of int, and thus libsysio cannot be compiled anymore due to conflicting declarations. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -w -b -B -p -r1.38 -r1.39 --- sysio.h 1 Jun 2006 21:28:57 -0000 1.38 +++ sysio.h 2 Jan 2007 20:44:10 -0000 1.39 @@ -252,7 +252,11 @@ extern int SYSIO_INTERFACE_NAME(ftruncat #endif extern int SYSIO_INTERFACE_NAME(rmdir)(const char *path); extern int SYSIO_INTERFACE_NAME(symlink)(const char *path1, const char *path2); +#ifdef HAVE_POSIX_1003_READLINK +extern ssize_t SYSIO_INTERFACE_NAME(readlink)(const char *path, +#else extern int SYSIO_INTERFACE_NAME(readlink)(const char *path, +#endif char *buf, size_t bufsiz); extern int SYSIO_INTERFACE_NAME(link)(const char *oldpath, const char *newpath); |
From: Ruth K. <rk...@us...> - 2006-12-19 21:22:37
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25211 Modified Files: configure.in Log Message: aclocal 1.10 is particular about ordering of AC_PROG_CC Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- configure.in 12 Dec 2006 00:48:18 -0000 1.24 +++ configure.in 19 Dec 2006 21:22:33 -0000 1.25 @@ -13,9 +13,9 @@ case "$host_os" in esac AM_INIT_AUTOMAKE([subdir-objects]) +AC_PROG_CC AM_PROG_CC_C_O -AC_PROG_CC AC_PROG_RANLIB AC_PROG_MAKE_SET AC_HEADER_STDC |
From: Ruth K. <rk...@us...> - 2006-12-12 00:49:01
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31845 Added Files: creds.h Log Message: add missing creds.h --- 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... */ #include <unistd.h> #ifndef _CREDS_H_ #define _CREDS_H_ /* * Data structure for user credentials */ struct creds { uid_t creds_uid; gid_t *creds_gids; int creds_ngids; }; #endif |
From: Ruth K. <rk...@us...> - 2006-12-12 00:48:22
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31794 Modified Files: configure.in Log Message: set SYSIO_TRACING to 1 instead of yes, and remove dup configure block Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- configure.in 27 Feb 2006 16:46:41 -0000 1.23 +++ configure.in 12 Dec 2006 00:48:18 -0000 1.24 @@ -118,7 +118,7 @@ AC_ARG_WITH(tracing, AC_HELP_STRING([--with-tracing], [enable tracing support]), [ case "${withval}" in - yes) TRACING=-DSYSIO_TRACING=${withval} ;; + yes) TRACING=-DSYSIO_TRACING=1 ;; no) ;; *) AC_MSG_ERROR(bad value ${withval} for --with-tracing) ;; esac], @@ -182,17 +182,6 @@ if test x$with_lustre_hack = xyes; then AC_DEFINE(HAVE_LUSTRE_HACK) fi -AC_ARG_WITH(tracing, - AC_HELP_STRING([--with-tracing], - [enable tracing support]), - [ case "${withval}" in - yes) TRACING=-DSYSIO_TRACING=${withval} ;; - no) ;; - *) AC_MSG_ERROR(bad value ${withval} for --with-tracing) ;; - esac], - [TRACING=-DSYSIO_TRACING=1]) -AC_SUBST(TRACING) - AC_ARG_WITH(alternate-symbols, AC_HELP_STRING([--with-alternate-symbols@<:@=<qualifier>@:>@], [Prepend standard, public, symbols with a unique qualifer]), |