libsysio-commit Mailing List for libsysio (Page 39)
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...> - 2003-10-21 14:51:55
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv24724/include Modified Files: sysio.h Log Message: Hmmm. Make statvfs/statvfs64 work again. Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- sysio.h 21 Oct 2003 13:27:43 -0000 1.11 +++ sysio.h 21 Oct 2003 13:38:47 -0000 1.12 @@ -125,6 +125,7 @@ struct stat; #define INTNL_STATVFS_IS_NATURAL 1 #endif struct statvfs; +struct intnl_statvfs; #endif struct iovec; |
From: Lee W. <lw...@us...> - 2003-10-21 02:05:11
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv11995 Modified Files: stat64.c Log Message: From Wally Wang at Cray; A typo of _LARGEFILE64_SOURCE and statvfs in the 64-bit variety wasn't being built. Fixed now. Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- stat64.c 10 Oct 2003 18:50:31 -0000 1.4 +++ stat64.c 21 Oct 2003 01:13:58 -0000 1.5 @@ -41,7 +41,7 @@ * le...@sa... */ -#ifdef _LARGFILE64_SOURCE +#ifdef _LARGEFILE64_SOURCE #include <errno.h> #include <assert.h> |
From: Ruth K. <rk...@us...> - 2003-10-20 21:06:21
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv7563 Modified Files: link.c Log Message: fix link - was returning EEXIST always Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- link.c 27 Sep 2003 19:42:03 -0000 1.1 +++ link.c 20 Oct 2003 16:31:23 -0000 1.2 @@ -72,7 +72,7 @@ link(const char *oldpath, const char *ne err = _sysio_namei(_sysio_cwd, newpath, ND_NEGOK, &intent, &new); if (err && !new) goto error2; - if (!err || (err && err != -ENOENT)) { + if (err && err != -ENOENT) { err = -EEXIST; goto error1; } |
From: Ruth K. <rk...@us...> - 2003-10-20 20:39:21
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv30717 Modified Files: write.c Log Message: remove dup include Index: write.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/write.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- write.c 14 Oct 2003 18:00:30 -0000 1.9 +++ write.c 20 Oct 2003 15:51:22 -0000 1.10 @@ -55,8 +55,6 @@ #include "sysio-symbols.h" -#include "sysio-symbols.h" - /* * Schedule asynchronous write of iovec at some file extent. */ |
From: Lee W. <lw...@us...> - 2003-10-20 17:22:16
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv18723 Modified Files: stat.c Log Message: From Sue Kelly; Why isn't __stat static like the other base routines? It is now. Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- stat.c 14 Oct 2003 18:00:30 -0000 1.5 +++ stat.c 20 Oct 2003 17:15:38 -0000 1.6 @@ -144,7 +144,7 @@ out: return err; } -int +static int __stat(const char *filename, struct stat *buf) { |
From: Ruth K. <rk...@us...> - 2003-10-20 17:13:19
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1:/tmp/cvs-serv8041 Modified Files: Makefile.am fs_yod.c Log Message: merge cplant changes Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- Makefile.am 14 Aug 2003 18:39:33 -0000 1.2 +++ Makefile.am 20 Oct 2003 16:33:59 -0000 1.3 @@ -1,6 +1,6 @@ lib_LIBRARIES = libsysio_yod.a -EXTRA_DIST = fs_yod.h +EXTRA_DIST = ../../include/cplant-yod.h fs_yod.h libsysio_yod_a_SOURCES = fs_yod.c Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- fs_yod.c 17 Oct 2003 21:30:29 -0000 1.5 +++ fs_yod.c 20 Oct 2003 16:34:00 -0000 1.6 @@ -57,8 +57,12 @@ #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> +#endif #include <utime.h> #include <sys/queue.h> #include <sys/uio.h> @@ -167,7 +171,9 @@ static int yod_inop_symlink(struct pnode static int yod_inop_readlink(struct pnode *pno, char *buf, size_t bufsiz); static int yod_inop_open(struct pnode *pno, int flags, mode_t mode); static int yod_inop_close(struct inode *ino); +static int yod_inop_link(struct pnode *old, struct pnode *new); static int yod_inop_unlink(struct pnode *pno); +static int yod_inop_rename(struct pnode *old, struct pnode *new); static int yod_inop_ipreadv(struct inode *ino, struct ioctx *ioctx); static int yod_inop_ipwritev(struct inode *ino, @@ -180,9 +186,11 @@ static int yod_inop_ioctl(struct inode * unsigned long int request, va_list ap); static int yod_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); +#ifdef _HAVE_STATVFS static int yod_inop_statvfs(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); +#endif static void yod_inop_gone(struct inode *ino); static struct inode_ops yod_i_ops = { @@ -196,7 +204,9 @@ static struct inode_ops yod_i_ops = { yod_inop_readlink, yod_inop_open, yod_inop_close, + yod_inop_link, yod_inop_unlink, + yod_inop_rename, yod_inop_ipreadv, yod_inop_ipwritev, yod_inop_iodone, @@ -205,7 +215,9 @@ static struct inode_ops yod_i_ops = { yod_inop_datasync, yod_inop_ioctl, yod_inop_mknod, +#ifdef _HAVE_STATVFS yod_inop_statvfs, +#endif yod_inop_gone }; @@ -282,6 +293,7 @@ yod_i_new(struct filesys *fs, struct int nino = malloc(sizeof(struct yod_inode)); if (!nino) return NULL; + bzero(&nino->ni_ident, sizeof(nino->ni_ident)); nino->ni_ident.dev = buf->st_dev; nino->ni_ident.ino = buf->st_ino; #ifdef HAVE_GENERATION @@ -531,6 +543,7 @@ yod_iget(struct filesys *fs, /* * I-node is not already known. Find or create it. */ + bzero(&ident, sizeof(ident)); ident.dev = stbuf.st_dev; ident.ino = stbuf.st_ino; #ifdef HAVE_GENERATION @@ -701,7 +714,7 @@ yod_inop_setattr(struct pnode *pno, } if (err) mask &= ~(SETATTR_UID|SETATTR_GID); - if (mask & SETATTR_LEN) { + else if (mask & SETATTR_LEN) { /* * Do the truncate last. It can't be undone. */ @@ -724,15 +737,6 @@ yod_inop_setattr(struct pnode *pno, ? st.st_gid : (gid_t )-1); } -#if 0 - if (mask & (SETATTR_MTIME|SETATTR_ATIME)) { - struct utimbuf ut; - - ut.actime = st.st_atime; - ut.modtime = st.st_mtime; - (void )utime_yod(path, &ut); - } -#endif if (mask & SETATTR_MODE) { chmod_yod(path, st.st_mode & 0777); } @@ -920,10 +924,36 @@ yod_inop_close(struct inode *ino) } static int +yod_inop_link(struct pnode *old, struct pnode *new) +{ + int err; + char *opath, *npath; + + err = 0; + + opath = _sysio_pb_path(old->p_base, '/'); + npath = _sysio_pb_path(new->p_base, '/'); + if (!(opath && npath)) { + err = -ENOMEM; + goto out; + } + + err = link_yod(opath, npath); + +out: + if (opath) + free(opath); + if (npath) + free(npath); + + return err; +} + +static int yod_inop_unlink(struct pnode *pno) { char *path; - int err; + int err = 0; path = _sysio_pb_path(pno->p_base, '/'); if (!path) @@ -941,7 +971,8 @@ yod_inop_unlink(struct pnode *pno) * (usually .NFSXXXXXX, where the X's are replaced by the PID and some * unique characters) in order to simulate the proper semantic. */ - err = unlink_yod(path); + if (unlink_yod(path) != 0) + err = -errno; free(path); return err; } @@ -1009,11 +1040,40 @@ doio(ssize_t (*f)(int, const struct iove * Helper function passed to doio(), above, to accomplish a real readv. */ static ssize_t -_readv(int fd, const struct iovec *vector, int count __IS_UNUSED) +_readv(int fd, const struct iovec *vector, int count) { - return read_yod(fd, - vector[0].iov_base, - vector[0].iov_len); + int i; + ssize_t total = 0; + + for (i = 0; i < count; i++) + total += read_yod(fd, + vector[i].iov_base, + vector[i].iov_len); + return total; +} + +static int +yod_inop_rename(struct pnode *old, struct pnode *new) +{ + int err; + char *opath, *npath; + + opath = _sysio_pb_path(old->p_base, '/'); + npath = _sysio_pb_path(new->p_base, '/'); + if (!(opath && npath)) { + err = -ENOMEM; + goto out; + } + + err = rename_yod(opath, npath); + +out: + if (opath) + free(opath); + if (npath) + free(npath); + + return err; } static int @@ -1082,6 +1142,7 @@ yod_inop_mknod(struct pnode *pno __IS_UN return -ENOSYS; } +#ifdef _HAVE_STATVFS static int yod_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -1127,6 +1188,7 @@ yod_inop_statvfs(struct pnode *pno, buf->f_namemax = fs.f_namelen; return 0; } +#endif static int yod_inop_sync(struct inode *ino) @@ -1170,13 +1232,11 @@ yod_inop_gone(struct inode *ino) } static void -yod_fsop_gone(struct filesys *fs) +yod_fsop_gone(struct filesys *fs __IS_UNUSED) { /* - * Release fs private data + * Do nothing. There is no private part maintained for the + * yod file interface. */ - - if (fs->fs_private) free(fs->fs_private); - } |
From: Lee W. <lw...@us...> - 2003-10-20 17:08:21
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv15731/native Modified Files: fs_native.c Log Message: From patch supplied by Sue Kelly. The RedStorm integration contained numerous bugs. Fixed are: a) Include uio.h now that we reference members directly. b) Update position before looping over the IO vector. c) Update ioctx_cc member of IO context after each successful partial transfer. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -b -B -p -r1.22 -r1.23 --- fs_native.c 20 Oct 2003 16:44:36 -0000 1.22 +++ fs_native.c 20 Oct 2003 17:01:31 -0000 1.23 @@ -74,6 +74,7 @@ #include "fs_native.h" #ifdef REDSTORM +#include <sys/uio.h> #include <catamount/syscall.h> /* ! in sys include? */ #endif @@ -1216,11 +1217,12 @@ doio(iof f, struct iovec *iov = ioctx->ioctx_iovec; ssize_t cc; + nino->ni_fpos = ioctx->ioctx_offset; while (count) { cc = (*f)(nino->ni_fd, - iov->base, - iov->len, + iov->iov_base, + iov->iov_len, nino->ni_fpos); if (cc < 0) { if (ioctx->ioctx_cc) { @@ -1232,6 +1234,7 @@ doio(iof f, } break; } + ioctx->ioctx_cc += cc; count--, iov++; } } |
From: Ruth K. <rk...@us...> - 2003-10-20 17:07:55
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1:/tmp/cvs-serv7820 Modified Files: Makefile.am drv_init_all.c Added Files: test_link.c Log Message: merge cplant changes --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Questions or comments about this library should be sent to: * * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 * Albuquerque, NM 87185-1110 * * le...@sa... */ #include <stdio.h> #include <stdlib.h> #include <string.h> #ifndef REDSTORM #include <getopt.h> #else #include <unistd.h> #endif #include <errno.h> #include <sys/types.h> #include <sys/queue.h> #if 0 #include <dirent.h> #endif #include "sysio.h" #include "mount.h" #include "test.h" /* * Test hard link * * Usage: link [-a] [-m <fsname>] [-r <mntpath>] oldpath newpath * */ static int linkit(const char *old, const char *new); static void usage(void); static const char *root_driver = DEFAULT_DRIVER; static const char *mntpath = "/"; static unsigned mntflgs = 0; #ifdef AUTOMOUNT_FILE_NAME #define EXTRA_AUTOMOUNT_OPT "a" #else #define EXTRA_AUTOMOUNT_OPT #endif const char *opts = EXTRA_AUTOMOUNT_OPT "m:r:"; int main(int argc, char *const argv[]) { int i; int err; int n; /* * Parse command line arguments. */ while ((i = getopt(argc, argv, opts)) != -1) switch (i) { #ifdef AUTOMOUNT_FILE_NAME case 'a': mntflgs |= MOUNT_F_AUTO; break; #endif case 'm': root_driver = optarg; break; case 'r': mntpath = optarg; break; default: usage(); } /* * Init sysio lib. */ _sysio_init(); /* * Init native file system driver and request mount of specified * source directory. */ err = drv_init_all(); if (err) { errno = -err; perror("drv_init_all"); exit(1); } err = _sysio_mount_root(mntpath, root_driver, mntflgs, NULL); if (err) { errno = -err; perror("_sysio_mount_root"); exit(1); } n = argc - optind; if (n < 2) usage(); /* * Try paths listed on command-line. */ while (optind < argc) { const char *old, *new; old = argv[optind++]; new = argv[optind++]; (void )linkit(old, new); } /* * Clean up. */ _sysio_shutdown(); return 0; } static int linkit(const char *old, const char *new) { unlink(new); if (link(old, new) < 0) { perror(old); return -1; } return 0; } static void usage() { (void )fprintf(stderr, "Usage: unlink [-a] [-m <driver>] [-r <mntpath>]" " oldpath newpath\n"); exit(1); } Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- Makefile.am 13 Oct 2003 21:23:44 -0000 1.14 +++ Makefile.am 20 Oct 2003 16:32:28 -0000 1.15 @@ -1,5 +1,5 @@ noinst_PROGRAMS = test_copy test_stats test_path test_mounts test_list \ - test_getcwd test_stdfd test_unlink test_rename test_driver + test_getcwd test_stdfd test_link test_unlink test_rename test_driver CLEANFILES=drv_data.c @@ -36,6 +36,7 @@ endif if WITH_CPLANT_YOD YOD_DRIVER_NAME=yod YOD_DRIVER_CFLAGS= -DCPLANT_YOD +YOD_DRIVER_LIB=$(top_builddir)/drivers/yod/libsysio_yod.a else YOD_DRIVER_NAME= YOD_DRIVER_CFLAGS= @@ -97,6 +98,11 @@ test_stdfd_CFLAGS=$(CFL) test_stdfd_LDADD=$(LIBS) test_stdfd_DEPENDENCIES=$(LIBS) +test_link_SOURCES=test_link.c $(CMNSRC) +test_link_CFLAGS=$(CFL) +test_link_LDADD=$(LIBS) +test_link_DEPENDENCIES=$(LIBS) + test_unlink_SOURCES=test_unlink.c $(CMNSRC) test_unlink_CFLAGS=$(CFL) test_unlink_LDADD=$(LIBS) @@ -112,7 +118,7 @@ test_driver_CFLAGS=$(CFL) test_driver_LDADD=$(LIBS) test_driver_DEPENDENCIES=$(LIBS) -EXTRA_DIST=gendrvdata.sh test.h test_driver.h +EXTRA_DIST=$(shell ls *.pl *.pm) gendrvdata.sh test.h test_driver.h drv_data.c: $(CONFIG_DEPENDENCIES) $(top_srcdir)/tests/gendrvdata.sh test -z "drv_data.c" && rm -f drv_data.c; \ Index: drv_init_all.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/drv_init_all.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- drv_init_all.c 22 Feb 2003 18:25:11 -0000 1.1 +++ drv_init_all.c 20 Oct 2003 16:32:29 -0000 1.2 @@ -1,3 +1,5 @@ +#include <stdio.h> + extern int (*drvinits[])(void); /* |
From: Ruth K. <rk...@us...> - 2003-10-20 17:07:54
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv8240 Modified Files: cplant-yod.h Log Message: merge cplant changes Index: cplant-yod.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/cplant-yod.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- cplant-yod.h 14 Aug 2003 18:39:33 -0000 1.2 +++ cplant-yod.h 20 Oct 2003 16:34:48 -0000 1.3 @@ -48,14 +48,17 @@ extern int chmod_yod(const char* path, m extern int chown_yod(const char* path, uid_t, gid_t); extern int stat_yod(const char *path, struct stat *sbuf); extern int fstat_yod(int fd, struct stat *buf); +#ifdef _HAVE_STATVFS extern int statfs_yod(const char *path, struct statfs *sbuf); extern int fstatfs_yod(int fd, struct statfs *buf); +#endif extern int mkdir_yod(const char *path, mode_t mode); extern int rmdir_yod(const char *path); extern int getdirentries_yod(int fd, char *buf, size_t nbytes, loff_t *basep); extern int link_yod(const char *path1, const char *path2); extern int unlink_yod(const char *path); extern int symlink_yod(const char *path1, const char *path2 ); +extern int rename_yod( const char *path1, const char *path2 ); extern int open_yod(const char *fname, int flags, mode_t mode); extern int close_yod(int); extern ssize_t write_yod(int fd, const void *buff, size_t nbytes); |
From: Lee W. <lw...@us...> - 2003-10-20 17:06:44
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1:/tmp/cvs-serv9788/yod Modified Files: fs_yod.c Log Message: From Ruth Klundt; If a file is opened twice the first close destroys the file descriptor in the low-level driver. Further use by the second, then, will get EBADF or, on close, aborts. Why was the open ref count code ifdef'd out? I did it and can't for the life of me recall why. Anyway, it's back now. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- fs_yod.c 20 Oct 2003 16:34:00 -0000 1.6 +++ fs_yod.c 20 Oct 2003 16:44:36 -0000 1.7 @@ -144,9 +144,7 @@ struct yod_inode { struct file_identifier ni_fileid; /* ditto */ int ni_fd; /* host fildes */ int ni_oflags; /* flags, from open */ -#if 0 unsigned ni_nopens; /* soft ref count */ -#endif off_t ni_fpos; /* current pos */ }; @@ -303,9 +301,7 @@ yod_i_new(struct filesys *fs, struct int nino->ni_fileid.fid_len = sizeof(nino->ni_ident); nino->ni_fd = -1; nino->ni_oflags = 0; -#if 0 nino->ni_nopens = 0; -#endif nino->ni_fpos = 0; ino = _sysio_i_new(fs, @@ -876,10 +872,8 @@ yod_inop_open(struct pnode *pno, int fla * Remember this new open. */ nino = I2NI(pno->p_base->pb_ino); -#if 0 nino->ni_nopens++; assert(nino->ni_nopens); -#endif if (nino->ni_fd >= 0) { if ((nino->ni_oflags & O_RDWR) || @@ -910,14 +904,12 @@ yod_inop_close(struct inode *ino) if (nino->ni_fd < 0) abort(); -#if 0 - assert(nino->ni_nopens); - if (--nino->ni_nopens) - return 0; -#endif err = close_yod(nino->ni_fd); if (err) return -errno; + assert(nino->ni_nopens); + if (--nino->ni_nopens) + return 0; nino->ni_fd = -1; nino->ni_fpos = 0; return 0; |
From: Lee W. <lw...@us...> - 2003-10-20 17:06:40
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv9788/native Modified Files: fs_native.c Log Message: From Ruth Klundt; If a file is opened twice the first close destroys the file descriptor in the low-level driver. Further use by the second, then, will get EBADF or, on close, aborts. Why was the open ref count code ifdef'd out? I did it and can't for the life of me recall why. Anyway, it's back now. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- fs_native.c 17 Oct 2003 21:30:29 -0000 1.21 +++ fs_native.c 20 Oct 2003 16:44:36 -0000 1.22 @@ -191,9 +191,7 @@ struct native_inode { struct file_identifier ni_fileid; /* ditto */ int ni_fd; /* host fildes */ int ni_oflags; /* flags, from open */ -#if 0 unsigned ni_nopens; /* soft ref count */ -#endif off_t ni_fpos; /* current pos */ }; @@ -357,9 +355,7 @@ native_i_new(struct filesys *fs, struct nino->ni_fileid.fid_len = sizeof(nino->ni_ident); nino->ni_fd = -1; nino->ni_oflags = 0; -#if 0 nino->ni_nopens = 0; -#endif nino->ni_fpos = 0; ino = _sysio_i_new(fs, @@ -1048,10 +1044,8 @@ native_inop_open(struct pnode *pno, int * Remember this new open. */ nino = I2NI(pno->p_base->pb_ino); -#if 0 nino->ni_nopens++; assert(nino->ni_nopens); -#endif if (nino->ni_fd >= 0) { if ((nino->ni_oflags & O_RDWR) || @@ -1082,15 +1076,21 @@ native_inop_close(struct inode *ino) if (nino->ni_fd < 0) abort(); -#if 0 - assert(nino->ni_nopens); - if (--nino->ni_nopens) - return 0; -#endif - err = syscall(SYS_close, nino->ni_fd); if (err) return -errno; + + assert(nino->ni_nopens); + if (--nino->ni_nopens) { + /* + * Hmmm. We really don't need anything else. However, some + * filesystems try to implement a sync-on-close semantic. + * As this appears now, that is lost. Might want to change + * it somehow in the future? + */ + return 0; + } + nino->ni_fd = -1; nino->ni_fpos = 0; return 0; |
From: Lee W. <lw...@us...> - 2003-10-17 21:30:33
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1:/tmp/cvs-serv10931/drivers/yod Modified Files: fs_yod.c Log Message: Added a done bit to the IO context record to *positively* signal completion. Also, added a driver private pointer to the dsame record for handy use. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- fs_yod.c 15 Oct 2003 18:00:55 -0000 1.4 +++ fs_yod.c 17 Oct 2003 21:30:29 -0000 1.5 @@ -1001,6 +1001,7 @@ doio(ssize_t (*f)(int, const struct iove nino->ni_fpos += ioctx->ioctx_cc; } + ioctx->ioctx_done = 1; return 0; } |
From: Lee W. <lw...@us...> - 2003-10-17 21:30:33
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv10931/drivers/native Modified Files: fs_native.c Log Message: Added a done bit to the IO context record to *positively* signal completion. Also, added a driver private pointer to the dsame record for handy use. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- fs_native.c 15 Oct 2003 18:00:54 -0000 1.20 +++ fs_native.c 17 Oct 2003 21:30:29 -0000 1.21 @@ -1245,6 +1245,7 @@ doio(iof f, nino->ni_fpos += ioctx->ioctx_cc; out: + ioctx->ioctx_done = 1; return 0; } |
From: Lee W. <lw...@us...> - 2003-10-17 21:30:33
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv10931/include Modified Files: inode.h Log Message: Added a done bit to the IO context record to *positively* signal completion. Also, added a driver private pointer to the dsame record for handy use. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- inode.h 15 Oct 2003 18:00:56 -0000 1.12 +++ inode.h 17 Oct 2003 21:30:29 -0000 1.13 @@ -356,7 +356,8 @@ struct ioctx_callback { struct ioctx { LIST_ENTRY(ioctx) ioctx_link; /* AIO list link */ unsigned - ioctx_fast : 1; /* from stack space */ + ioctx_fast : 1, /* from stack space */ + ioctx_done : 1; /* transfer complete */ ioid_t ioctx_id; /* unique ident */ struct inode *ioctx_ino; /* i-node */ const struct iovec *ioctx_iovec; /* scatter/gather vec */ @@ -364,7 +365,8 @@ struct ioctx { _SYSIO_OFF_T ioctx_offset; /* file offset */ ssize_t ioctx_cc; /* rtn char count */ int ioctx_errno; /* error number */ - TAILQ_HEAD(, ioctx_callback) ioctx_cbq; /* error number */ + TAILQ_HEAD(, ioctx_callback) ioctx_cbq; /* callback queue */ + void *ioctx_private; /* driver data */ }; /* @@ -373,6 +375,7 @@ struct ioctx { #define IOCTX_INIT(ioctx, fast, id, ino, iov, iovlen, off) \ do { \ (ioctx)->ioctx_fast = (fast); \ + (ioctx)->ioctx_done = 0; \ (ioctx)->ioctx_id = (id); \ (ioctx)->ioctx_ino = (ino); \ (ioctx)->ioctx_iovec = (iov); \ @@ -381,7 +384,9 @@ struct ioctx { (ioctx)->ioctx_cc = 0; \ (ioctx)->ioctx_errno = 0; \ TAILQ_INIT(&(ioctx)->ioctx_cbq); \ + (ioctx)->ioctx_private = NULL; \ } while (0) + /* * Return whether a pnode/inode is on a read-only mount or file system. */ |
From: Lee W. <lw...@us...> - 2003-10-17 21:30:33
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1:/tmp/cvs-serv10931/drivers/incore Modified Files: fs_incore.c Log Message: Added a done bit to the IO context record to *positively* signal completion. Also, added a driver private pointer to the dsame record for handy use. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- fs_incore.c 15 Oct 2003 20:08:52 -0000 1.10 +++ fs_incore.c 17 Oct 2003 21:30:29 -0000 1.11 @@ -1502,6 +1502,8 @@ incore_doio(ssize_t (*f)(struct incore_i ioctx->ioctx_errno = -cc; } + ioctx->ioctx_done = 1; + return 0; } |
From: Lee W. <lw...@us...> - 2003-10-17 21:30:33
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv10931/src Modified Files: ioctx.c iowait.c Log Message: Added a done bit to the IO context record to *positively* signal completion. Also, added a driver private pointer to the dsame record for handy use. Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- ioctx.c 13 Oct 2003 02:43:17 -0000 1.5 +++ ioctx.c 17 Oct 2003 21:30:29 -0000 1.6 @@ -172,7 +172,8 @@ _sysio_ioctx_wait(struct ioctx *ioctx) /* * Wait for async operation to complete. */ - while (!(*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)) + while (!(ioctx->ioctx_done || + (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx))) ; /* @@ -197,19 +198,7 @@ _sysio_ioctx_wait(struct ioctx *ioctx) void _sysio_ioctx_complete(struct ioctx *ioctx) { -#if 0 - struct inode *ino; -#endif struct ioctx_callback *entry; - -#if 0 - /* - * Wait for IO to complete and remember completion values. - */ - ino = ioctx->ioctx_ino; - while (ino && !(*ino->i_ops.inop_iodone)(ioctx)) - ; -#endif /* * Run the call-back queue. Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- iowait.c 9 Mar 2003 06:25:45 -0000 1.3 +++ iowait.c 17 Oct 2003 21:30:29 -0000 1.4 @@ -75,7 +75,8 @@ iodone(ioid_t ioid) if (!ioctx) return -1; - return (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx); + return (ioctx->ioctx_done || + (*ioctx->ioctx_ino->i_ops.inop_iodone)(ioctx)); } /* |
From: Ruth K. <rk...@us...> - 2003-10-16 14:09:28
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv19370 Modified Files: Tag: cplant truncate.c Log Message: remove previous change Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.3.10.2 retrieving revision 1.3.10.3 diff -u -w -b -B -p -r1.3.10.2 -r1.3.10.3 --- truncate.c 15 Oct 2003 19:36:32 -0000 1.3.10.2 +++ truncate.c 16 Oct 2003 14:04:25 -0000 1.3.10.3 @@ -68,7 +68,7 @@ do_truncate(struct pnode *pno, struct in ino = pno->p_base->pb_ino; if (!ino) return -EBADF; - if (!S_ISREG(ino->i_mode) && !S_ISCHR(ino->i_mode)) + if (!S_ISREG(ino->i_mode)) return -EISDIR; /* for others too? */ (void )memset(&stbuf, 0, sizeof(stbuf)); |
From: Lee W. <lw...@us...> - 2003-10-15 20:09:25
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1:/tmp/cvs-serv1369 Modified Files: fs_incore.c Log Message: The incore unlink_entry routine has duplicated code (from the recent merge?) which caused it to lower the link count twice -- From Ruth. Fixed. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- fs_incore.c 15 Oct 2003 18:00:54 -0000 1.9 +++ fs_incore.c 15 Oct 2003 20:08:52 -0000 1.10 @@ -1233,12 +1233,6 @@ incore_unlink_entry(struct incore_inode assert(icino->ici_st.st_nlink > 2); icino->ici_st.st_nlink--; - /* - * Adjust link count. - */ - assert(icino->ici_st.st_nlink > 2); - icino->ici_st.st_nlink--; - return 0; } |
From: Lee W. <le...@sa...> - 2003-10-15 20:08:33
|
Hi Ruth, I suspect you just fixed a bug caused by something entirely different. The man page for {f}truncate indicates it *only* works on regular files. Certainly not character specials... This is also verified from the Linux kernel source. The following code fragment is from do_sys_truncate: /* For directories it's -EISDIR, for other non-regulars - -EINVAL */ error = -EISDIR; if (S_ISDIR(inode->i_mode)) goto dput_and_out; error = -EINVAL; if (!S_ISREG(inode->i_mode)) goto dput_and_out; See what I mean? Could you back your change out and try to track down why the FORTRAN compiler would even think it's attached to a regular file in the first place? Could this be related to an isatty() failure again? On Wed, 2003-10-15 at 15:36, Ruth Klundt wrote: > Update of /cvsroot/libsysio/libsysio/src > In directory sc8-pr-cvs1:/tmp/cvs-serv27657 > > Modified Files: > Tag: cplant > truncate.c > Log Message: > fix for fortran print - it calls truncate...on stdout > > Index: truncate.c > =================================================================== > RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v > retrieving revision 1.3.10.1 > retrieving revision 1.3.10.2 > diff -u -w -b -B -p -r1.3.10.1 -r1.3.10.2 > --- truncate.c 14 Oct 2003 23:39:36 -0000 1.3.10.1 > +++ truncate.c 15 Oct 2003 19:36:32 -0000 1.3.10.2 > @@ -68,7 +68,7 @@ do_truncate(struct pnode *pno, struct in > ino = pno->p_base->pb_ino; > if (!ino) > return -EBADF; > - if (!S_ISREG(ino->i_mode)) > + if (!S_ISREG(ino->i_mode) && !S_ISCHR(ino->i_mode)) > return -EISDIR; /* for others too? */ > > (void )memset(&stbuf, 0, sizeof(stbuf)); > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > SourceForge.net hosts over 70,000 Open Source Projects. > See the people who have HELPED US provide better services: > Click here: http://sourceforge.net/supporters.php > _______________________________________________ > Libsysio-commit mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libsysio-commit -- Lee Ward <le...@sa...> Sandia National Laboratories |
From: Ruth K. <rk...@us...> - 2003-10-15 19:38:56
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv27657 Modified Files: Tag: cplant truncate.c Log Message: fix for fortran print - it calls truncate...on stdout Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.3.10.1 retrieving revision 1.3.10.2 diff -u -w -b -B -p -r1.3.10.1 -r1.3.10.2 --- truncate.c 14 Oct 2003 23:39:36 -0000 1.3.10.1 +++ truncate.c 15 Oct 2003 19:36:32 -0000 1.3.10.2 @@ -68,7 +68,7 @@ do_truncate(struct pnode *pno, struct in ino = pno->p_base->pb_ino; if (!ino) return -EBADF; - if (!S_ISREG(ino->i_mode)) + if (!S_ISREG(ino->i_mode) && !S_ISCHR(ino->i_mode)) return -EISDIR; /* for others too? */ (void )memset(&stbuf, 0, sizeof(stbuf)); |
From: Lee W. <lw...@us...> - 2003-10-15 19:25:28
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv24739/src Modified Files: chdir.c Log Message: Grrr... Here again! The recent changes to the mount interconnection exposed the name of the covering path-node. The name of this node was being delivered by _sysio_p_path inappropriately. Instead, the _sysio_p_path routine must dive down to the bottom-most, covered, path node for the component name. Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- chdir.c 6 Oct 2003 21:19:31 -0000 1.7 +++ chdir.c 15 Oct 2003 19:21:37 -0000 1.8 @@ -164,6 +164,14 @@ _sysio_p_path(struct pnode *pno, char ** n = 0; do { /* + * If this is a covering path-node then the name should be + * 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 ) + pno = pno->p_mount->mnt_covers; + + /* * Add length of this component to running sum and * account for this vertex. */ @@ -196,6 +204,14 @@ _sysio_p_path(struct pnode *pno, char ** cp = *buf + len + n; *cp = '\0'; /* NUL terminate */ do { + /* + * If this is a covering path-node then the name should be + * 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 ) + pno = pno->p_mount->mnt_covers; + /* * Add component and separator. */ |
From: Lee W. <lw...@us...> - 2003-10-15 18:01:33
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1:/tmp/cvs-serv9577/drivers/incore Modified Files: fs_incore.c Log Message: Eliminated the i-node number field from the inode structure. We already carry the file identifier so it was redundant. Problematic too, in that it can be 32 or 64 bits in size. This forced _sysio_i_new() and _sysio_i_find() to change -- They no longer take the i-node number as an argument. Updated the driver calls to reflect the new usage. The i-node cache is now indexed by hashing the file identifier as opposed to just using the, no longer maintained, i-node number. This caused _sysio_i_find to become 2+ percent more expensive to use. Acceptable for me. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- fs_incore.c 13 Oct 2003 01:04:34 -0000 1.8 +++ fs_incore.c 15 Oct 2003 18:00:54 -0000 1.9 @@ -625,7 +625,6 @@ _sysio_incore_fsswop_mount(const char *s */ rooti = _sysio_i_new(fs, - icino->ici_st.st_ino, &icino->ici_fileid, icino->ici_st.st_mode, 0, @@ -827,7 +826,7 @@ _sysio_incore_dirop_lookup(struct pnode fileid.fid_data = &de->d_ino; fileid.fid_len = sizeof(de->d_ino); ino = - _sysio_i_find(ino->i_fs, de->d_ino, &fileid); + _sysio_i_find(ino->i_fs, &fileid); #ifdef notdef if (ino) goto out; @@ -848,7 +847,6 @@ _sysio_incore_dirop_lookup(struct pnode abort(); ino = _sysio_i_new(ino->i_fs, - icino->ici_st.st_ino, &icino->ici_fileid, icino->ici_st.st_mode, 0, @@ -1158,7 +1156,6 @@ _sysio_incore_dirop_mkdir(struct pnode * */ ino = _sysio_i_new(pno->p_parent->p_base->pb_ino->i_fs, - stat.st_ino, &icino->ici_fileid, stat.st_mode, 0, @@ -1301,7 +1298,6 @@ incore_create(struct pnode *pno, struct */ ino = _sysio_i_new(dino->i_fs, - st->st_ino, &icino->ici_fileid, st->st_mode, st->st_rdev, |
From: Lee W. <lw...@us...> - 2003-10-15 18:01:33
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv9577/drivers/native Modified Files: fs_native.c Log Message: Eliminated the i-node number field from the inode structure. We already carry the file identifier so it was redundant. Problematic too, in that it can be 32 or 64 bits in size. This forced _sysio_i_new() and _sysio_i_find() to change -- They no longer take the i-node number as an argument. Updated the driver calls to reflect the new usage. The i-node cache is now indexed by hashing the file identifier as opposed to just using the, no longer maintained, i-node number. This caused _sysio_i_find to become 2+ percent more expensive to use. Acceptable for me. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- fs_native.c 13 Oct 2003 01:04:34 -0000 1.19 +++ fs_native.c 15 Oct 2003 18:00:54 -0000 1.20 @@ -363,7 +363,6 @@ native_i_new(struct filesys *fs, struct nino->ni_fpos = 0; ino = _sysio_i_new(fs, - buf->st_ino, &nino->ni_fileid, #ifndef AUTOMOUNT_FILE_NAME buf->st_mode & S_IFMT, @@ -606,7 +605,7 @@ native_iget(struct filesys *fs, #endif fileid.fid_data = &ident; fileid.fid_len = sizeof(ident); - ino = _sysio_i_find(fs, stbuf.st_ino, &fileid); + ino = _sysio_i_find(fs, &fileid); if (ino && forced) { /* * Insertion was forced but it's already present! |
From: Lee W. <lw...@us...> - 2003-10-15 18:01:02
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv9577/src Modified Files: inode.c Log Message: Eliminated the i-node number field from the inode structure. We already carry the file identifier so it was redundant. Problematic too, in that it can be 32 or 64 bits in size. This forced _sysio_i_new() and _sysio_i_find() to change -- They no longer take the i-node number as an argument. Updated the driver calls to reflect the new usage. The i-node cache is now indexed by hashing the file identifier as opposed to just using the, no longer maintained, i-node number. This caused _sysio_i_find to become 2+ percent more expensive to use. Acceptable for me. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -b -B -p -r1.10 -r1.11 --- inode.c 8 Sep 2003 15:43:21 -0000 1.10 +++ inode.c 15 Oct 2003 18:00:57 -0000 1.11 @@ -171,6 +171,23 @@ i_reclaim() max_inodes += t; } +static unsigned +hash(struct file_identifier *fid) +{ + size_t n; + void *p; + unsigned hkey; + + n = fid->fid_len; + p = fid->fid_data; + hkey = 0; + do { + hkey <<= 1; + hkey += *(unsigned char *)p++; + } while (--n); + return hkey; +} + /* * Allocate and initialize a new i-node. Returned i-node is referenced. * @@ -179,7 +196,6 @@ i_reclaim() */ struct inode * _sysio_i_new(struct filesys *fs, - ino_t inum, struct file_identifier *fid, mode_t type, dev_t rdev, @@ -217,10 +233,10 @@ _sysio_i_new(struct filesys *fs, ino->i_ops.inop_datasync = o->inop_datasync; ino->i_ops.inop_ioctl = o->inop_ioctl; } - I_INIT(ino, fs, inum, type, rdev, &ino->i_ops, fid, immunity, private); + I_INIT(ino, fs, type, rdev, &ino->i_ops, fid, immunity, private); ino->i_ref = 1; TAILQ_INSERT_TAIL(&_sysio_inodes, ino, i_nodes); - head = &fs->fs_itbl[inum % FS_ITBLSIZ]; + head = &fs->fs_itbl[hash(fid) % FS_ITBLSIZ]; LIST_INSERT_HEAD(head, ino, i_link); n_inodes++; @@ -234,18 +250,17 @@ _sysio_i_new(struct filesys *fs, * and identifier. */ struct inode * -_sysio_i_find(struct filesys *fs, ino_t inum, struct file_identifier *fid) +_sysio_i_find(struct filesys *fs, struct file_identifier *fid) { struct inode *ino; struct itable_entry *head; - head = &fs->fs_itbl[inum % FS_ITBLSIZ]; + head = &fs->fs_itbl[hash(fid) % FS_ITBLSIZ]; /* * Look for existing. */ for (ino = head->lh_first; ino; ino = ino->i_link.le_next) - if (ino->i_num == inum && - ino->i_fid->fid_len == fid->fid_len && + if (ino->i_fid->fid_len == fid->fid_len && memcmp(ino->i_fid->fid_data, fid->fid_data, fid->fid_len) == 0) { |
From: Lee W. <lw...@us...> - 2003-10-15 18:01:01
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv9577/include Modified Files: inode.h Log Message: Eliminated the i-node number field from the inode structure. We already carry the file identifier so it was redundant. Problematic too, in that it can be 32 or 64 bits in size. This forced _sysio_i_new() and _sysio_i_find() to change -- They no longer take the i-node number as an argument. Updated the driver calls to reflect the new usage. The i-node cache is now indexed by hashing the file identifier as opposed to just using the, no longer maintained, i-node number. This caused _sysio_i_find to become 2+ percent more expensive to use. Acceptable for me. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- inode.h 13 Oct 2003 01:04:35 -0000 1.11 +++ inode.h 15 Oct 2003 18:00:56 -0000 1.12 @@ -134,7 +134,6 @@ struct inode { i_immune : 1, /* immune from GC */ i_zombie : 1; /* stale inode */ unsigned i_ref; /* soft ref counter */ - ino_t i_num; /* i-num (deprecate!) */ mode_t i_mode; /* mode (see stat.h) */ dev_t i_rdev; /* dev (if device) */ struct inode_ops i_ops; /* operations */ @@ -147,12 +146,11 @@ struct inode { /* * Init an i-node record. */ -#define I_INIT(ino, fs, inum, mode, rdev, ops, fid, immunity, private) \ +#define I_INIT(ino, fs, mode, rdev, ops, fid, immunity, private) \ do { \ (ino)->i_immune = (immunity) ? 1 : 0; \ (ino)->i_zombie = 0; \ (ino)->i_ref = 0; \ - (ino)->i_num = (inum); \ (ino)->i_mode = (mode); \ (ino)->i_rdev = (rdev); \ (ino)->i_ops = *(ops); \ @@ -403,7 +401,6 @@ extern TAILQ_HEAD(pnodes_head, pnode) _s extern int _sysio_i_init(void); extern struct inode *_sysio_i_new(struct filesys *fs, - ino_t ino, struct file_identifier *fid, mode_t type, dev_t rdev, @@ -411,7 +408,6 @@ extern struct inode *_sysio_i_new(struct struct inode_ops *ops, void *private); extern struct inode *_sysio_i_find(struct filesys *fs, - ino_t ino, struct file_identifier *fid); extern void _sysio_i_gone(struct inode *ino); extern void _sysio_i_undead(struct inode *ino); |