libsysio-commit Mailing List for libsysio (Page 12)
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: Lee W. <lw...@us...> - 2007-05-01 15:30:57
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31415 Modified Files: fs_incore.c Log Message: Changed the comment about uid and group specifier to reflect reality. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -w -b -B -p -r1.30 -r1.31 --- fs_incore.c 30 Apr 2007 23:24:12 -0000 1.30 +++ fs_incore.c 1 May 2007 15:30:52 -0000 1.31 @@ -535,7 +535,7 @@ _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; |
From: Lee W. <lw...@us...> - 2007-05-01 14:46:51
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15385 Modified Files: statvfs.c Log Message: Update contact info. Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- statvfs.c 30 Apr 2007 23:24:13 -0000 1.14 +++ statvfs.c 1 May 2007 14:46:49 -0000 1.15 @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ |
From: Lee W. <lw...@us...> - 2007-05-01 14:39:16
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12261 Added Files: test_statvfs.c Log Message: A test for the {f,}statvfs 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-1319 * * le...@sa... */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/statvfs.h> #if defined(SYSIO_LABEL_NAMES) #include "sysio.h" #endif #include "test.h" /* * Get stats of file and file system. * * Usage: test_statvfs [<path> ...] */ void usage(void); void do_statvfs(const char *path); int main(int argc, char * const argv[]) { int i; int err; extern int _test_sysio_startup(void); /* * Parse command-line args. */ while ((i = getopt(argc, argv, "")) != -1) switch (i) { default: usage(); } err = _test_sysio_startup(); if (err) { errno = -err; perror("sysio startup"); exit(1); } (void )SYSIO_INTERFACE_NAME(umask)(022); while (optind < argc) do_statvfs(argv[optind++]); /* * Clean up. */ _test_sysio_shutdown(); return 0; } void usage() { (void )fprintf(stderr, "Usage: test_statvfs" " <path> ...\n"); exit(1); } void do_statvfs(const char *path) { int fd; int err; struct statvfs stvfsbuf1, stvfsbuf2; fd = SYSIO_INTERFACE_NAME(open)(path, O_RDONLY); if (fd < 0) { perror(path); return; } err = SYSIO_INTERFACE_NAME(fstatvfs)(fd, &stvfsbuf1); if (!err) err = SYSIO_INTERFACE_NAME(statvfs)(path, &stvfsbuf2); else fd = -1; if (err) perror(path); if (fd >= 0 && SYSIO_INTERFACE_NAME(close)(fd) != 0) perror(path); if (err) return; if (stvfsbuf1.f_fsid != stvfsbuf2.f_fsid) { (void )fprintf(stderr, "%s: [f]statvfs info mismatch\n", path); return; } printf("%s:" " bsize %lu," " frsize %lu," " blocks %llu," " bfree %llu," " bavail %llu," " files %llu," " ffree %llu," " favail %llu," " fsid %lu," " flag %lu," " namemax %lu," "\n", path, (unsigned long )stvfsbuf1.f_bsize, (unsigned long )stvfsbuf1.f_frsize, (unsigned long long )stvfsbuf1.f_blocks, (unsigned long long )stvfsbuf1.f_bfree, (unsigned long long )stvfsbuf1.f_bavail, (unsigned long long )stvfsbuf1.f_files, (unsigned long long )stvfsbuf1.f_ffree, (unsigned long long)stvfsbuf1.f_favail, (unsigned long )stvfsbuf1.f_fsid, (unsigned long )stvfsbuf1.f_flag, (unsigned long)stvfsbuf1.f_namemax); } |
From: Lee W. <lw...@us...> - 2007-04-30 23:24:16
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2987/include Modified Files: dev.h fs.h inode.h native.h sysio-cmn.h sysio.h Log Message: Restore support of statvfs{,64}. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- dev.h 4 Aug 2005 20:17:10 -0000 1.10 +++ dev.h 30 Apr 2007 23:24:12 -0000 1.11 @@ -136,12 +136,10 @@ extern const struct inode_ops _sysio_nod (int (*)(struct pnode *, \ mode_t, \ dev_t))_sysio_do_illop -#ifdef _HAVE_STATVFS #define _sysio_nodev_inop_statvfs \ (int (*)(struct pnode *, \ struct inode *, \ struct intnl_statvfs *))_sysio_do_illop -#endif #define _sysio_nodev_inop_gone \ (void (*)(struct inode *ino))_sysio_do_noop Index: fs.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/fs.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- fs.h 6 Feb 2004 20:07:29 -0000 1.5 +++ fs.h 30 Apr 2007 23:24:12 -0000 1.6 @@ -117,7 +117,7 @@ struct filesys { void *fs_private; /* driver data */ struct itable_entry fs_itbl[FS_ITBLSIZ]; /* inodes hash */ unsigned long fs_id; /* ID */ - size_t fs_bsize; /* block size */ + size_t fs_bsize; /* DEPRECATED */ }; #define FS_F_RO 0x01 /* read-only */ Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -b -B -p -r1.28 -r1.29 --- inode.h 30 Apr 2007 16:52:20 -0000 1.28 +++ inode.h 30 Apr 2007 23:24:13 -0000 1.29 @@ -63,9 +63,7 @@ struct inode; struct intent; struct intnl_dirent; struct intnl_stat; -#ifdef _HAVE_STATVFS struct intnl_statvfs; -#endif struct io_arguments; struct ioctx; @@ -108,11 +106,9 @@ struct inode_ops { int (*inop_datasync)(struct inode *ino); int (*inop_ioctl)(struct inode *ino, unsigned long int request, va_list ap); int (*inop_mknod)(struct pnode *pno, mode_t mode, dev_t dev); -#ifdef _HAVE_STATVFS int (*inop_statvfs)(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); -#endif void (*inop_gone)(struct inode *ino); }; @@ -343,10 +339,8 @@ struct pnode { _PNOP_CALL((_pno), ioctl, (_pno)->p_base->pb_ino, (_request), (_ap)) #define PNOP_MKNOD(_pno, _mode, _dev) \ _PNOP_MKCALL((_pno), mknod, (_pno), (_mode), (_dev)) -#ifdef _HAVE_STATVFS #define PNOP_STATVFS(_pno, _buf) \ _PNOP_CALL((_pno), statvfs, (_pno), (_pno)->p_base->pb_ino, (_buf)) -#endif #define PNOP_GONE(_pno) \ _PNOP_CALL((_pno), gone, (_pno)->p_base->pb_ino) Index: native.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/native.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- native.h 14 Oct 2004 14:59:28 -0000 1.2 +++ native.h 30 Apr 2007 23:24:13 -0000 1.3 @@ -220,6 +220,13 @@ do { #if defined(SYS_utime) #define SYSIO_SYS_utime SYS_utime #endif +#if _LARGEFILE64_SOURCE && defined(SYS_statfs64) +#define SYSIO_SYS_statfs SYS_statfs64 +#define SYSIO_SYS_fstatfs SYS_fstatfs64 +#elif defined(SYS_statfs) +#define SYSIO_SYS_statfs SYS_statfs +#define SYSIO_SYS_fstatfs SYS_fstatfs +#endif #if defined(SYS_socketcall) #define SYSIO_SYS_socketcall SYS_socketcall #endif Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- sysio-cmn.h 30 Apr 2007 16:52:20 -0000 1.13 +++ sysio-cmn.h 30 Apr 2007 23:24:13 -0000 1.14 @@ -198,6 +198,10 @@ typedef enum { _SYSIO_TTAG(rmdir), _SYSIO_TTAG(xstatnd), _SYSIO_TTAG(fxstat), + _SYSIO_TTAG(statvfs64), + _SYSIO_TTAG(fstatvfs64), + _SYSIO_TTAG(statvfs), + _SYSIO_TTAG(fstatvfs), _SYSIO_TTAG(opendir), _SYSIO_TTAG(closedir), _SYSIO_TTAG(symlink), Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -w -b -B -p -r1.39 -r1.40 --- sysio.h 2 Jan 2007 20:44:10 -0000 1.39 +++ sysio.h 30 Apr 2007 23:24:13 -0000 1.40 @@ -96,20 +96,17 @@ struct dirent; #endif struct stat; -#ifdef _HAVE_STATVFS #if _LARGEFILE64_SOURCE #define intnl_statvfs statvfs64 #else #define intnl_statvfs statvfs -#define INTNL_STATVFS_IS_NATURAL 1 #endif struct statvfs; -struct intnl_statvfs; -#endif struct utimbuf; struct intnl_stat; +struct intnl_statvfs; struct pnode; @@ -231,7 +228,6 @@ extern ssize_t SYSIO_INTERFACE_NAME(pwri extern ssize_t SYSIO_INTERFACE_NAME(writev)(int fd, const struct iovec *iov, int count); -#ifdef _HAVE_STATVFS extern int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf); #if _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(statvfs64)(const char *path, @@ -241,7 +237,6 @@ extern int SYSIO_INTERFACE_NAME(fstatvfs #if _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf); #endif -#endif extern int SYSIO_INTERFACE_NAME(truncate)(const char *path, off_t length); #if _LARGEFILE64_SOURCE extern int SYSIO_INTERFACE_NAME(truncate64)(const char *path, off64_t length); |
From: Lee W. <lw...@us...> - 2007-04-30 23:24:16
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2987/src Modified Files: dev.c module.mk statvfs.c Removed Files: statvfs64.c Log Message: Restore support of statvfs{,64}. Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- dev.c 4 Aug 2005 20:17:10 -0000 1.10 +++ dev.c 30 Apr 2007 23:24:13 -0000 1.11 @@ -75,9 +75,7 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_datasync, _sysio_nodev_inop_ioctl, _sysio_nodev_inop_mknod, -#ifdef _HAVE_STATVFS _sysio_nodev_inop_statvfs, -#endif _sysio_nodev_inop_gone }; Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- module.mk 30 Apr 2007 16:52:20 -0000 1.11 +++ module.mk 30 Apr 2007 23:24:13 -0000 1.12 @@ -1,8 +1,3 @@ -# -# Note; Remove statvfs{,64}.c until we decide what to do with them. -# Lee; Tue Feb 24 09:37:32 EST 2004 -# - if WITH_LUSTRE_HACK FILE_SUPPORT = src/file_hack.c else @@ -23,7 +18,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/stat.c \ + src/rmdir.c src/stat.c src/statvfs.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: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- statvfs.c 30 Apr 2007 16:52:20 -0000 1.13 +++ statvfs.c 30 Apr 2007 23:24:13 -0000 1.14 @@ -41,13 +41,13 @@ * le...@sa... */ -#ifndef BSD - #include <unistd.h> #include <errno.h> #include <assert.h> -#include <sys/statvfs.h> +#include <sys/vfs.h> #include <sys/types.h> +#include <sys/stat.h> +#include <sys/statvfs.h> #include <sys/queue.h> #include "sysio.h" @@ -53,12 +53,79 @@ #include "sysio.h" #include "inode.h" #include "file.h" + #include "sysio-symbols.h" +static int +_sysio_statvfs(const char *path, struct intnl_statvfs *buf) +{ + int err; + struct pnode *pno; + + err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); + if (err) + return err; + + err = PNOP_STATVFS(pno, buf); + P_RELE(pno); + return err; +} + +static int +_sysio_fstatvfs(int fd, struct intnl_statvfs *buf) +{ + int err; + struct file *filp; + + err = 0; + filp = _sysio_fd_find(fd); + if (!filp) + return -EBADF; + + err = PNOP_STATVFS(filp->f_pno, buf); + return err; +} + +#if defined(_LARGEFILE64_SOURCE) +int +SYSIO_INTERFACE_NAME(statvfs64)(const char *path, struct statvfs64 *buf) +{ + int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + + SYSIO_INTERFACE_ENTER(statvfs64, path); + err = _sysio_statvfs(path, buf); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs64, buf); +} + +#ifdef REDSTORM +#undef __statvfs64 +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(statvfs64), + PREPEND(__, SYSIO_INTERFACE_NAME(statvfs64))) +#endif + +int +SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, struct statvfs64 *buf) +{ + int err; + SYSIO_INTERFACE_DISPLAY_BLOCK; + + SYSIO_INTERFACE_ENTER(fstatvfs64, fd, buf); + err = _sysio_fstatvfs(fd, buf); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs64, buf); +} + +#ifdef REDSTORM +#undef __fstatvfs64 +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs64), + PREPEND(__, SYSIO_INTERFACE_NAME(fstatvfs64))) +#endif +#endif /* defined(_LARGEFILE64_SOURCE) */ + #undef statvfs #undef fstatvfs -#ifndef INTNL_STATVFS_IS_NATURAL +#if defined(_LARGEFILE64_SOURCE) static void convstatvfs(struct statvfs *stvfsbuf, struct intnl_statvfs *istvfsbuf) { @@ -74,36 +141,27 @@ convstatvfs(struct statvfs *stvfsbuf, st stvfsbuf->f_flag = istvfsbuf->f_flag; stvfsbuf->f_namemax = istvfsbuf->f_namemax; } -#endif +#endif /* defined(_LARGEFILE64_SOURCE) */ int SYSIO_INTERFACE_NAME(statvfs)(const char *path, struct statvfs *buf) { int err; - struct pnode *pno; -#ifdef INTNL_STATVFS_IS_NATURAL -#define _call_buf buf -#else +#if defined(_LARGEFILE64_SOURCE) struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; -#endif +#else +#define _call_buf buf +#endif /* defined(_LARGEFILE64_SOURCE) */ SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER(statvfs, path); - err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); - if (err) - goto out; - - err = PNOP_STATVFS(pno, _call_buf); - P_RELE(pno); - if (err) - goto err; -#ifndef INTNL_STATVFS_IS_NATURAL + err = _sysio_statvfs(path, _call_buf); +#if defined(_LARGEFILE64_SOURCE) + if (!err) convstatvfs(buf, _call_buf); -#endif - goto out; -err: -out: +#undef _call_buf +#endif /* defined(_LARGEFILE64_SOURCE) */ SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs, buf); } @@ -117,32 +175,21 @@ int SYSIO_INTERFACE_NAME(fstatvfs)(int fd, struct statvfs *buf) { int err; - struct file *filp; -#ifdef INTNL_STATVFS_IS_NATURAL -#define _call_buf buf -#else +#if defined(_LARGEFILE64_SOURCE) struct intnl_statvfs _call_buffer; struct intnl_statvfs *_call_buf = &_call_buffer; -#endif +#else +#define _call_buf buf +#endif /* defined(_LARGEFILE64_SOURCE) */ SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER(fstatvfs, fd); - err = 0; - filp = _sysio_fd_find(fd); - if (!filp) { - err = -EBADF; - goto out; - } - - err = PNOP_STATVFS(filp->f_pno, _call_buf); - if (err) - goto err; + err = _sysio_fstatvfs(fd, _call_buf); #ifndef INTNL_STATVFS_IS_NATURAL + if (!err) convstatvfs(buf, _call_buf); +#undef _call_buf #endif - goto out; -err: -out: SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs, buf); } @@ -151,5 +198,3 @@ out: sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(fstatvfs), PREPEND(__, SYSIO_INTERFACE_NAME(fstatvfs))) #endif - -#endif /* ifndef BSD */ --- statvfs64.c DELETED --- |
From: Lee W. <lw...@us...> - 2007-04-30 23:24:16
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2987/tests Modified Files: Makefile.am Log Message: Restore support of statvfs{,64}. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -b -B -p -r1.28 -r1.29 --- Makefile.am 14 Mar 2007 21:03:12 -0000 1.28 +++ Makefile.am 30 Apr 2007 23:24:13 -0000 1.29 @@ -1,7 +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_chown + test_chown test_statvfs CLEANFILES=drv_data.c @@ -102,6 +102,10 @@ test_chown_SOURCES=test_chown.c $(CMNSRC test_chown_CFLAGS=$(CFL) test_chown_DEPENDENCIES=$(LIBS) +test_statvfs_SOURCES=test_statvfs.c $(CMNSRC) +test_statvfs_CFLAGS=$(CFL) +test_statvfs_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-04-30 23:24:16
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2987/drivers/native Modified Files: fs_native.c Log Message: Restore support of statvfs{,64}. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -w -b -B -p -r1.59 -r1.60 --- fs_native.c 10 Apr 2006 23:21:24 -0000 1.59 +++ fs_native.c 30 Apr 2007 23:24:12 -0000 1.60 @@ -61,13 +61,8 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> -#if 0 -#include <sys/vfs.h> -#endif -#ifdef _HAVE_STATVFS -#include <sys/statvfs.h> #include <sys/statfs.h> -#endif +#include <sys/statvfs.h> #include <utime.h> #include <sys/uio.h> #include <sys/queue.h> @@ -200,11 +195,9 @@ static int native_inop_ioctl(struct inod unsigned long int request, va_list ap); static int native_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); -#ifdef _HAVE_STATVFS static int native_inop_statvfs(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); -#endif static void native_inop_gone(struct inode *ino); static struct inode_ops native_i_ops = { @@ -230,9 +223,7 @@ static struct inode_ops native_i_ops = { native_inop_datasync, native_inop_ioctl, native_inop_mknod, -#ifdef _HAVE_STATVFS native_inop_statvfs, -#endif native_inop_gone }; @@ -1662,7 +1653,6 @@ native_inop_mknod(struct pnode *pno __IS return -ENOSYS; } -#ifdef _HAVE_STATVFS static int native_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -1702,13 +1692,14 @@ native_inop_statvfs(struct pnode *pno, buf->f_bavail = fs.f_bavail; buf->f_files = fs.f_files; /* Total number serial numbers */ buf->f_ffree = fs.f_ffree; /* Number free serial numbers */ - buf->f_favail = fs.f_ffree; /* Number free ser num for non-privileged*/ - buf->f_fsid = fs.f_fsid.__val[1]; - buf->f_flag = 0; /* No equiv in statfs; maybe use type? */ + buf->f_favail = fs.f_ffree; /* Ditto, for non-privileged though */ + buf->f_fsid = ino->i_fs->fs_id; + buf->f_flag = 0; + if (pno) + buf->f_flag = pno->p_mount->mnt_flags; buf->f_namemax = fs.f_namelen; return 0; } -#endif static int native_inop_sync(struct inode *ino) |
From: Lee W. <lw...@us...> - 2007-04-30 23:24:16
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2987/drivers/incore Modified Files: fs_incore.c Log Message: Restore support of statvfs{,64}. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- fs_incore.c 30 Apr 2007 16:52:19 -0000 1.29 +++ fs_incore.c 30 Apr 2007 23:24:12 -0000 1.30 @@ -56,9 +56,7 @@ #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> -#ifdef _HAVE_STATVFS #include <sys/statvfs.h> -#endif #include <sys/queue.h> #include "sysio.h" @@ -154,11 +152,9 @@ static int _sysio_incore_filop_ioctl(str unsigned long int request, va_list ap); static int _sysio_incore_dirop_mknod(struct pnode *pno, mode_t mode, dev_t dev); -#ifdef _HAVE_STATVFS static int _sysio_incore_inop_statvfs(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); -#endif static void _sysio_incore_inop_gone(struct inode *ino); #define _sysio_incore_dirop_symlink \ @@ -206,9 +202,7 @@ static struct inode_ops _sysio_incore_di _sysio_incore_inop_sync, _sysio_incore_dirop_ioctl, _sysio_incore_dirop_mknod, -#ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, -#endif _sysio_incore_inop_gone }; @@ -261,9 +255,7 @@ static struct inode_ops _sysio_incore_fi _sysio_incore_inop_sync, _sysio_incore_filop_ioctl, _sysio_incore_filop_mknod, -#ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, -#endif _sysio_incore_inop_gone }; @@ -290,9 +282,7 @@ static struct inode_ops _sysio_incore_de _sysio_nodev_inop_sync, _sysio_nodev_inop_ioctl, _sysio_incore_filop_mknod, -#ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, -#endif _sysio_incore_inop_gone }; @@ -1697,17 +1687,14 @@ _sysio_incore_dirop_mknod(struct pnode * return incore_create(pno, &stat); } -#ifdef _HAVE_STATVFS static int _sysio_incore_inop_statvfs(struct pnode *pno, - struct inode *ino, + struct inode *ino __IS_UNUSED, struct intnl_statvfs *buf) { struct filesys *fs; - if (!ino) - ino = pno->p_base->pb_ino; - assert(ino); + assert(pno); fs = pno->p_base->pb_ino->i_fs; @@ -1716,9 +1703,9 @@ _sysio_incore_inop_statvfs(struct pnode /* * Mostly, we lie. */ - buf->f_bsize = fs->fs_bsize; + buf->f_bsize = getpagesize(); buf->f_frsize = buf->f_bsize; - buf->f_blocks = ~0; + buf->f_blocks = sizeof(char *) * ULONG_MAX; buf->f_blocks /= buf->f_bsize; buf->f_bfree = buf->f_blocks - 1; buf->f_bavail = buf->f_bfree; @@ -1726,12 +1713,11 @@ _sysio_incore_inop_statvfs(struct pnode buf->f_ffree = buf->f_files - 1; buf->f_favail = buf->f_ffree; buf->f_fsid = fs->fs_id; - buf->f_flag = 0; - buf->f_namemax = ULONG_MAX; + buf->f_flag = pno->p_mount->mnt_flags; + buf->f_namemax = 255; return 0; } -#endif void _sysio_incore_inop_gone(struct inode *ino) |
From: Lee W. <lw...@us...> - 2007-04-30 23:24:15
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2987 Modified Files: configure.in Log Message: Restore support of statvfs{,64}. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.30 retrieving revision 1.31 diff -u -w -b -B -p -r1.30 -r1.31 --- configure.in 30 Apr 2007 16:52:19 -0000 1.30 +++ configure.in 30 Apr 2007 23:24:12 -0000 1.31 @@ -343,6 +343,12 @@ if test x$have_st_gen = xyes; then AC_DEFINE(HAVE_GENERATION) fi +# +# Backward compatibility. The core no longer needs it. We used to check for +# this. Now we assume it and, so, want to provoke support from the drivers. +# +AC_DEFINE(_HAVE_STATVFS) + AC_MSG_CHECKING(whether .text pseudo-op must be used) AC_CACHE_VAL(sysio_asm_dot_text, [dnl cat > conftest.s <<EOF |
From: Lee W. <lw...@us...> - 2007-04-30 19:36:47
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11167 Modified Files: rw.c Log Message: Added the internal glibc names for {p}{read,write}{v}. Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- rw.c 30 Apr 2007 16:52:20 -0000 1.18 +++ rw.c 30 Apr 2007 19:36:44 -0000 1.19 @@ -787,6 +787,15 @@ SYSIO_INTERFACE_NAME(pread64)(int fd, vo return _do_pio(fd, _do_ireadx, buf, count, offset); } +#if defined(__GLIBC__) +#undef __pread64 +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread64), + PREPEND(__, SYSIO_INTERFACE_NAME(pread64))) +#undef __libc_pread64 +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread64), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pread64))) +#endif + ssize_t SYSIO_INTERFACE_NAME(pwrite64)(int fd, const void *buf, size_t count, @@ -795,6 +804,15 @@ SYSIO_INTERFACE_NAME(pwrite64)(int fd, return _do_pio(fd, _do_iwritex, (void *)buf, count, offset); } + +#if defined(__GLIBC__) +#undef __pwrite64 +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pwrite64), + PREPEND(__, SYSIO_INTERFACE_NAME(pwrite64))) +#undef __libc_pwrite64 +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pwrite64), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pwrite64))) +#endif /* defined(__GLIBC__) */ #endif ssize_t @@ -807,6 +825,15 @@ SYSIO_INTERFACE_NAME(pread)(int fd, return _do_pio(fd, _do_ireadx, buf, count, offset); } +#if defined(__GLIBC__) +#undef __pread +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), + PREPEND(__, SYSIO_INTERFACE_NAME(pread))) +#undef __libc_pread +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pread), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pread))) +#endif /* defined(__GLIBC__) */ + ssize_t SYSIO_INTERFACE_NAME(pwrite)(int fd, const void *buf, @@ -817,6 +844,15 @@ SYSIO_INTERFACE_NAME(pwrite)(int fd, return _do_pio(fd, _do_iwritex, (void *)buf, count, offset); } +#if defined(__GLIBC__) +#undef __pwrite +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pwrite), + PREPEND(__, SYSIO_INTERFACE_NAME(pwrite))) +#undef __libc_pwrite +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(pwrite), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_pwrite))) +#endif /* defined(__GLIBC__) */ + /* * Post asynch IO using fildes and iovec. */ @@ -919,6 +955,15 @@ SYSIO_INTERFACE_NAME(readv)(int fd, cons return _do_iov(fd, SYSIO_INTERFACE_NAME(ireadv), iov, count); } +#if defined(__GLIBC__) +#undef __readv +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(readv), + PREPEND(__, SYSIO_INTERFACE_NAME(readv))) +#undef __libc_readv +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(readv), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_readv))) +#endif + ssize_t SYSIO_INTERFACE_NAME(writev)(int fd, const struct iovec *iov, int count) { @@ -926,6 +971,15 @@ SYSIO_INTERFACE_NAME(writev)(int fd, con return _do_iov(fd, SYSIO_INTERFACE_NAME(iwritev), iov, count); } +#if defined(__GLIBC__) +#undef __writev +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(writev), + PREPEND(__, SYSIO_INTERFACE_NAME(writev))) +#undef __libc_writev +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(writev), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_writev))) +#endif + /* * Post asynch IO using fildes. */ @@ -984,6 +1038,15 @@ SYSIO_INTERFACE_NAME(read)(int fd, void return _do_io(fd, SYSIO_INTERFACE_NAME(iread), buf, count); } +#if defined(__GLIBC__) +#undef __read +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(read), + PREPEND(__, SYSIO_INTERFACE_NAME(read))) +#undef __libc_read +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(read), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_read))) +#endif + ssize_t SYSIO_INTERFACE_NAME(write)(int fd, const void *buf, size_t count) { @@ -994,3 +1057,12 @@ SYSIO_INTERFACE_NAME(write)(int fd, cons size_t))SYSIO_INTERFACE_NAME(iwrite), (void *)buf, count); } + +#if defined(__GLIBC__) +#undef __write +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(write), + PREPEND(__, SYSIO_INTERFACE_NAME(write))) +#undef __libc_write +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(write), + PREPEND(__, SYSIO_INTERFACE_NAME(libc_write))) +#endif |
From: Lee W. <lw...@us...> - 2007-04-30 16:56:31
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3499 Modified Files: access.c Log Message: Got rid of the warning about _sysio_getcreds not being used. We'll need the function later but I'm tired of it right now. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- access.c 30 Apr 2007 16:52:20 -0000 1.15 +++ access.c 30 Apr 2007 16:56:25 -0000 1.16 @@ -210,12 +210,14 @@ _sysio_ldcreds(uid_t uid, gid_t gid, str return 0; } +#if 0 static int _sysio_getcreds(struct creds *crp) { return _sysio_ldcreds(getuid(), getgid(), crp); } +#endif /* * Determine if a given access is permitted to a given file. |
From: Lee W. <lw...@us...> - 2007-04-30 16:52:28
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2000/include Modified Files: file.h inode.h sysio-cmn.h Log Message: Merged "unification" branch. First, the changes alter the core to perform pnode-ops by pnode. However, it maintains the pre-existing interface in order to minimize driver changes. Second, more detailed tracing information is available now in the form of a tag, indicating which function the data is from, as well as arguments and return data. Note1: The S_IFDIR bit is no longer set when the pnode-op mkdir function is called. If you need that, set it in your driver. Note2: It is possible to encounter a disconnected tree in _sysio_pb_path. If so, it returns an empty string. This *might* be good enough for your driver. If not, you'll need a change for this as well -- In fact, you should go ahead and change it anyway. Instead of _sysio_pb_path, use _sysio_pb_pathof. This new function takes the base pnode and a pointer to a string. It returns an integer. The usual zero on success or a negated errno on failure. Note3: Sockets support is horribly broken and won't build. As far as I know, this was never used. Unless somebody tells me differently, sockets support will be deprecated in the next release. Otherwise, let me know and I'll fix it. Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- file.h 12 Apr 2007 18:00:42 -0000 1.17 +++ file.h 30 Apr 2007 16:52:20 -0000 1.18 @@ -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); \ @@ -129,7 +129,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.28 diff -u -w -b -B -p -r1.27 -r1.28 --- inode.h 3 May 2006 22:34:46 -0000 1.27 +++ inode.h 30 Apr 2007 16:52:20 -0000 1.28 @@ -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 @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ @@ -279,6 +279,78 @@ struct pnode { } while (0) /* + * Path node meta-call. + */ +#define INOP_CALL(_f, ...) \ + ((*_f)(__VA_ARGS__)) +#define _INOP_FUNC(_ino, _fbase) \ + ((_ino)->i_ops.inop_##_fbase) +#define PNOP_FUNC(_pno, _fbase) \ + _INOP_FUNC((_pno)->p_base->pb_ino, _fbase) +#define _PNOP_CALL(_pno, _fbase, ...) \ + INOP_CALL(PNOP_FUNC((_pno), _fbase), __VA_ARGS__) +#define _PNOP_MKCALL(_pno, _fbase, ...) \ + ((_pno)->p_base->pb_ino \ + ? _PNOP_CALL((_pno), _fbase, __VA_ARGS__) \ + : _PNOP_CALL((_pno)->p_mount->mnt_root, _fbase, __VA_ARGS__)) + +/* + * Operations + */ +#define PNOP_LOOKUP(_pno, _inop, _intnt, _path) \ + _PNOP_MKCALL((_pno), lookup, (_pno), (_inop), (_intnt), (_path)) +#define PNOP_GETATTR(_pno, _stbuf) \ + _PNOP_CALL((_pno), getattr, (_pno), (_pno)->p_base->pb_ino, (_stbuf)) +#define PNOP_SETATTR(_pno, _mask, _stbuf) \ + _PNOP_CALL((_pno), setattr, \ + (_pno), (_pno)->p_base->pb_ino, (_mask), (_stbuf)) +#define PNOP_FILLDIRENTRIES(_pno, _posp, _buf, _nbytes) \ + _PNOP_CALL((_pno), filldirentries, \ + (_pno)->p_base->pb_ino, (_posp), (_buf), (_nbytes)) +#define PNOP_MKDIR(_pno, _mode) \ + _PNOP_MKCALL((_pno), mkdir, (_pno), (_mode)) +#define PNOP_RMDIR(_pno) \ + _PNOP_MKCALL((_pno), rmdir, (_pno)) +#define PNOP_SYMLINK(_pno, _data) \ + _PNOP_MKCALL((_pno), symlink, (_pno), (_data)) +#define PNOP_READLINK(_pno, _buf, _bufsiz) \ + _PNOP_CALL((_pno), readlink, (_pno), (_buf), (_bufsiz)) +#define PNOP_OPEN(_pno, _flags, _mode) \ + _PNOP_MKCALL((_pno), open, (_pno), (_flags), (_mode)) +#define PNOP_CLOSE(_pno) \ + _PNOP_CALL((_pno), close, (_pno)->p_base->pb_ino) +#define PNOP_LINK(_old, _new) \ + _PNOP_CALL((_old), link, (_old), (_new)) +#define PNOP_UNLINK(_pno) \ + _PNOP_CALL((_pno), unlink, (_pno)) +#define PNOP_RENAME(_old, _new) \ + _PNOP_CALL((_old), rename, (_old), (_new)) +#define PNOP_READ(_pno, _ioctx) \ + _PNOP_CALL((_pno), read, (_pno)->p_base->pb_ino, (_ioctx)) +#define PNOP_WRITE(_pno, _ioctx) \ + _PNOP_CALL((_pno), write, (_pno)->p_base->pb_ino, (_ioctx)) +#define PNOP_POS(_pno, _off) \ + _PNOP_CALL((_pno), pos, (_pno)->p_base->pb_ino, (_off)) +#define PNOP_IODONE(_pno, _ioctx) \ + _PNOP_CALL((_pno), iodone, (_ioctx)) +#define PNOP_FCNTL(_pno, _cmd, _ap, _rtn) \ + _PNOP_CALL((_pno), fcntl, (_pno)->p_base->pb_ino, (_cmd), (_ap), (_rtn)) +#define PNOP_SYNC(_pno) \ + _PNOP_CALL((_pno), sync, (_pno)->p_base->pb_ino) +#define PNOP_DATASYNC(_pno) \ + _PNOP_CALL((_pno), datasync, (_pno)->p_base->pb_ino) +#define PNOP_IOCTL(_pno, _request, _ap) \ + _PNOP_CALL((_pno), ioctl, (_pno)->p_base->pb_ino, (_request), (_ap)) +#define PNOP_MKNOD(_pno, _mode, _dev) \ + _PNOP_MKCALL((_pno), mknod, (_pno), (_mode), (_dev)) +#ifdef _HAVE_STATVFS +#define PNOP_STATVFS(_pno, _buf) \ + _PNOP_CALL((_pno), statvfs, (_pno), (_pno)->p_base->pb_ino, (_buf)) +#endif +#define PNOP_GONE(_pno) \ + _PNOP_CALL((_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 +441,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 +456,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,27 +498,32 @@ 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 size_t _sysio_p_prune(struct pnode *root); extern int _sysio_p_kill_all(struct pnode *root); +extern int _sysio_pb_pathof(struct pnode_base *pb, + char separator, + char **pathp); extern char *_sysio_pb_path(struct pnode_base *pb, char separator); -extern int _sysio_setattr(struct pnode *pno, - struct inode *ino, +extern int _sysio_p_setattr(struct pnode *pno, unsigned mask, struct intnl_stat *stbuf); +extern int _sysio_p_unlink(struct pnode *pno); +extern int _sysio_p_rmdir(struct pnode *pno); +extern int _sysio_p_rename(struct pnode *old, struct pnode *new); extern void _sysio_do_noop(void); extern void _sysio_do_illop(void); extern int _sysio_do_ebadf(void); @@ -467,7 +546,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, @@ -482,5 +561,15 @@ extern int _sysio_ioctx_done(struct ioct extern ssize_t _sysio_ioctx_wait(struct ioctx *ioctx); extern void _sysio_ioctx_complete(struct ioctx *ioctx); extern int _sysio_open(struct pnode *pno, int flags, mode_t mode); +extern int _sysio_p_aread(struct pnode *pno, + _SYSIO_OFF_T off, + void *buf, + size_t count, + struct ioctx **ioctxp); +extern int _sysio_p_awrite(struct pnode *pno, + _SYSIO_OFF_T off, + void *buf, + size_t count, + struct ioctx **ioctxp); extern int _sysio_mkdir(struct pnode *where, mode_t mode); extern int _sysio_mknod(struct pnode *where, mode_t mode, dev_t dev); Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- sysio-cmn.h 14 Feb 2007 18:50:17 -0000 1.12 +++ sysio-cmn.h 30 Apr 2007 16:52:20 -0000 1.13 @@ -140,20 +140,74 @@ struct iovec; */ #define SYSIO_INTERFACE_DISPLAY_BLOCK \ int _saved_errno; -#define SYSIO_INTERFACE_ENTER \ +#define SYSIO_INTERFACE_ENTER(tag, ...) \ do { \ _saved_errno = errno; \ - SYSIO_ENTER; \ + SYSIO_ENTER(tag, __VA_ARGS__); \ } while (0) -#define SYSIO_INTERFACE_RETURN(rtn, err) \ +#define SYSIO_INTERFACE_RETURN(rtn, err, tag, ...) \ do { \ - SYSIO_LEAVE; \ + SYSIO_LEAVE(tag, (rtn), (err), __VA_ARGS__); \ errno = (err) ? -(err) : _saved_errno; \ return (rtn); \ } while(0) /* Interface enter/leave hook functions */ #if SYSIO_TRACING + +#define _SYSIO_TTAG(name) \ + PREPEND(_SYSIO_TRACING_, name) + +/* + * Supported tracing tags. + */ +typedef enum { + _SYSIO_TTAG(unsupported) = -1, + _SYSIO_TTAG(access), + _SYSIO_TTAG(chdir), + _SYSIO_TTAG(getcwd), + _SYSIO_TTAG(chmod), + _SYSIO_TTAG(fchmod), + _SYSIO_TTAG(chown), + _SYSIO_TTAG(fchown), + _SYSIO_TTAG(dup2), + _SYSIO_TTAG(dup), + _SYSIO_TTAG(vfcntl), + _SYSIO_TTAG(fsync), + _SYSIO_TTAG(fdatasync), + _SYSIO_TTAG(getdirentries64), + _SYSIO_TTAG(getdirentries), + _SYSIO_TTAG(ioctl), + _SYSIO_TTAG(iodone), + _SYSIO_TTAG(iowait), + _SYSIO_TTAG(link), + _SYSIO_TTAG(lseek64), + _SYSIO_TTAG(lseek), + _SYSIO_TTAG(llseek), + _SYSIO_TTAG(mkdir), + _SYSIO_TTAG(xmknod), + _SYSIO_TTAG(mount), + _SYSIO_TTAG(umount), + _SYSIO_TTAG(open), + _SYSIO_TTAG(close), + _SYSIO_TTAG(ireadx), + _SYSIO_TTAG(iwritex), + _SYSIO_TTAG(ireadv), + _SYSIO_TTAG(iwritev), + _SYSIO_TTAG(rename), + _SYSIO_TTAG(rmdir), + _SYSIO_TTAG(xstatnd), + _SYSIO_TTAG(fxstat), + _SYSIO_TTAG(opendir), + _SYSIO_TTAG(closedir), + _SYSIO_TTAG(symlink), + _SYSIO_TTAG(readlink), + _SYSIO_TTAG(truncate), + _SYSIO_TTAG(ftruncate), + _SYSIO_TTAG(unlink), + _SYSIO_TTAG(utime), +} tracing_tag; + extern void *_sysio_entry_trace_q; extern void *_sysio_exit_trace_q; @@ -161,30 +215,39 @@ extern void *_sysio_register_trace(void void (*)(const char *file, const char *func, int line, - void *data), + void *data, + tracing_tag tag, + va_list ap), void *data, void (*destructor)(void *data)); extern void _sysio_remove_trace(void *q, void *p); extern void _sysio_run_trace_q(void *q, const char *file, const char *func, - int line); -#define SYSIO_ENTER \ + int line, + tracing_tag tag, + ...); + +#define SYSIO_ENTER(tag, ...) \ do { \ _sysio_run_trace_q(_sysio_entry_trace_q, \ - __FILE__, __func__, __LINE__); \ + __FILE__, __func__, __LINE__, \ + _SYSIO_TTAG(tag), \ + __VA_ARGS__); \ } while (0) -#define SYSIO_LEAVE \ +#define SYSIO_LEAVE(tag, ...) \ do { \ _sysio_run_trace_q(_sysio_exit_trace_q, \ - __FILE__, __func__, __LINE__); \ + __FILE__, __func__, __LINE__, \ + _SYSIO_TTAG(tag), \ + __VA_ARGS__); \ } while (0) #else -#define SYSIO_ENTER \ +#define SYSIO_ENTER(tag, ...) \ do { } while (0) -#define SYSIO_LEAVE \ +#define SYSIO_LEAVE(tag, ...) \ do { } while (0) #endif |
From: Lee W. <lw...@us...> - 2007-04-30 16:52:27
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2000 Modified Files: configure.in Log Message: Merged "unification" branch. First, the changes alter the core to perform pnode-ops by pnode. However, it maintains the pre-existing interface in order to minimize driver changes. Second, more detailed tracing information is available now in the form of a tag, indicating which function the data is from, as well as arguments and return data. Note1: The S_IFDIR bit is no longer set when the pnode-op mkdir function is called. If you need that, set it in your driver. Note2: It is possible to encounter a disconnected tree in _sysio_pb_path. If so, it returns an empty string. This *might* be good enough for your driver. If not, you'll need a change for this as well -- In fact, you should go ahead and change it anyway. Instead of _sysio_pb_path, use _sysio_pb_pathof. This new function takes the base pnode and a pointer to a string. It returns an integer. The usual zero on success or a negated errno on failure. Note3: Sockets support is horribly broken and won't build. As far as I know, this was never used. Unless somebody tells me differently, sockets support will be deprecated in the next release. Otherwise, let me know and I'll fix it. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- configure.in 12 Apr 2007 21:22:43 -0000 1.29 +++ configure.in 30 Apr 2007 16:52:19 -0000 1.30 @@ -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-04-30 16:52:27
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2000/drivers/incore Modified Files: fs_incore.c Log Message: Merged "unification" branch. First, the changes alter the core to perform pnode-ops by pnode. However, it maintains the pre-existing interface in order to minimize driver changes. Second, more detailed tracing information is available now in the form of a tag, indicating which function the data is from, as well as arguments and return data. Note1: The S_IFDIR bit is no longer set when the pnode-op mkdir function is called. If you need that, set it in your driver. Note2: It is possible to encounter a disconnected tree in _sysio_pb_path. If so, it returns an empty string. This *might* be good enough for your driver. If not, you'll need a change for this as well -- In fact, you should go ahead and change it anyway. Instead of _sysio_pb_path, use _sysio_pb_pathof. This new function takes the base pnode and a pointer to a string. It returns an integer. The usual zero on success or a negated errno on failure. Note3: Sockets support is horribly broken and won't build. As far as I know, this was never used. Unless somebody tells me differently, sockets support will be deprecated in the next release. Otherwise, let me know and I'll fix it. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -b -B -p -r1.28 -r1.29 --- fs_incore.c 12 Apr 2007 19:15:37 -0000 1.28 +++ fs_incore.c 30 Apr 2007 16:52:19 -0000 1.29 @@ -212,11 +212,10 @@ static struct inode_ops _sysio_incore_di _sysio_incore_inop_gone }; -#define _sysio_incore_filop_lookup \ - (int (*)(struct pnode *, \ - struct inode **, \ - struct intent *, \ - const char *))_sysio_do_illop +static int _sysio_incore_filop_lookup(struct pnode *pno, + struct inode **inop, + struct intent *intnt, + const char *path); #define _sysio_incore_filop_filldirentries \ (ssize_t (*)(struct inode *, \ _SYSIO_OFF_T *, \ @@ -888,6 +887,26 @@ out: } static int +_sysio_incore_filop_lookup(struct pnode *pno __IS_UNUSED, + struct inode **inop, + struct intent *intnt __IS_UNUSED, + const char *path __IS_UNUSED) +{ + struct incore_inode *icino; + + /* + * We revalidate only. + */ + if (!*inop) + return -ENOTDIR; + + icino = I2IC(*inop); + assert(icino); + (*inop)->i_stbuf = icino->ici_st; + return 0; +} + +static int _sysio_incore_inop_getattr(struct pnode *pno, struct inode *ino, struct intnl_stat *stbuf) |
From: Lee W. <lw...@us...> - 2007-04-30 16:52:27
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2000/src Modified Files: access.c chdir.c chmod.c chown.c dup.c fcntl.c file.c file_hack.c fsync.c getdirentries.c init.c inode.c ioctl.c ioctx.c iowait.c link.c lseek.c mkdir.c mknod.c module.mk mount.c namei.c open.c readdir.c readlink.c rename.c rmdir.c rw.c stat.c statvfs.c statvfs64.c stddir.c symlink.c truncate.c unlink.c utime.c Removed Files: stat64.c Log Message: Merged "unification" branch. First, the changes alter the core to perform pnode-ops by pnode. However, it maintains the pre-existing interface in order to minimize driver changes. Second, more detailed tracing information is available now in the form of a tag, indicating which function the data is from, as well as arguments and return data. Note1: The S_IFDIR bit is no longer set when the pnode-op mkdir function is called. If you need that, set it in your driver. Note2: It is possible to encounter a disconnected tree in _sysio_pb_path. If so, it returns an empty string. This *might* be good enough for your driver. If not, you'll need a change for this as well -- In fact, you should go ahead and change it anyway. Instead of _sysio_pb_path, use _sysio_pb_pathof. This new function takes the base pnode and a pointer to a string. It returns an integer. The usual zero on success or a negated errno on failure. Note3: Sockets support is horribly broken and won't build. As far as I know, this was never used. Unless somebody tells me differently, sockets support will be deprecated in the next release. Otherwise, let me know and I'll fix it. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- access.c 23 Mar 2007 19:05:50 -0000 1.14 +++ access.c 30 Apr 2007 16:52:20 -0000 1.15 @@ -76,6 +76,8 @@ _sysio_check_permission(struct pnode *pn int ngids; int group_matched; + assert(pno); + /* * Check amode. */ @@ -256,12 +258,12 @@ SYSIO_INTERFACE_NAME(access)(const char SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(access, path, amode); INTENT_INIT(&intent, INT_GETATTR, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); if (err) - SYSIO_INTERFACE_RETURN(-1, err); + SYSIO_INTERFACE_RETURN(-1, err, access, 0); err = _sysio_ldcreds(geteuid(), getegid(), &cr); if (err < 0) goto out; @@ -269,7 +271,7 @@ SYSIO_INTERFACE_NAME(access)(const char _sysio_check_permission(pno, &cr, amode); out: P_RELE(pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, access, 0); } #ifdef REDSTORM Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -w -b -B -p -r1.27 -r1.28 --- chdir.c 26 Mar 2007 18:35:50 -0000 1.27 +++ chdir.c 30 Apr 2007 16:52:20 -0000 1.28 @@ -126,15 +126,15 @@ SYSIO_INTERFACE_NAME(chdir)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(chdir, path); err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) - SYSIO_INTERFACE_RETURN(-1, err); + SYSIO_INTERFACE_RETURN(-1, err, chdir, 0); err = _sysio_p_chdir(pno); if (err) P_RELE(pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chdir, 0); } #ifdef REDSTORM @@ -175,7 +175,8 @@ _sysio_p_path(struct pnode *pno, char ** * the *covered* nodes name, not this one unless we are at * the root of the name-space. */ - while (pno == pno->p_mount->mnt_root && pno != pno->p_parent ) + while (pno == pno->p_mount->mnt_root && + pno != pno->p_parent) pno = pno->p_mount->mnt_covers; /* @@ -189,7 +190,9 @@ _sysio_p_path(struct pnode *pno, char ** n++; assert(n); pno = pno->p_parent; - } while (pno != pno->p_parent); + } while (pno && pno != pno->p_parent); + if (!pno) + return -ENOENT; if (!*buf) size = len + n + 1; @@ -216,7 +219,8 @@ _sysio_p_path(struct pnode *pno, char ** * the *covered* nodes name, not this one unless we are at * the root of the name-space. */ - while (pno == pno->p_mount->mnt_root && pno != pno->p_parent ) + while (pno == pno->p_mount->mnt_root && + pno != pno->p_parent ) pno = pno->p_mount->mnt_covers; /* @@ -239,7 +243,7 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(getcwd, buf, size); #if DEFER_INIT_CWD if (!_sysio_cwd) { struct pnode *pno; @@ -254,7 +258,7 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, } #endif err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0); - SYSIO_INTERFACE_RETURN(err ? NULL : buf, err); + SYSIO_INTERFACE_RETURN(err ? NULL : buf, err, getcwd, buf, size); } #ifdef __GLIBC__ Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- chmod.c 27 Jul 2004 15:00:43 -0000 1.14 +++ chmod.c 30 Apr 2007 16:52:20 -0000 1.15 @@ -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 @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ @@ -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_p_setattr(pno, mask, &stbuf); return err; } @@ -75,14 +75,14 @@ SYSIO_INTERFACE_NAME(chmod)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(chmod, path, mode); 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); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chmod, 0); } #ifdef REDSTORM @@ -98,7 +98,7 @@ SYSIO_INTERFACE_NAME(fchmod)(int fd, mod struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(fchmod, fd, mode); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -106,9 +106,9 @@ 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); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fchmod, 0); } #ifdef REDSTORM Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- chown.c 27 Jul 2004 15:00:43 -0000 1.13 +++ chown.c 30 Apr 2007 16:52:20 -0000 1.14 @@ -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 @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ @@ -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_p_setattr(pno, mask, &stbuf); return err; } @@ -82,15 +82,15 @@ SYSIO_INTERFACE_NAME(chown)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(chown, path, owner, group); err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); 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); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chown, 0); } #ifdef REDSTORM @@ -106,7 +106,7 @@ SYSIO_INTERFACE_NAME(fchown)(int fd, uid struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(fchown, fd, owner, group); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -114,9 +114,9 @@ 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); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fchown, 0); } #ifdef REDSTORM Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- dup.c 16 Jun 2005 21:01:14 -0000 1.12 +++ dup.c 30 Apr 2007 16:52:20 -0000 1.13 @@ -56,11 +56,11 @@ SYSIO_INTERFACE_NAME(dup2)(int oldfd, in int fd; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(dup2, oldfd, newfd); if (newfd < 0) - SYSIO_INTERFACE_RETURN(-1, -EBADF); + SYSIO_INTERFACE_RETURN(-1, -EBADF, dup2, 0); fd = _sysio_fd_dup(oldfd, newfd, 1); - SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0); + SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0, dup2, 0); } #ifdef REDSTORM @@ -75,9 +75,9 @@ SYSIO_INTERFACE_NAME(dup)(int oldfd) int fd; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(dup, oldfd); fd = _sysio_fd_dup(oldfd, -1, 0); - SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0); + SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0, dup, 0); } #ifdef __GLIBC__ Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -w -b -B -p -r1.26 -r1.27 --- fcntl.c 28 Mar 2007 20:50:41 -0000 1.26 +++ fcntl.c 30 Apr 2007 16:52:20 -0000 1.27 @@ -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 @@ -74,13 +74,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; } @@ -126,7 +126,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; /* @@ -142,7 +142,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(); @@ -161,7 +161,7 @@ _sysio_vfcntl(int fd, int cmd, va_list a struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(vfcntl, fd, cmd); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -209,9 +209,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; @@ -265,12 +263,12 @@ _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; } out: - SYSIO_INTERFACE_RETURN(rtn, err); + SYSIO_INTERFACE_RETURN(rtn, err, vfcntl, 0); } int Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- file.c 3 Jan 2006 13:26:33 -0000 1.20 +++ file.c 30 Apr 2007 16:52:20 -0000 1.21 @@ -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.11 diff -u -w -b -B -p -r1.10 -r1.11 --- file_hack.c 4 Jan 2006 13:16:18 -0000 1.10 +++ file_hack.c 30 Apr 2007 16:52:20 -0000 1.11 @@ -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.9 diff -u -w -b -B -p -r1.8 -r1.9 --- fsync.c 21 Sep 2004 16:18:30 -0000 1.8 +++ fsync.c 30 Apr 2007 16:52:20 -0000 1.9 @@ -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 @@ -58,12 +58,12 @@ SYSIO_INTERFACE_NAME(fsync)(int fd) int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(fsync, fd); fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - SYSIO_INTERFACE_RETURN(-1, -EBADF); - err = (*fil->f_ino->i_ops.inop_sync)(fil->f_ino); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + if (!(fil && fil->f_pno)) + SYSIO_INTERFACE_RETURN(-1, -EBADF, fsync, 0); + err = PNOP_SYNC(fil->f_pno); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fsync, 0); } int @@ -73,10 +73,10 @@ SYSIO_INTERFACE_NAME(fdatasync)(int fd) int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(fdatasync, fd); fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - SYSIO_INTERFACE_RETURN(-1, -EBADF); - err = (*fil->f_ino->i_ops.inop_datasync)(fil->f_ino); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + if (!(fil && fil->f_pno)) + SYSIO_INTERFACE_RETURN(-1, -EBADF, fdatasync, 0); + err = PNOP_DATASYNC(fil->f_pno); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fdatasync, 0); } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- getdirentries.c 14 Mar 2007 20:16:31 -0000 1.22 +++ getdirentries.c 30 Apr 2007 16:52:20 -0000 1.23 @@ -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 @@ -70,14 +70,14 @@ filldirents(struct file *fil, _SYSIO_OFF_T opos; ssize_t cc; - if (!S_ISDIR(fil->f_ino->i_stbuf.st_mode)) + if (!(fil && 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; @@ -95,15 +95,13 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdiren ssize_t cc; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(getdirentries64, fd, buf, nbytes, basep); fil = _sysio_fd_find(fd); - 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); + SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, + cc < 0 ? (int )cc : 0, + getdirentries64, buf, basep); } #if _LARGEFILE64_SOURCE @@ -166,13 +164,9 @@ SYSIO_INTERFACE_NAME(getdirentries)(int char *cp; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(getdirentries, fd, buf, nbytes, basep); fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) { - SYSIO_INTERFACE_RETURN(-1, -EBADF); - } - count = cc = filldirents(fil, buf, nbytes, &b); d64p = (void *)buf; dp = (void *)buf; @@ -230,10 +224,10 @@ SYSIO_INTERFACE_NAME(getdirentries)(int } if (cc < 0) - SYSIO_INTERFACE_RETURN(-1, cc); + SYSIO_INTERFACE_RETURN(-1, cc, getdirentries, buf, basep); cc = (char *)dp - buf; *basep = b; - SYSIO_INTERFACE_RETURN(cc, 0); + SYSIO_INTERFACE_RETURN(cc, 0, getdirentries, buf, basep); } #else /* !defined(DIRENT64_IS_NATURAL) */ sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64), Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -w -b -B -p -r1.31 -r1.32 --- init.c 12 Apr 2007 20:05:52 -0000 1.31 +++ init.c 30 Apr 2007 16:52:20 -0000 1.32 @@ -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 @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ @@ -91,7 +91,9 @@ struct trace_callback { void (*f)(const char *file, /* callback function */ const char *func, int line, - void *data); + void *data, + int tag, + va_list ap); void *data; /* callback data */ void (*destructor)(void *data); /* data destructor */ }; @@ -323,7 +325,9 @@ _sysio_register_trace(void *q, void (*f)(const char *file, const char *func, int line, - void *data), + void *data, + int tag, + va_list ap), void *data, void (*destructor)(void *data)) { @@ -360,35 +364,46 @@ void _sysio_run_trace_q(void *q, const char *file, const char *func, - int line) + int line, + int tag, + ...) { + va_list ap, aq; struct trace_callback *tcb; + va_start(ap, tag); tcb = ((struct trace_q *)q)->tqh_first; while (tcb) { - (*tcb->f)(file, func, line, tcb->data); + va_copy(aq, ap); + (*tcb->f)(file, func, line, tcb->data, tag, ap); + va_end(aq); tcb = tcb->links.tqe_next; } + va_end(ap); } static void _sysio_trace_entry(const char *file __IS_UNUSED, const char *func, int line __IS_UNUSED, - void *data __IS_UNUSED) + void *data __IS_UNUSED, + tracing_tag tag, + va_list ap __IS_UNUSED) { - _sysio_cprintf("+ENTER+ %s\n", func); + _sysio_cprintf("+ENTER+ %s (%d)\n", func, tag); } static void _sysio_trace_exit(const char *file __IS_UNUSED, const char *func, int line __IS_UNUSED, - void *data __IS_UNUSED) + void *data __IS_UNUSED, + tracing_tag tag, + va_list ap __IS_UNUSED) { - _sysio_cprintf("+EXIT+ %s\n", func); + _sysio_cprintf("+EXIT+ %s (%d)\n", func, tag); } #endif /* defined(SYSIO_TRACING) */ @@ -549,7 +564,6 @@ do_creat(char *args) CREATE_FILE = 4 } op; int intent_mode; - struct inode *ino; int i; len = strlen(args); @@ -641,41 +655,31 @@ 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; - struct ioctx io_context; + size_t count; + struct ioctx *ioctx; /* * Deposit optional file content. */ - iovec.iov_base = v[6].ovi_value; - iovec.iov_len = strlen(v[6].ovi_value); - xtvec.xtv_off = 0; - xtvec.xtv_len = iovec.iov_len; - IOCTX_INIT(&io_context, - 1, - 1, - ino, - &iovec, 1, - &xtvec, 1); - _sysio_ioctx_enter(&io_context); + count = strlen(v[6].ovi_value); err = - (*ino->i_ops.inop_write)(pno->p_base->pb_ino, - &io_context); + _sysio_p_awrite(pno, + 0, + v[6].ovi_value, + count, + &ioctx); if (!err) { ssize_t cc; - cc = _sysio_ioctx_wait(&io_context); + cc = _sysio_ioctx_wait(ioctx); if (cc < 0) err = cc; - else if ((size_t )cc != iovec.iov_len) + else if ((size_t )cc != count) err = -EIO; /* huh? */ - } else - _sysio_ioctx_complete(&io_context); } - i = (*ino->i_ops.inop_close)(ino); + } + i = PNOP_CLOSE(pno); if (!err) err = i; break; @@ -823,7 +827,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_p_setattr(pno, SETATTR_MODE, &stbuf); P_RELE(pno); return err; @@ -875,7 +879,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.26 diff -u -w -b -B -p -r1.25 -r1.26 --- inode.c 1 Jun 2006 21:28:57 -0000 1.25 +++ inode.c 30 Apr 2007 16:52:20 -0000 1.26 @@ -344,19 +344,13 @@ p_reclaim() t = max_names / 2; do { pno = next; - if (pno->p_ref) { - next = pno->p_nodes.tqe_next; - continue; - } - pno->p_ref++; - assert(pno->p_ref); - (void )_sysio_p_prune(pno); next = pno->p_nodes.tqe_next; - assert(pno->p_ref); - pno->p_ref--; if (pno->p_ref) continue; + next->p_ref++; + assert(next->p_ref); (void )_sysio_p_prune(pno); + next->p_ref--; } while (n_names > t && next); if (n_names > t) @@ -396,7 +390,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 +429,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); } @@ -459,6 +447,30 @@ _sysio_pb_gone(struct pnode_base *pb) } /* + * Clean up the namespace graph after an unlink. + */ +static void +_sysio_pb_disconnect(struct pnode_base *pb) +{ + struct pnode *pno; + + /* + * Disconnect all aliases associated with the referenced base node. + */ + pno = pb->pb_aliases.lh_first; + do { + pno->p_parent = NULL; + } while ((pno = pno->p_links.le_next)); + /* + * Remove name from the names cache so that it can't + * be found anymore. + */ + if (pb->pb_name.len) + LIST_REMOVE(pb, pb_names); + pb->pb_name.len = 0; +} + +/* * Generate more path (alias) nodes for the fast allocator. */ static void @@ -516,8 +528,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(); @@ -546,18 +556,12 @@ _sysio_p_new_alias(struct pnode *parent, void _sysio_p_gone(struct pnode *pno) { - struct pnode_base *pb; - assert(!pno->p_ref); assert(!pno->p_cover); TAILQ_REMOVE(&_sysio_pnodes, pno, p_nodes); LIST_REMOVE(pno, p_links); - pb = pno->p_base; - if (!(pb->pb_aliases.lh_first || pb->pb_children.lh_first)) - _sysio_pb_gone(pb); - LIST_INSERT_HEAD(&free_pnodes, pno, p_links); } @@ -568,36 +572,35 @@ int _sysio_p_validate(struct pnode *pno, struct intent *intnt, const char *path) { struct inode *ino; - struct pnode_base *rootpb; int err; + if (!(pno && pno->p_parent)) + return -ENOENT; + 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); } + } else if (pno->p_base->pb_ino) + _sysio_pb_disconnect(pno->p_base); return err; } /* * Find (or create!) an alias for the given parent and name. A misnomer, - * really -- This is a "get". Returned path node is referenced. + * really -- This is a "lookup". Returned path node is referenced. */ int _sysio_p_find_alias(struct pnode *parent, @@ -608,9 +611,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 +632,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 +656,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) @@ -675,8 +667,9 @@ _sysio_p_find_alias(struct pnode *parent return err; } +#if 0 /* - * 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) @@ -698,6 +691,7 @@ _sysio_prune(struct pnode_base *rpb) return; _sysio_pb_gone(rpb); } +#endif /* * Prune idle nodes from the passed sub-tree, including the root. @@ -717,10 +711,12 @@ _sysio_p_prune(struct pnode *root) while ((pb = nxtpb)) { nxtpb = pb->pb_sibs.le_next; nxtpno = pb->pb_aliases.lh_first; +#if 0 if (!nxtpno) { _sysio_prune(pb); continue; } +#endif while ((pno = nxtpno)) { nxtpno = pno->p_links.le_next; if (pno->p_mount != root->p_mount) { @@ -744,8 +740,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. */ @@ -767,6 +761,9 @@ _sysio_p_prune(struct pnode *root) #endif } _sysio_p_gone(pno); + if (!(pb->pb_aliases.lh_first || + pb->pb_children.lh_first)) + _sysio_pb_gone(pb); } } @@ -774,7 +771,9 @@ _sysio_p_prune(struct pnode *root) /* * Can't get the root or we disconnect the sub-trees. */ - return count + (root->p_ref ? 1 : 0); + if (root->p_ref) + count++; + return count; } /* @@ -788,7 +787,7 @@ _sysio_p_prune(struct pnode *root) #else /* * This is an automount-point. Must - * unmount before relcaim. + * unmount before reclaim. */ P_REF(root); if (_sysio_do_unmount(root->p_mount) != 0) { @@ -796,8 +795,13 @@ _sysio_p_prune(struct pnode *root) count++; } #endif - } else + } else { + pb = root->p_base; _sysio_p_gone(root); + if (!(pb->pb_aliases.lh_first || + pb->pb_children.lh_first)) + _sysio_pb_gone(pb); + } return count; } @@ -809,12 +813,12 @@ _sysio_p_prune(struct pnode *root) * path (alias) nodes track path relative to our name space -- They cross * mount points. */ -char * -_sysio_pb_path(struct pnode_base *pb, const char separator) +int +_sysio_pb_pathof(struct pnode_base *pb, const char separator, char **pathp) { - char *buf; size_t len, n; struct pnode_base *tmp; + char *buf; char *cp; /* @@ -830,6 +834,8 @@ _sysio_pb_path(struct pnode_base *pb, co len++; tmp = tmp->pb_parent; } while (tmp); + if (tmp && !tmp->pb_name.len) + return -ENOENT; if (!len) len++; /* @@ -837,7 +843,7 @@ _sysio_pb_path(struct pnode_base *pb, co */ buf = malloc(len + 1); if (!buf) - return NULL; + return -ENOMEM; /* * Fill in the path buffer -- Backwards, since we're starting * from the end. @@ -857,27 +863,41 @@ _sysio_pb_path(struct pnode_base *pb, co tmp = tmp->pb_parent; } while (tmp); - return buf; + *pathp = buf; + return 0; +} + +/* + * Return path tracked by the base path node ancestor chain. + * + * NB: Deprecated. + */ +char * +_sysio_pb_path(struct pnode_base *pb, const char separator) +{ + int err; + char *path; + + err = _sysio_pb_pathof(pb, separator, &path); + if (err) { + if (err == -ENOMEM) + return NULL; + path = malloc(1); + if (path == NULL) + return NULL; + *path = '\0'; + } + return path; } /* * Common set attributes routine. */ int -_sysio_setattr(struct pnode *pno, - struct inode *ino, +_sysio_p_setattr(struct pnode *pno, 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 +906,132 @@ _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); +} + +/* + * Perform unlink operation on some pnode. + */ +int +_sysio_p_unlink(struct pnode *pno) +{ + int err; + + if (!pno->p_base->pb_ino) + return -ENOENT; /* huh? */ + if (S_ISDIR(pno->p_base->pb_ino->i_stbuf.st_mode)) + return -EISDIR; + /* + * Call the FS implementation. + */ + err = PNOP_UNLINK(pno); + if (err) + return err; + /* + * Clean the namespace graphs to reflect the unlink. + */ + _sysio_pb_disconnect(pno->p_base); + return 0; +} + +/* + * Perform unlink operation on some pnode. + */ +int +_sysio_p_rmdir(struct pnode *pno) +{ + int err; + + if (!pno->p_base->pb_ino) + return -ENOENT; /* huh? */ + if (!S_ISDIR(pno->p_base->pb_ino->i_stbuf.st_mode)) + return -ENOTDIR; + /* + * Don't allow unlink of a root or a mount point. + */ + if (pno->p_cover || pno->p_mount->mnt_root == pno) + return -EBUSY; + /* + * Call the FS implementation. + */ + err = PNOP_RMDIR(pno); + if (err) + return err; + /* + * Clean the namespace graphs to reflect the unlink. + */ + _sysio_pb_disconnect(pno->p_base); + return 0; +} + +int +_sysio_p_rename(struct pnode *old, struct pnode *new) +{ + struct pnode_base *nxtpb, *pb; + int err; + + /* + * Check for rename to self. + */ + if (old == new) + return 0; + + /* + * No xdev renames please. + */ + if (old->p_mount->mnt_fs != new->p_mount->mnt_fs) + return -EXDEV; + + /* + * Don't allow mount points to move. + */ + if (old->p_mount->mnt_root == old || + old->p_cover || + new->p_mount->mnt_root == new) + return -EBUSY; + + /* + * Make sure the old pnode can't be found in the ancestor chain + * for the new. If it can, they are trying to move into a subdirectory + * of the old. + */ + nxtpb = new->p_base; + do { + pb = nxtpb; + nxtpb = pb->pb_parent; + if (pb == old->p_base) + return -EINVAL; + } while (nxtpb); + + if (new->p_base->pb_ino) { + /* + * Existing entry. We're replacing the new. Make sure that's + * ok. + */ + if (S_ISDIR(new->p_base->pb_ino->i_stbuf.st_mode)) { + if (!S_ISDIR(old->p_base->pb_ino->i_stbuf.st_mode)) + return -EISDIR; + } else if (S_ISDIR(old->p_base->pb_ino->i_stbuf.st_mode)) + return -ENOTDIR; + } + + /* + * Give the op a try. + */ + err = PNOP_RENAME(old, new); + if (err) + return err; + /* + * Disconnect the old. + */ + _sysio_pb_disconnect(old->p_base); + /* + * Disconnect the new if positive. We want new lookups + * to find the just renamed entity. + */ + if (new->p_base->pb_ino) + _sysio_pb_disconnect(new->p_base); + return 0; } /* Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- ioctl.c 21 Sep 2004 16:18:31 -0000 1.12 +++ ioctl.c 30 Apr 2007 16:52:20 -0000 1.13 @@ -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 @@ -61,7 +61,7 @@ SYSIO_INTERFACE_NAME(ioctl)(int fd, unsi va_list ap; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(ioctl, fd, request); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -70,11 +70,11 @@ 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: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, ioctl, request); } Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- ioctx.c 16 Jun 2005 21:21:42 -0000 1.24 +++ ioctx.c 30 Apr 2007 16:52:20 -0000 1.25 @@ -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: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- iowait.c 25 Feb 2005 00:01:06 -0000 1.11 +++ iowait.c 30 Apr 2007 16:52:20 -0000 1.12 @@ -63,13 +63,13 @@ SYSIO_INTERFACE_NAME(iodone)(void *ioid) int rc; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(iodone, ioid); ioctx = _sysio_ioctx_find(ioid); if (!ioctx) - SYSIO_INTERFACE_RETURN(-1, -EINVAL); + SYSIO_INTERFACE_RETURN(-1, -EINVAL, iodone, 0); rc = _sysio_ioctx_done(ioctx); - SYSIO_INTERFACE_RETURN(rc < 0 ? -1 : rc, rc < 0 ? rc : 0); + SYSIO_INTERFACE_RETURN(rc < 0 ? -1 : rc, rc < 0 ? rc : 0, iodone, 0); } /* @@ -85,11 +85,12 @@ SYSIO_INTERFACE_NAME(iowait)(void *ioid) ssize_t cc; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(iowait, ioid); ioctx = _sysio_ioctx_find(ioid); if (!ioctx) - SYSIO_INTERFACE_RETURN(-1, -EINVAL); + SYSIO_INTERFACE_RETURN(-1, -EINVAL, iowait, 0); cc = _sysio_ioctx_wait(ioctx); - SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); + SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0, + iowait, 0); } Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- link.c 25 Jan 2005 18:56:14 -0000 1.12 +++ link.c 30 Apr 2007 16:52:20 -0000 1.13 @@ -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 @@ -62,7 +62,7 @@ SYSIO_INTERFACE_NAME(link)(const char *o struct pnode *old, *new; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(link, oldpath, newpath); INTENT_INIT(&intent, 0, NULL, NULL); err = _sysio_namei(_sysio_cwd, oldpath, 0, &intent, &old); if (err) @@ -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; /* @@ -104,7 +104,7 @@ error2: error1: P_RELE(old); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, link, 0); } #ifdef REDSTORM Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -w -b -B -p -r1.27 -r1.28 --- lseek.c 28 Oct 2005 17:59:31 -0000 1.27 +++ lseek.c 30 Apr 2007 16:52:20 -0000 1.28 @@ -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; @@ -131,13 +128,14 @@ SYSIO_INTERFACE_NAME(lseek64)(int fd, of off64_t off; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(lseek64, fd, offset, whence); fil = _sysio_fd_find(fd); if (!fil) - SYSIO_INTERFACE_RETURN((off64_t )-1, -EBADF); + SYSIO_INTERFACE_RETURN((off64_t )-1, -EBADF, lseek64, 0); off = _sysio_lseek(fil, offset, whence, _SEEK_MAX(fil)); SYSIO_INTERFACE_RETURN(off < 0 ? (off64_t )-1 : off, - off < 0 ? (int )off : 0); + off < 0 ? (int )off : 0, + lseek64, 0); } #ifdef __GLIBC__ @@ -162,16 +160,16 @@ SYSIO_INTERFACE_NAME(lseek)(int fd, off_ off_t rtn; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(lseek, fd, offset, whence); fil = _sysio_fd_find(fd); if (!fil) - SYSIO_INTERFACE_RETURN((off_t )-1, -EBADF); + SYSIO_INTERFACE_RETURN((off_t )-1, -EBADF, lseek, 0); off = _sysio_lseek(fil, offset, whence, LONG_MAX); if (off < 0) - SYSIO_INTERFACE_RETURN((off_t )-1, (int )off); + SYSIO_INTERFACE_RETURN((off_t )-1, (int )off, lseek, 0); rtn = (off_t )off; assert(rtn == off); - SYSIO_INTERFACE_RETURN(rtn, 0); + SYSIO_INTERFACE_RETURN(rtn, 0, lseek, 0); } #ifdef __GLIBC__ @@ -196,17 +194,21 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in /* * This is just plain goofy. */ - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(llseek, + fd, + offset_high, offset_low, + result, + whence); fil = _sysio_fd_find(fd); if (!fil) - SYSIO_INTERFACE_RETURN(-1, -EBADF); + SYSIO_INTERFACE_RETURN(-1, -EBADF, llseek, NULL); #if !_LARGEFILE64_SOURCE if (offset_high) { /* * We are using 32-bit internals. This just isn't * going to work. */ - SYSIO_INTERFACE_RETURN(-1, -EOVERFLOW); + SYSIO_INTERFACE_RETURN(-1, -EOVERFLOW, llseek, NULL); } #else off = offset_high; @@ -215,9 +217,9 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in #endif off = _sysio_lseek(fil, off, whence, _SEEK_MAX(fil)); if (off < 0) - SYSIO_INTERFACE_RETURN((off_t )-1, (int )off); + SYSIO_INTERFACE_RETURN((off_t )-1, (int )off, llseek, NULL); *result = off; - SYSIO_INTERFACE_RETURN(0, 0); + SYSIO_INTERFACE_RETURN(0, 0, llseek, result); } #undef __llseek Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- mkdir.c 28 Mar 2007 21:27:54 -0000 1.20 +++ mkdir.c 30 Apr 2007 16:52:20 -0000 1.21 @@ -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; @@ -67,9 +66,8 @@ _sysio_mkdir(struct pnode *pno, mode_t m if (err) return err; - parenti = pno->p_parent->p_base->pb_ino; - assert(parenti); - return (*parenti->i_ops.inop_mkdir)(pno, mode); + mode |= S_IFDIR; + return PNOP_MKDIR(pno, mode); } int @@ -80,7 +78,7 @@ SYSIO_INTERFACE_NAME(mkdir)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(mkdir, path, mode); INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); if (err) @@ -90,7 +88,7 @@ SYSIO_INTERFACE_NAME(mkdir)(const char * err = _sysio_mkdir(pno, mode); P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, mkdir, 0); } #ifdef REDSTORM Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- mknod.c 12 Apr 2007 20:07:02 -0000 1.19 +++ mknod.c 30 Apr 2007 16:52:20 -0000 1.20 @@ -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 @@ -77,9 +77,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 @@ -93,7 +91,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod) struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(xmknod, __ver, path, mode, dev); if (__ver != _MKNOD_VER) { err = -ENOSYS; goto out; @@ -113,7 +111,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod) error: P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, xmknod, 0); } #ifdef REDSTORM Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- module.mk 25 Oct 2004 14:29:16 -0000 1.10 +++ module.mk 30 Apr 2007 16:52:20 -0000 1.11 @@ -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.22 diff -u -w -b -B -p -r1.21 -r1.22 --- mount.c 25 Jan 2005 00:37:14 -0000 1.21 +++ mount.c 30 Apr 2007 16:52:20 -0000 1.22 @@ -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 @@ -166,13 +166,8 @@ _sysio_do_mount(struct filesys *fs, goto error; } /* - * It may have been a while since the root inode was validated; - * better validate again. And it better be a directory! + * It better be a directory! */ - err = _sysio_p_validate(mnt->mnt_root, NULL, NULL); - if (err) - goto error; - if (!S_ISDIR(mnt->mnt_root->p_base->pb_ino->i_stbuf.st_mode)) { err = -ENOTDIR; goto error; @@ -198,7 +193,7 @@ _sysio_do_mount(struct filesys *fs, error: if (mnt->mnt_root) { P_RELE(mnt->mnt_root); - _sysio_p_prune(mnt->mnt_root); + _sysio_p_gone(mnt->mnt_root); } free(mnt); return err; @@ -211,6 +206,7 @@ int _sysio_do_unmount(struct mount *mnt) { struct pnode *root; + struct pnode_base *rootpb; struct filesys *fs; root = mnt->mnt_root; @@ -241,7 +237,10 @@ _sysio_do_unmount(struct mount *mnt) */ P_RELE(root); root->p_cover = NULL; + rootpb = root->p_base; _sysio_p_gone(root); + if (!(rootpb->pb_aliases.lh_first || rootpb->pb_children.lh_first)) + _sysio_pb_gone(rootpb); /* * Release mount record resource. */ @@ -351,7 +350,10 @@ SYSIO_INTERFACE_NAME(mount)(const char * int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(mount, + source, target, + filesystemtype, + mountflags); err = _sysio_mount(_sysio_cwd, source, @@ -359,7 +361,7 @@ SYSIO_INTERFACE_NAME(mount)(const char * filesystemtype, mountflags, data); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, mount, 0); } int @@ -367,16 +369,22 @@ SYSIO_INTERFACE_NAME(umount)(const char { int err; struct pnode *pno; + struct mount *mnt; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER; + SYSIO_INTERFACE_ENTER(umount, target); /* * Look up the target path node. */ err = _sysio_namei(_sysio_cwd, target, 0, NULL, &pno); if (err) goto out; + mnt = pno->p_mount; + if (!err && mnt->mnt_root != pno) + err = -EINVAL; P_RELE(pno); /* was ref'd */ + if (err) + goto out; /* * Do the deed. @@ -387,11 +395,10 @@ SYSIO_INTERFACE_NAME(umount)(const char goto error; } #endif - assert(pno->p_mount); - err = _sysio_do_unmount(pno->p_mount); + err = _sysio_do_unmount(mnt); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, umount, 0); } /* @@ -416,23 +423,9 @@ _sysio_unmount_all() */ if (!_sysio_p_prune(pno)) continue; -#ifdef notdef - /* - * Need a ref but only if this is not the root of a - * disconnected graph. If it is, then it is covered by itself - * and, so, already referenced. - */ - if (pno->p_cover != pno) - P_REF(pno); -#endif err = _sysio_do_unmount(mnt); - if (err) { -#ifdef notdef - if (pno->p_cover != pno) - P_RELE(pno); -#endif + if (err) break; - } if (pno == _sysio_root) _sysio_root = NULL; } @@ -642,9 +635,8 @@ _sysio_automount(struct pnode *mntpno) { int err; struct inode *ino; - struct iovec iovec; - struct ioctx iocontext; - struct intnl_xtvec xtvec; + char *buf; + struct ioctx *ioctx; ssize_t cc; char *fstype, *source, *opts; unsigned flags; @@ -668,42 +660,27 @@ _sysio_automount(struct pnode *mntpno) */ return -EINVAL; } - iovec.iov_base = malloc(ino->i_stbuf.st_size + 1); - if (!iovec.iov_base) + buf = malloc(ino->i_stbuf.st_size + 1); + if (!buf) return -ENOMEM; - iovec.iov_len = ino->i_stbuf.st_size; err = _sysio_open(mntpno, O_RDONLY, 0); if (err) goto out; - xtvec.xtv_off = 0; - xtvec.xtv_len = ino->i_stbuf.st_size; - IOCTX_INIT(&iocontext, - 1, - 0, - ino, - &iovec, 1, - &xtvec, 1); - _sysio_ioctx_enter(&iocontext); - err = (*ino->i_ops.inop_read)(ino, &iocontext); - if (err) { - _sysio_ioctx_complete(&iocontext); - (void )(*ino->i_ops.inop_close)(ino); - goto out; + err = _sysio_p_aread(mntpno, 0, buf, ino->i_stbuf.st_size, &ioctx); + if (!err) { + cc = _sysio_ioctx_wait(ioctx); + if (cc < 0) + err = (int )cc; } - cc = _sysio_ioctx_wait(&iocontext); - err = (*ino->i_ops.inop_close)(ino); + (void )PNOP_CLOSE(mntpno); if (err) goto out; - if (cc < 0) { - err = (int )cc; - goto out; - } - ((char *)iovec.iov_base)[cc] = '\0'; + buf[cc] = '\0'; /* NUL terminate */ /* * Parse. */ - err = parse_automount_spec(iovec.iov_base, &fstype, &source, &opts); + err = parse_automount_spec(buf, &fstype, &source, &opts); if (err) goto out; flags = 0; @@ -733,8 +710,8 @@ _sysio_automount(struct pnode *mntpno) P_RELE(mntpno->p_parent); out: - if (iovec.iov_base) - free(iovec.iov_base); + if (buf) + free(buf); return err; } #endif Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- namei.c 12 Apr 2007 20:06:29 -0000 1.24 +++ namei.c 30 Apr 2007 16:52:20 -0000 1.25 @@ -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 @@ -90,7 +90,13 @@ lookup(struct pnode *parent, int err; struct pnode *pno; - if (!parent->p_base->pb_ino) + assert(parent != NULL); + /* + * The parent must be valid and a directory. + */ + if (!parent->p_parent) + return -ENOENT; + if (!S_ISDIR(parent->p_base->pb_ino->i_stbuf.st_mode)) return -ENOTDIR; /* @@ -109,8 +115,11 @@ lookup(struct pnode *parent, pno = NULL; if (name->len == 1 && name->name[0] == '.') pno = parent; - else if (name->len == 2 && name->name[0] == '.' && name->name[1] == '.') + else if (name->len == 2 && + name->name[0] == '.' && + name->name[1] == '.') { pno = parent->p_parent; + } if (pno) P_REF(pno); else { @@ -139,11 +148,7 @@ lookup(struct pnode *parent, /* * (Re)validate the pnode. */ - err = _sysio_p_validate(pno, intnt, path); - if (err) - return err; - - return 0; + return _sysio_p_validate(pno, intnt, path); } /* @@ -252,10 +257,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.29 diff -u -w -b -B -p -r1.28 -r1.29 --- open.c 3 May 2006 22:34:46 -0000 1.28 +++ open.c 30 Apr 2007 16:52:20 -0000 1.29 @@ -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); - ... [truncated message content] |
From: Lee W. <lw...@us...> - 2007-04-30 16:52:27
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2000/tests Modified Files: test_mkdir.c Log Message: Merged "unification" branch. First, the changes alter the core to perform pnode-ops by pnode. However, it maintains the pre-existing interface in order to minimize driver changes. Second, more detailed tracing information is available now in the form of a tag, indicating which function the data is from, as well as arguments and return data. Note1: The S_IFDIR bit is no longer set when the pnode-op mkdir function is called. If you need that, set it in your driver. Note2: It is possible to encounter a disconnected tree in _sysio_pb_path. If so, it returns an empty string. This *might* be good enough for your driver. If not, you'll need a change for this as well -- In fact, you should go ahead and change it anyway. Instead of _sysio_pb_path, use _sysio_pb_pathof. This new function takes the base pnode and a pointer to a string. It returns an integer. The usual zero on success or a negated errno on failure. Note3: Sockets support is horribly broken and won't build. As far as I know, this was never used. Unless somebody tells me differently, sockets support will be deprecated in the next release. Otherwise, let me know and I'll fix it. Index: test_mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_mkdir.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- test_mkdir.c 28 Mar 2007 21:27:12 -0000 1.2 +++ test_mkdir.c 30 Apr 2007 16:52:20 -0000 1.3 @@ -143,7 +143,7 @@ static int do_mkdir(const char *path) { - if (SYSIO_INTERFACE_NAME(mkdir)(path, 777) != 0) { + if (SYSIO_INTERFACE_NAME(mkdir)(path, 0777) != 0) { perror(path); return -1; } |
From: Ruth K. <rk...@us...> - 2007-04-20 16:26:21
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18830/src Modified Files: Tag: unification rw.c Log Message: explicitly discard const due to compiler warning Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.16.4.4 retrieving revision 1.16.4.5 diff -u -w -b -B -p -r1.16.4.4 -r1.16.4.5 --- rw.c 20 Apr 2007 15:17:32 -0000 1.16.4.4 +++ rw.c 20 Apr 2007 16:26:17 -0000 1.16.4.5 @@ -793,7 +793,7 @@ SYSIO_INTERFACE_NAME(pwrite64)(int fd, off64_t offset) { - return _do_pio(fd, _do_iwritex, buf, count, offset); + return _do_pio(fd, _do_iwritex, (void *)buf, count, offset); } #endif |
From: Ruth K. <rk...@us...> - 2007-04-20 15:17:35
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22404 Modified Files: Tag: unification rw.c Log Message: use off64_t Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.16.4.3 retrieving revision 1.16.4.4 diff -u -w -b -B -p -r1.16.4.3 -r1.16.4.4 --- rw.c 19 Apr 2007 22:11:01 -0000 1.16.4.3 +++ rw.c 20 Apr 2007 15:17:32 -0000 1.16.4.4 @@ -781,15 +781,16 @@ _do_pio(int fd, #if _LARGEFILE64_SOURCE ssize_t -SYSIO_INTERFACE_NAME(pread64)(int fd, void *buf, size_t count, off_t offset) +SYSIO_INTERFACE_NAME(pread64)(int fd, void *buf, size_t count, off64_t offset) { return _do_pio(fd, _do_ireadx, buf, count, offset); } ssize_t -SYSIO_INTERFACE_NAME(pwrite64)(int fd, const void *buf, - size_t count, off_t offset) +SYSIO_INTERFACE_NAME(pwrite64)(int fd, + const void *buf, size_t count, + off64_t offset) { return _do_pio(fd, _do_iwritex, buf, count, offset); |
From: Ruth K. <rk...@us...> - 2007-04-19 22:14:17
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25226 Modified Files: Tag: unification statvfs.c Log Message: ENTER call fn name typo Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.12.10.2 retrieving revision 1.12.10.3 diff -u -w -b -B -p -r1.12.10.2 -r1.12.10.3 --- statvfs.c 10 Apr 2007 21:25:31 -0000 1.12.10.2 +++ statvfs.c 19 Apr 2007 22:14:13 -0000 1.12.10.3 @@ -126,7 +126,7 @@ SYSIO_INTERFACE_NAME(fstatvfs)(int fd, s #endif SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(statvfs, fd); + SYSIO_INTERFACE_ENTER(fstatvfs, fd); err = 0; filp = _sysio_fd_find(fd); if (!filp) { |
From: Ruth K. <rk...@us...> - 2007-04-19 22:13:38
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24833 Modified Files: Tag: unification stddir.c Log Message: missing call to INTERFACE_RETURN Index: stddir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stddir.c,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -u -w -b -B -p -r1.2.4.1 -r1.2.4.2 --- stddir.c 10 Apr 2007 21:25:31 -0000 1.2.4.1 +++ stddir.c 19 Apr 2007 22:13:34 -0000 1.2.4.2 @@ -62,7 +62,7 @@ SYSIO_INTERFACE_NAME(opendir)(const char free(dir); SYSIO_INTERFACE_RETURN(NULL, -errno, opendir, 0); } - return dir; + SYSIO_INTERFACE_RETURN(dir, 0, opendir, 0); } sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(opendir), |
From: Ruth K. <rk...@us...> - 2007-04-19 22:11:07
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23620 Modified Files: Tag: unification rw.c Log Message: match unistd.h declaration of pwrite64 Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.16.4.2 retrieving revision 1.16.4.3 diff -u -w -b -B -p -r1.16.4.2 -r1.16.4.3 --- rw.c 12 Apr 2007 17:26:58 -0000 1.16.4.2 +++ rw.c 19 Apr 2007 22:11:01 -0000 1.16.4.3 @@ -788,7 +788,8 @@ SYSIO_INTERFACE_NAME(pread64)(int fd, vo } ssize_t -SYSIO_INTERFACE_NAME(pwrite64)(int fd, void *buf, size_t count, off_t offset) +SYSIO_INTERFACE_NAME(pwrite64)(int fd, const void *buf, + size_t count, off_t offset) { return _do_pio(fd, _do_iwritex, buf, count, offset); |
From: Lee W. <lw...@us...> - 2007-04-12 21:22:45
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13675 Modified Files: configure.in Log Message: Fix readlink type test and add a check for any kind of symlink support at all. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -b -B -p -r1.28 -r1.29 --- configure.in 28 Mar 2007 21:30:09 -0000 1.28 +++ configure.in 12 Apr 2007 21:22:43 -0000 1.29 @@ -219,12 +219,6 @@ case "$host_os" in # These systems are always xcoff xcoff=yes elf=no - # ... and always needed... - AC_DEFINE(__USE_LARGEFILE64) - AC_DEFINE(_LARGE_FILES) - AC_DEFINE(_LARGE_FILE_API) - AC_DEFINE(_ALL_SOURCE) - AC_DEFINE(_XOPEN_SOURCE_EXTENDED) ;; esac @@ -238,18 +232,50 @@ if test "$machine" = rs6000; then machine="powerpc" fi -AC_MSG_CHECKING(if readlink returns ssize_t) +case "$host_os" in + gnu* | linux*) + AC_DEFINE(_XOPEN_SOURCE, 600) + ;; + aix*) + # ... and always needed... + AC_DEFINE(__USE_LARGEFILE64) + AC_DEFINE(_LARGE_FILES) + AC_DEFINE(_LARGE_FILE_API) + AC_DEFINE(_ALL_SOURCE) + AC_DEFINE(_XOPEN_SOURCE_EXTENDED) + ;; +esac + +AC_MSG_CHECKING(for symlink support) +AC_TRY_COMPILE([ +#include <sys/types.h> +#include <sys/stat.h> +],[ +#ifndef S_ISLNK +#error +#endif +], + symlink_support="yes", + symlink_support="no" +) +AC_MSG_RESULT($symlink_support) + +if test x$symlink_support = xyes; then + AC_MSG_CHECKING(if readlink returns int) AC_TRY_COMPILE([ #include <unistd.h> ],[ - extern ssize_t readlink(const char *, char *, size_t); + extern int readlink(const char *, char *, size_t); ], - readlink_returns_ssize_t="yes", - readlink_returns_ssize_t="no" + readlink_returns_int="yes", + readlink_returns_int="no" ) -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]) + AC_MSG_RESULT($readlink_returns_int) + if test x$readlink_returns_int = no; then + AC_DEFINE(HAVE_POSIX_1003_READLINK, + 1, + [readlink returns ssize_t]) + fi fi # If we can't provoke the declaration of stat64 then we assume the |
From: Lee W. <lw...@us...> - 2007-04-12 20:07:07
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14335 Modified Files: mknod.c Log Message: Modified to remove dependency on _BSD_SOURCE definition. Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- mknod.c 3 May 2006 22:31:04 -0000 1.18 +++ mknod.c 12 Apr 2007 20:07:02 -0000 1.19 @@ -41,10 +41,6 @@ * le...@sa... */ -#if defined(__linux__) -#define _BSD_SOURCE -#endif - #include <unistd.h> #include <errno.h> #include <assert.h> @@ -76,8 +72,7 @@ _sysio_mknod(struct pnode *pno, mode_t m * Support only regular, character-special and fifos right now. * (mode & S_IFMT) == 0 is the same as S_IFREG. */ - if ((mode & S_IFMT) && - !(S_ISREG(mode) || S_ISCHR(mode) || S_ISFIFO(mode))) + if (!(S_ISREG(mode) || S_ISCHR(mode) || S_ISFIFO(mode))) return -EINVAL; if (IS_RDONLY(pno)) |
From: Lee W. <lw...@us...> - 2007-04-12 20:06:35
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14308 Modified Files: namei.c Log Message: Remove unneeded _BSD_SOURCE definition. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- namei.c 4 May 2006 02:32:08 -0000 1.23 +++ namei.c 12 Apr 2007 20:06:29 -0000 1.24 @@ -41,10 +41,6 @@ * le...@sa... */ -#if defined(AUTOMOUNT_FILE_NAME) && defined(__linux__) -#define _BSD_SOURCE -#endif - #include <stdlib.h> #include <string.h> #include <errno.h> |
From: Lee W. <lw...@us...> - 2007-04-12 20:06:16
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13923 Modified Files: init.c Log Message: Define _BSD_SOURCE conditionally on whether we are compiling under linux or not. Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -w -b -B -p -r1.30 -r1.31 --- init.c 4 May 2006 02:31:05 -0000 1.30 +++ init.c 12 Apr 2007 20:05:52 -0000 1.31 @@ -41,13 +41,15 @@ * le...@sa... */ +#ifdef __linux__ #define _BSD_SOURCE +#endif #if SYSIO_TRACING #include <stdio.h> #endif #include <stdlib.h> -#if SYSIO_TRACING +#ifdef _BSD_SOURCE #include <sys/syscall.h> #endif #include <unistd.h> |