libsysio-commit Mailing List for libsysio (Page 43)
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-09-26 21:28:49
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv12723/drivers/native Modified Files: Tag: RedStorm fs_native.c Log Message: Merged with current head. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.11.4.6 retrieving revision 1.11.4.7 diff -u -w -b -B -p -r1.11.4.6 -r1.11.4.7 --- fs_native.c 4 Aug 2003 15:37:05 -0000 1.11.4.6 +++ fs_native.c 26 Sep 2003 21:28:34 -0000 1.11.4.7 @@ -120,9 +120,19 @@ do { (dest)->st_gen = (src)->st_gen; \ } while (0); +/* SYS_lseek has a different interface on alpha + */ +#define CALL_LSEEK(fd, off, rc, wh) \ + (rc = syscall(SYS_lseek, fd, off, wh)) + #else + #define __native_stat intnl_stat #define COPY_STAT(src, dest) *(dest) = *(src) + +#define CALL_LSEEK(fd, off, rc, wh) \ + (syscall(SYS_lseek, fd, off, &rc, wh)) + #endif #if defined(USE_NATIVE_STAT) @@ -137,6 +147,12 @@ do { #define __SYS_FTRUNCATE SYS_ftruncate64 #endif +#if defined(USE_NATIVE_FDATASYNC) +#define __SYS_FDATASYNC SYS_osf_fdatasync +#else +#define __SYS_FDATASYNC SYS_fdatasync +#endif + #if defined(USE_NATIVE_UTIME) #define __SYS_UTIME SYS_utimes #else @@ -295,10 +311,12 @@ static int native_fstat(int fd, struct intnl_stat *buf) { int err; + struct __native_stat stbuf; - err = syscall(__SYS_FSTAT, fd, buf); + err = syscall(__SYS_FSTAT, fd, &stbuf); if (err) err = -errno; + COPY_STAT(&stbuf, buf); return err; } @@ -506,24 +524,24 @@ native_fsswop_mount(const char *source, } static int -native_i_validate(struct inode *inop, struct intnl_stat stbuf) +native_i_invalid(struct inode *inop, struct intnl_stat stbuf) { /* * Validate passed in inode against stat struct info */ struct native_inode *nino = I2NI(inop); - if ((nino->ni_ident.dev == stbuf.st_dev && - nino->ni_ident.ino == stbuf.st_ino && + if ((nino->ni_ident.dev != stbuf.st_dev || + nino->ni_ident.ino != stbuf.st_ino || #ifdef HAVE_GENERATION - nino->ni_ident.gen == stbuf.st_gen && + nino->ni_ident.gen != stbuf.st_gen || #endif - ((inop)->i_mode & stbuf.st_mode) == (inop)->i_mode) && - ((!(S_ISCHR((inop)->i_mode) || S_ISBLK((inop)->i_mode)) || - (inop)->i_rdev == stbuf.st_rdev))) - return 0; - + ((inop)->i_mode & S_IFMT) != (stbuf.st_mode & S_IFMT)) || + (((inop)->i_rdev != stbuf.st_rdev) && + (S_ISCHR((inop)->i_mode) || S_ISBLK((inop)->i_mode)))) return 1; + + return 0; } /* @@ -555,7 +573,7 @@ native_iget(struct filesys *fs, * Validate? */ if (*inop) { - if (!native_i_validate(*inop, stbuf)) + if (!native_i_invalid(*inop, stbuf)) return 0; /* * Invalidate. @@ -579,7 +597,7 @@ native_iget(struct filesys *fs, /* * Insertion was forced but it's already present! */ - if (native_i_validate(ino, stbuf)) { + if (native_i_invalid(ino, stbuf)) { /* * Cached inode has stale attrs * make way for the new one @@ -1055,7 +1073,7 @@ static int native_inop_unlink(struct pnode *pno) { char *path; - int err; + int err = 0; path = _sysio_pb_path(pno->p_base, '/'); if (!path) @@ -1073,7 +1091,7 @@ native_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. */ - if (!syscall(SYS_unlink, path)) + if (syscall(SYS_unlink, path) != 0) err = -errno; free(path); return err; @@ -1100,6 +1118,9 @@ doio(ssize_t (*f)(int, const struct iove #endif assert(nino->ni_fd >= 0); + + if (ioargs->ioarg_iovlen && (int )ioargs->ioarg_iovlen < 0) + return -EINVAL; /* * Get a new IO context. |
From: Lee W. <lw...@us...> - 2003-09-26 21:28:49
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1:/tmp/cvs-serv12723/drivers/incore Modified Files: Tag: RedStorm fs_incore.c Log Message: Merged with current head. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -u -w -b -B -p -r1.4.4.2 -r1.4.4.3 --- fs_incore.c 19 May 2003 14:25:24 -0000 1.4.4.2 +++ fs_incore.c 26 Sep 2003 21:28:33 -0000 1.4.4.3 @@ -1115,7 +1115,7 @@ _sysio_incore_dirop_mkdir(struct pnode * struct incore_inode *icino, *parent; ino_t inum; int err; - struct intnl_dirent *de; + struct intnl_dirent *de = NULL; struct inode *ino; ino = pno->p_parent->p_base->pb_ino; @@ -1377,7 +1377,7 @@ incore_doio(ssize_t (*f)(struct incore_i struct ioctx *ioctx; const struct iovec *iov; size_t n; - ssize_t cc; + ssize_t cc = 0; ioctx = _sysio_ioctx_new(ino, ioargs); if (!ioctx) |
From: Lee W. <lw...@us...> - 2003-09-26 21:28:49
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv12723 Modified Files: Tag: RedStorm Makefile.am README configure.in Log Message: Merged with current head. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -u -w -b -B -p -r1.7 -r1.7.6.1 --- Makefile.am 26 Mar 2003 00:00:15 -0000 1.7 +++ Makefile.am 26 Sep 2003 21:28:33 -0000 1.7.6.1 @@ -5,7 +5,15 @@ else TESTS = endif +if WITH_CPLANT_TESTS +SUBDIRS = $(TESTS) +else +if WITH_CPLANT_YOD +SUBDIRS = src drivers dev +else SUBDIRS = src drivers dev $(TESTS) +endif +endif EXTRA_DIST = Rules.make \ include/dev.h include/file.h include/fs.h include/inode.h \ @@ -16,6 +24,7 @@ really-clean: maintainer-clean -rm -rf .deps -rm -f Makefile.in \ drivers/native/Makefile.in drivers/incore/Makefile.in \ + drivers/yod/Makefile.in \ drivers/Makefile.in \ dev/stdfd/Makefile.in \ dev/Makefile.in \ Index: README =================================================================== RCS file: /cvsroot/libsysio/libsysio/README,v retrieving revision 1.2.12.2 retrieving revision 1.2.12.3 diff -u -w -b -B -p -r1.2.12.2 -r1.2.12.3 --- README 27 May 2003 13:44:30 -0000 1.2.12.2 +++ README 26 Sep 2003 21:28:33 -0000 1.2.12.3 @@ -17,8 +17,8 @@ Option --with-tests=yes will cause the t to be enabled. This is set by default; Use "no" to disable. Option --with-automount=<automount-file-name> will cause automount support -to be included. Normally, this should be set to ".mount", matching the -documentation. +to be included. If <automount-file-name> is not supplied, a default value +of ".mount" will be used, matching the Lustre documentation. To build: Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.5.6.4 retrieving revision 1.5.6.5 diff -u -w -b -B -p -r1.5.6.4 -r1.5.6.5 --- configure.in 29 Jul 2003 20:17:22 -0000 1.5.6.4 +++ configure.in 26 Sep 2003 21:28:33 -0000 1.5.6.5 @@ -20,9 +20,8 @@ AC_HEADER_STAT AC_HEADER_TIME AC_ARG_WITH(native_driver, - [ --with-native-driver build native test driver], - [ with_native_driver=${withval} - case "${withval}" in + AC_HELP_STRING([--with-native-driver],[build native test driver]), + [ case "${withval}" in yes) ;; no) ;; *) AC_MSG_ERROR(bad value ${withval} for --with-native-driver) ;; @@ -30,10 +29,9 @@ AC_ARG_WITH(native_driver, [with_native_driver=yes]) AM_CONDITIONAL(WITH_NATIVE_DRIVER, test x$with_native_driver = xyes) -AC_ARG_WITH(incore_driver, - [ --with-incore-driver build incore test driver], - [ with_incore_driver=${withval} - case "${withval}" in +AC_ARG_WITH(incore-driver, + AC_HELP_STRING([--with-incore-driver],[build incore test driver]), + [ case "${withval}" in yes) ;; no) ;; *) AC_MSG_ERROR(bad value ${withval} for --with-incore-driver) ;; @@ -42,9 +40,8 @@ AC_ARG_WITH(incore_driver, AM_CONDITIONAL(WITH_INCORE_DRIVER, test x$with_incore_driver = xyes) AC_ARG_WITH(tests, - [ --with-tests build tests], - [ with_tests=${withval} - case "${withval}" in + AC_HELP_STRING([--with-tests],[build tests]), + [ case "${withval}" in yes) ;; no) ;; *) AC_MSG_ERROR(bad value ${withval} for --with-tests) ;; @@ -53,26 +50,59 @@ AC_ARG_WITH(tests, AM_CONDITIONAL(WITH_TESTS, test x$with_tests = xyes) AC_ARG_WITH(automount, - [ --with-automount=[automount-file-name] with automounts], - with_automount=$withval, - [with_automount=]) -if test x$with_automount != x; then - AUTOMOUNT=-DAUTOMOUNT_FILE_NAME="\\\"$with_automount\\\"" -fi + AC_HELP_STRING([--with-automount@<:@=<automount-file-name>@:>@], + [with automounts @<:@<automount-file-name>=.mount@:>@]), + [ if test x${withval} = xyes; then + AUTOMOUNT=-DAUTOMOUNT_FILE_NAME="\\\".mount\\\"" + elif test x${withval} != x; then + AUTOMOUNT=-DAUTOMOUNT_FILE_NAME="\\\"${withval}\\\"" + fi]) AC_SUBST(AUTOMOUNT) -AC_ARG_WITH(stdfd_dev, - [ --with-stdfd-dev build standard file descriptors pseudo-driver], - [ with_stdfd_dev=${withval} - case "${withval}" in - yes) - ;; +AC_ARG_WITH(stdfd-dev, + AC_HELP_STRING([--with-stdfd-dev], + [build standard file descriptors pseudo-driver]), + [ case "${withval}" in + yes) ;; no) ;; *) AC_MSG_ERROR(bad value ${withval} for --with-stdfd-dev) ;; esac], [with_stdfd_dev=yes]) AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes) +AC_ARG_WITH(cplant_yod, + AC_HELP_STRING([--with-cplant-yod],[build cplant yod I/O driver]), + [ case "${withval}" in + yes) if test x${with_stdfd_dev} != xyes; then + with_stdfd_dev=yes + AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes) + fi ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-cplant-yod);; + esac], + [with_cplant_yod=no]) +AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes) + +AC_ARG_WITH(cplant_tests, + AC_HELP_STRING([--with-cplant-tests=<cplant-build-path>], + [build libsysio tests for cplant platform]), + [ case "${withval}" in + yes) AC_MSG_ERROR(need path to compiler for --with-cplant-tests);; + no) with_cplant_tests=no;; + *) CPLANT_PATH=${withval} + CC=${CPLANT_PATH}/cplant-cc + CCDEPMODE=${CC} + CPP="${CC} -E" + AC_CHECK_FILE(${CC}, + [ if test x${with_cplant_yod} != xyes; then + with_cplant_yod=yes + AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes) + fi], + [ AC_MSG_ERROR(path not found ${CC} for --with-cplant-tests) ]);; + esac], + [with_cplant_tests=no]) +AM_CONDITIONAL(WITH_CPLANT_TESTS, test x$with_cplant_tests != xno) + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. @@ -148,13 +178,15 @@ if test ${machine:0:5} = alpha && \ AC_DEFINE(ALPHA_LINUX) fi AC_MSG_RESULT($alpha_linux_env) +AM_CONDITIONAL(TEST_ALPHA_ARG, test x$alpha_linux_env = xyes) # check for 64 bit stat, fstat, truncate, ftruncate syscalls # AC_MSG_CHECKING(for 64 bit stat and truncate syscalls) AC_TRY_COMPILE([ #include <sys/stat.h> -#include <syscall.h>], +#include <syscall.h> +extern int syscall();], [char path[] = "/"; int fd = 0; struct stat buf; @@ -192,7 +224,8 @@ fi # AC_MSG_CHECKING(for utime system call) AC_TRY_COMPILE([ -#include <syscall.h>], +#include <syscall.h> +extern int syscall();], [syscall(SYS_utime);], syscall_utime_exists=yes, syscall_utime_exists=no) @@ -200,7 +233,7 @@ AC_MSG_RESULT($syscall_utime_exists) if test x$syscall_utime_exists = xno; then AC_DEFINE(USE_NATIVE_UTIME) fi -# Check for SYS_utime +# Check for __st_ino # AC_MSG_CHECKING(for __st_ino) AC_TRY_COMPILE([ |
From: Lee W. <lw...@us...> - 2003-09-17 16:33:58
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv23866 Modified Files: read.c write.c Log Message: Allan Porterfield from Cray reported that pread/pwrite and (by inspection) our derivatives updated the file pointer when IO completed. This is not correct. POSIX defines these operations such that no update should be made to that value. Fixed to comply. Index: read.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/read.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- read.c 14 Aug 2003 18:39:33 -0000 1.3 +++ read.c 17 Sep 2003 16:33:53 -0000 1.4 @@ -57,9 +57,10 @@ * Schedule asynchronous read of iovec at some file extent. */ static struct ioctx * -do_ipreadv(struct file *fil, +do_ixreadv(struct file *fil, const struct iovec *iov, size_t count, - off_t offset) + off_t offset, + void (*fcompletio)(struct ioctx *)) { struct inode *ino; int err; @@ -82,7 +83,7 @@ do_ipreadv(struct file *fil, IOARG_INIT(&ioarguments, iov, count, offset, - (void (*)(void *))_sysio_fcompletio, fil); + (void (*)(void *))fcompletio, fil); err = ino->i_ops.inop_ipreadv(fil->f_ino, &ioarguments, &ioctx); if (err) { errno = -err; @@ -106,7 +107,7 @@ ipreadv(int fd, const struct iovec *iov, return IOID_FAIL; } - ioctxp = do_ipreadv(fil, iov, count, offset); + ioctxp = do_ixreadv(fil, iov, count, offset, NULL); return ioctxp ? ioctxp->ioctx_id : IOID_FAIL; } @@ -168,7 +169,7 @@ ireadv(int fd, const struct iovec *iov, return IOID_FAIL; } - ioctxp = do_ipreadv(fil, iov, count, fil->f_pos); + ioctxp = do_ixreadv(fil, iov, count, fil->f_pos, _sysio_fcompletio); if (!ioctxp) return IOID_FAIL; return ioctxp->ioctx_id; Index: write.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/write.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- write.c 14 Aug 2003 18:39:33 -0000 1.3 +++ write.c 17 Sep 2003 16:33:54 -0000 1.4 @@ -59,9 +59,10 @@ * Schedule asynchronous write of iovec at some file extent. */ static struct ioctx * -do_ipwritev(struct file *fil, +do_ixwritev(struct file *fil, const struct iovec *iov, size_t count, - off_t offset) + off_t offset, + void (*fcompletio)(struct ioctx *)) { struct inode *ino; int err; @@ -88,7 +89,7 @@ do_ipwritev(struct file *fil, IOARG_INIT(&ioarguments, iov, count, offset, - (void (*)(void *))_sysio_fcompletio, fil); + (void (*)(void *))fcompletio, fil); err = ino->i_ops.inop_ipwritev(fil->f_ino, &ioarguments, &ioctx); if (err) { errno = -err; @@ -112,7 +113,7 @@ ipwritev(int fd, const struct iovec *iov return IOID_FAIL; } - ioctxp = do_ipwritev(fil, iov, count, offset); + ioctxp = do_ixwritev(fil, iov, count, offset, NULL); return ioctxp ? ioctxp->ioctx_id : IOID_FAIL; } @@ -174,7 +175,7 @@ iwritev(int fd, const struct iovec *iov, return IOID_FAIL; } - ioctxp = do_ipwritev(fil, iov, count, fil->f_pos); + ioctxp = do_ixwritev(fil, iov, count, fil->f_pos, _sysio_fcompletio); if (!ioctxp) return IOID_FAIL; return ioctxp->ioctx_id; |
From: Mei <me...@us...> - 2003-09-16 10:09:44
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv16195 Modified Files: Tag: b_lustre inode.c Log Message: merge Lee Ward's i_ref fix on HEAD. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -w -b -B -p -r1.7.2.2 -r1.7.2.3 --- inode.c 15 Aug 2003 07:43:15 -0000 1.7.2.2 +++ inode.c 16 Sep 2003 10:09:40 -0000 1.7.2.3 @@ -636,6 +636,30 @@ _sysio_p_find_alias(struct pnode *parent } /* + * Prune idle path base nodes freom the passed sub-tree, including the root. + */ +static void +_sysio_prune(struct pnode_base *rpb) +{ + struct pnode_base *nxtpb, *pb; + + nxtpb = rpb->pb_children.lh_first; + while ((pb = nxtpb)) { + nxtpb = pb->pb_sibs.le_next; + if (pb->pb_aliases.lh_first) + continue; + if (pb->pb_children.lh_first) { + _sysio_prune(pb); + continue; + } + _sysio_pb_gone(pb); + } + if (rpb->pb_children.lh_first) + return; + _sysio_pb_gone(rpb); +} + +/* * Prune idle nodes from the passed sub-tree, including the root. * * Returns the number of aliases on the same mount that could not be pruned. @@ -653,6 +677,10 @@ _sysio_p_prune(struct pnode *root) while ((pb = nxtpb)) { nxtpb = pb->pb_sibs.le_next; nxtpno = pb->pb_aliases.lh_first; + if (!nxtpno) { + _sysio_prune(pb); + continue; + } while ((pno = nxtpno)) { nxtpno = pno->p_links.le_next; if (pno->p_mount != root->p_mount) { @@ -694,10 +722,10 @@ _sysio_p_prune(struct pnode *root) if (_sysio_do_unmount(pno->p_mount) != 0) { P_RELE(pno); count++; - continue; } + continue; #endif - } else + } _sysio_p_gone(pno); } } @@ -712,9 +740,9 @@ _sysio_p_prune(struct pnode *root) /* * All that is left is the root. Try for it too. */ - if (root->p_ref) + if (root->p_ref) { count++; - else if (root->p_mount->mnt_root == root) { + } else if (root->p_mount->mnt_root == root) { #ifndef AUTOMOUNT_FILE_NAME count++; #else |
From: Sonja T. <so...@us...> - 2003-09-09 16:13:07
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1:/tmp/cvs-serv17889/tests Modified Files: Tag: cplant test_stats.pl Log Message: Removing vfsstats comparison for Cplant Index: test_stats.pl =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.pl,v retrieving revision 1.2.6.2 retrieving revision 1.2.6.3 diff -u -w -b -B -p -r1.2.6.2 -r1.2.6.3 --- test_stats.pl 28 Aug 2003 13:38:08 -0000 1.2.6.2 +++ test_stats.pl 9 Sep 2003 16:13:02 -0000 1.2.6.3 @@ -19,9 +19,9 @@ sub usage { print "Usage ./test_stats.pl file : Verifies that the set of stat calls (stat, \n"; print " : fstat, fstatvfs, statvfs) return the same set\n"; - print " : of stats for file and that the calls return the\n"; - print " : same items as Perl's stat call (which would use\n"; - print " : a native library and not libsysio)\n"; + print " : of stats for file and that the calls return \n"; + print " : the same items as Perl's stat call (which \n"; + print " : would use a native library and not libsysio)\n"; exit(-1); } @@ -136,11 +136,9 @@ $testdir =~ s/\/\w+.pl$//; helper::send_cmd($cmdfh, $outfh, "stat", $cmdstr); helper::verify_cmd($cmdfh, $outfh, "stat"); - #if ($is_alpha == 0) { # Now print the buffer out and verify that it matches # what Perl has verify_stat($cmdfh, $outfh, "stat", $is_alpha, @stats); - #} # Open the file $cmdstr = '$fd = CALL open '."$file O_RDONLY\n"; @@ -208,12 +206,17 @@ $testdir =~ s/\/\w+.pl$//; } my $i=0; + # Stupid hack. statvfs on Cplant is unhappy :-( + # Rather than do the honest thing and just continue to report its unhappiness, + # don't test for its happiness + if ( $is_alpha == 0) { foreach my $stat1 (@vfsstats1) { if ($stat1 ne $vfsstats2[$i++]) { my $str = sprintf("vfsstats field %d are not equal (%s != %s)\n", $i-1, $stat1, $vfsstats2[$i-1]); helper::print_and_exit($cmdfh, $outfh, 1, $str); } + } } helper::print_and_exit($cmdfh, $outfh, 0, "stat test successful\n"); |
From: Lee W. <lw...@us...> - 2003-09-09 04:23:31
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv19786/src Modified Files: inode.c Log Message: Jim Schutt found a bug where orphaned path base nodes were not being reclaimed. This would manifest itself with an abort on a busy inode during FS unmount. He presented it this way... ./test_copy -r /tmp/jaschut tst.dat tst2.dat I altered _sysio_p_prune to check for path base nodes that have no aliases. If found, a new routine called _sysio_prune is called. This just descends the given sub-tree releasing orphaned path-base nodes. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- inode.c 26 Aug 2003 15:53:59 -0000 1.9 +++ inode.c 8 Sep 2003 15:43:21 -0000 1.10 @@ -606,6 +606,30 @@ _sysio_p_find_alias(struct pnode *parent } /* + * Prune idle path base nodes freom the passed sub-tree, including the root. + */ +static void +_sysio_prune(struct pnode_base *rpb) +{ + struct pnode_base *nxtpb, *pb; + + nxtpb = rpb->pb_children.lh_first; + while ((pb = nxtpb)) { + nxtpb = pb->pb_sibs.le_next; + if (pb->pb_aliases.lh_first) + continue; + if (pb->pb_children.lh_first) { + _sysio_prune(pb); + continue; + } + _sysio_pb_gone(pb); + } + if (rpb->pb_children.lh_first) + return; + _sysio_pb_gone(rpb); +} + +/* * Prune idle nodes from the passed sub-tree, including the root. * * Returns the number of aliases on the same mount that could not be pruned. @@ -623,6 +647,10 @@ _sysio_p_prune(struct pnode *root) while ((pb = nxtpb)) { nxtpb = pb->pb_sibs.le_next; nxtpno = pb->pb_aliases.lh_first; + if (!nxtpno) { + _sysio_prune(pb); + continue; + } while ((pno = nxtpno)) { nxtpno = pno->p_links.le_next; if (pno->p_mount != root->p_mount) { @@ -664,10 +692,10 @@ _sysio_p_prune(struct pnode *root) if (_sysio_do_unmount(pno->p_mount) != 0) { P_RELE(pno); count++; - continue; } + continue; #endif - } else + } _sysio_p_gone(pno); } } @@ -682,9 +710,9 @@ _sysio_p_prune(struct pnode *root) /* * All that is left is the root. Try for it too. */ - if (root->p_ref) + if (root->p_ref) { count++; - else if (root->p_mount->mnt_root == root) { + } else if (root->p_mount->mnt_root == root) { #ifndef AUTOMOUNT_FILE_NAME count++; #else |
From: Mei <me...@us...> - 2003-09-08 03:58:23
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv21121/src Modified Files: Tag: b_lustre bypass.c file.c read.c write.c Log Message: - make possible return real fd number when allocation file structure - make socket driver use above - temporarily disable entry/leave checkpoint because of re-entranc problem, which introduced by socket driver. later reorganize it. - disable bypass read/write, but keep bypass_fcntl - related fixes in read/write Index: bypass.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/Attic/bypass.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -w -b -B -p -r1.1.2.2 -r1.1.2.3 --- bypass.c 19 Jun 2003 12:24:30 -0000 1.1.2.2 +++ bypass.c 8 Sep 2003 03:58:17 -0000 1.1.2.3 @@ -18,6 +18,7 @@ #include "bypass.h" +#if 0 ioid_t __bypass_ireadv(int fd, const struct iovec *iov, int count) { struct ioctx *ioctx; @@ -91,6 +92,7 @@ ioid_t __bypass_pwritev(int fd, const st return __bypass_iwritev(fd, iov, count); } +#endif int __bypass_fcntl(int fd, int cmd, va_list ap) { Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.4.8.1 retrieving revision 1.4.8.2 diff -u -w -b -B -p -r1.4.8.1 -r1.4.8.2 --- file.c 15 Aug 2003 07:43:15 -0000 1.4.8.1 +++ file.c 8 Sep 2003 03:58:17 -0000 1.4.8.2 @@ -41,6 +41,7 @@ * le...@sa... */ +#include <unistd.h> #include <stdlib.h> #include <assert.h> #include <errno.h> @@ -58,8 +59,38 @@ /* * The open files table and it's size. */ -static struct file **_sysio_oftab = NULL; -static size_t _sysio_oftab_size = 0; +typedef struct oftab { + struct file **table; + size_t size; + int offset; + int max; +} oftab_t; + +#define OFTAB_LOW (0) +#define OFTAB_HIGH (1) + +#define OFTAB_OFLIMIT (0x7FFFFFFF) +static oftab_t _sysio_oftab[2] = { {NULL, 0, 0, 0}, {NULL, 0, 0, OFTAB_OFLIMIT} }; + +static int native_max_fds = 0; + +static inline void init_oftab() +{ + if (!native_max_fds) { + native_max_fds = sysconf(_SC_OPEN_MAX); + if (native_max_fds < 0) { + printf("Fail to get _SC_OPEN_MAX\n"); + exit(-1); + } + _sysio_oftab[OFTAB_LOW].max = native_max_fds - 1; + _sysio_oftab[OFTAB_HIGH].offset = native_max_fds; + } +} + +static inline oftab_t *select_oftab(int fd) +{ + return & _sysio_oftab[fd >= native_max_fds || fd < 0]; +} /* * Create and initialize open file record. @@ -113,12 +144,14 @@ _sysio_fcompletio(struct ioctx *ioctx) * Grow (or truncate) the file descriptor table. */ static int -fd_grow(size_t n) +fd_grow(oftab_t *oftab, size_t n) { int fd; size_t count; struct file **noftab, **filp; + n++; /* index -> size */ + /* * Sanity check the new size. */ @@ -126,19 +159,24 @@ fd_grow(size_t n) if ((size_t )fd != n) return -EMFILE; + if (n > oftab->max) + return -ERANGE; + if (n < 8) n = 8; - if (n >= _sysio_oftab_size && n - _sysio_oftab_size < _sysio_oftab_size) + if (oftab->size == 0) + n += 8; + else if (n >= oftab->size && n - oftab->size < oftab->size) n = (n + 1) * 2; - noftab = realloc(_sysio_oftab, n * sizeof(struct file *)); + noftab = realloc(oftab->table, n * sizeof(struct file *)); if (!noftab) return -ENOMEM; - _sysio_oftab = noftab; - count = _sysio_oftab_size; - _sysio_oftab_size = n; + oftab->table = noftab; + count = oftab->size; + oftab->size = n; if (n < count) return 0; - filp = _sysio_oftab + count; + filp = oftab->table + count; n -= count; while (n--) *filp++ = NULL; @@ -146,28 +184,58 @@ fd_grow(size_t n) } /* - * Find a free slot in the open files table. + * target < 0: Find a free slot in the open files table. + * target >= 0: get slot [target] */ static int -find_free_fildes() +find_free_fildes(oftab_t *oftab, int target) { - size_t n; + int n; int err; struct file **filp; - for (n = 0, filp = _sysio_oftab; - n < _sysio_oftab_size && *filp; + if (target < 0) { + for (n = 0, filp = oftab->table; + n < oftab->size && *filp; n++, filp++) ; - if (n >= _sysio_oftab_size) { - err = fd_grow(n); + } else + n = target - oftab->offset; + + if (n >= oftab->size) { + err = fd_grow(oftab, n); if (err) return err; - filp = &_sysio_oftab[n]; + filp = &oftab->table[n]; assert(!*filp); } - return n; + return oftab->offset + n; +} + +/* + * Find open file record from file descriptor, clear this entry + * if clear is non-0. + */ +static struct file *__sysio_fd_get(int fd, int clear) +{ + oftab_t *oftab; + struct file *file; + + init_oftab(); + + if (fd < 0) + return NULL; + + oftab = select_oftab(fd); + if (!oftab->table || fd >= oftab->offset + oftab->size) + return NULL; + + file = oftab->table[fd - oftab->offset]; + if (clear) + oftab->table[fd - oftab->offset] = NULL; + + return file; } /* @@ -176,10 +244,7 @@ find_free_fildes() struct file * _sysio_fd_find(int fd) { - if (fd < 0 || (unsigned )fd >= _sysio_oftab_size) - return NULL; - - return _sysio_oftab[fd]; + return __sysio_fd_get(fd, 0); } /* @@ -190,12 +255,10 @@ _sysio_fd_close(int fd) { struct file *fil; - fil = _sysio_fd_find(fd); + fil = __sysio_fd_get(fd, 1); if (!fil) return -EBADF; - _sysio_oftab[fd] = NULL; - F_RELE(fil); return 0; @@ -210,33 +273,30 @@ _sysio_fd_set(struct file *fil, int fd) { int err; struct file *ofil; + oftab_t *oftab; + + init_oftab(); + + oftab = select_oftab(fd); /* * New fd < 0 => any available descriptor. */ - if (fd < 0) { - fd = find_free_fildes(); + fd = find_free_fildes(oftab, fd); if (fd < 0) return fd; - } - if ((unsigned )fd >= _sysio_oftab_size) { - err = fd_grow(fd); - if (err) - return err; - } + assert(fd < oftab->offset + oftab->size); /* * Remember old. */ - ofil = _sysio_fd_find(fd); - /* - * Take the entry. - */ - _sysio_oftab[fd] = fil; + ofil = __sysio_fd_get(fd, 1); if (ofil) F_RELE(ofil); + oftab->table[fd - oftab->offset] = fil; + return fd; } @@ -252,6 +312,8 @@ _sysio_fd_dup2(int oldfd, int newfd) struct file *fil; int err; + init_oftab(); + if (oldfd == newfd) return 0; @@ -259,6 +321,10 @@ _sysio_fd_dup2(int oldfd, int newfd) if (!fil) return -EBADF; + /* old & new must belong to the same oftab */ + if (select_oftab(oldfd) != select_oftab(newfd)) + return -EINVAL; + err = _sysio_fd_set(fil, newfd); if (!err) F_REF(fil); @@ -270,17 +336,24 @@ _sysio_fd_close_all() { int fd; struct file **filp; + oftab_t *oftab; + int i; + /* * Close all open descriptors. + * XXX only close the upper part of open files. */ - for (fd = 0, filp = _sysio_oftab; - (size_t )fd < _sysio_oftab_size; + for (i = 1; i >= 1; i--) { + oftab = &_sysio_oftab[i]; + for (fd = 0, filp = oftab->table; + (size_t )fd < oftab->size; fd++, filp++) { if (!*filp) continue; F_RELE(*filp); *filp = NULL; + } } /* Index: read.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/read.c,v retrieving revision 1.2.8.6 retrieving revision 1.2.8.7 diff -u -w -b -B -p -r1.2.8.6 -r1.2.8.7 --- read.c 18 Aug 2003 13:56:04 -0000 1.2.8.6 +++ read.c 8 Sep 2003 03:58:17 -0000 1.2.8.7 @@ -56,7 +56,6 @@ #include "sysio.h" #include "file.h" #include "inode.h" -#include "bypass.h" /* * Schedule asynchronous read of iovec at some file extent. @@ -109,9 +108,9 @@ ipreadv(int fd, const struct iovec *iov, fil = _sysio_fd_find(fd); if (!fil) { - rc = __bypass_preadv(fd, iov, count, offset); + errno = -EBADF; SYSIO_LEAVE; - return rc; + return IOID_FAIL; } ioctxp = do_ipreadv(fil, iov, count, offset); @@ -176,9 +175,9 @@ ireadv(int fd, const struct iovec *iov, fil = _sysio_fd_find(fd); if (!fil) { - rc = __bypass_ireadv(fd, iov, count); + errno = -EBADF; SYSIO_LEAVE; - return rc; + return IOID_FAIL; } ioctxp = do_ipreadv(fil, iov, count, fil->f_pos); Index: write.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/write.c,v retrieving revision 1.2.10.6 retrieving revision 1.2.10.7 diff -u -w -b -B -p -r1.2.10.6 -r1.2.10.7 --- write.c 18 Aug 2003 13:56:04 -0000 1.2.10.6 +++ write.c 8 Sep 2003 03:58:17 -0000 1.2.10.7 @@ -57,7 +57,6 @@ #include "inode.h" #include "fs.h" #include "mount.h" -#include "bypass.h" /* * Schedule asynchronous write of iovec at some file extent. @@ -114,9 +113,9 @@ ipwritev(int fd, const struct iovec *iov fil = _sysio_fd_find(fd); if (!fil) { - rc = __bypass_pwritev(fd, iov, count, offset); + errno = -EBADF; SYSIO_LEAVE; - return rc; + return IOID_FAIL; } ioctxp = do_ipwritev(fil, iov, count, offset); @@ -180,9 +179,9 @@ iwritev(int fd, const struct iovec *iov, fil = _sysio_fd_find(fd); if (!fil) { - rc = __bypass_iwritev(fd, iov, count); + errno = -EBADF; SYSIO_LEAVE; - return rc; + return IOID_FAIL; } ioctxp = do_ipwritev(fil, iov, count, fil->f_pos); |
From: Mei <me...@us...> - 2003-09-08 03:58:23
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv21121/include Modified Files: Tag: b_lustre bypass.h sysio.h Log Message: - make possible return real fd number when allocation file structure - make socket driver use above - temporarily disable entry/leave checkpoint because of re-entranc problem, which introduced by socket driver. later reorganize it. - disable bypass read/write, but keep bypass_fcntl - related fixes in read/write Index: bypass.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/Attic/bypass.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -w -b -B -p -r1.1.2.1 -r1.1.2.2 --- bypass.h 19 Jun 2003 12:18:28 -0000 1.1.2.1 +++ bypass.h 8 Sep 2003 03:58:16 -0000 1.1.2.2 @@ -20,10 +20,12 @@ #define DEBUG(fmt, arg...) do{}while(0) #endif /* __LIBSYSIO_DEBUG__ */ +#if 0 ioid_t __bypass_ireadv(int fd, const struct iovec *iov, int count); ioid_t __bypass_preadv(int fd, const struct iovec *iov, int count, off_t offset); ioid_t __bypass_iwritev(int fd, const struct iovec *iov, int count); ioid_t __bypass_pwritev(int fd, const struct iovec *iov, int count, off_t offset); +#endif int __bypass_fcntl(int fd, int cmd, va_list ap); #endif /* __LIBSYSIO_BYPASS_H_ */ Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.7.4.3 retrieving revision 1.7.4.4 diff -u -w -b -B -p -r1.7.4.3 -r1.7.4.4 --- sysio.h 18 Aug 2003 13:56:04 -0000 1.7.4.3 +++ sysio.h 8 Sep 2003 03:58:17 -0000 1.7.4.4 @@ -197,6 +197,12 @@ typedef void __sysio_hook_func(void); extern __sysio_hook_func *__sysio_hook_sys_enter; extern __sysio_hook_func *__sysio_hook_sys_leave; +#if 1 +/* XXX temprarily disabled for the re-entrance problem */ +#define SYSIO_ENTER +#define SYSIO_LEAVE + +#else #define SYSIO_ENTER \ do { \ if (__sysio_hook_sys_enter) \ @@ -207,8 +213,9 @@ extern __sysio_hook_func *__sysio_hook_s #define SYSIO_LEAVE \ do { \ - if (--__sysio_in_syscall != 0) \ - abort(); \ if (__sysio_hook_sys_leave) \ __sysio_hook_sys_leave(); \ + if (--__sysio_in_syscall != 0) \ + abort(); \ } while(0) +#endif |
From: Mei <me...@us...> - 2003-09-08 03:52:33
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1:/tmp/cvs-serv20406/tests Modified Files: Tag: b_lustre Makefile.am Log Message: add Lee's socket driver, with: - use real fd number to _sysio_fd_set() - disable bind(),listen()... - build fix in tests Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.8.4.1 retrieving revision 1.8.4.2 diff -u -w -b -B -p -r1.8.4.1 -r1.8.4.2 --- Makefile.am 15 Aug 2003 07:43:15 -0000 1.8.4.1 +++ Makefile.am 8 Sep 2003 03:52:28 -0000 1.8.4.2 @@ -41,7 +41,15 @@ YOD_DRIVER_NAME= YOD_DRIVER_CFLAGS= endif -DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(YOD_DRIVER_NAME) $(STFD_DEV_NAME) +if WITH_SOCKETS +SOCKETS_DRIVER_NAME=sockets +SOCKETS_DRIVER_LIB= $(top_builddir)/drivers/sockets/libsysio_sockets.a +else +SOCKETS_DRIVER_NAME= +SOCKETS_DRIVER_LIB= +endif + +DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(YOD_DRIVER_NAME) $(STFD_DEV_NAME) $(SOCKETS_DRIVER_NAME) CMNSRC=drv_init_all.c drv_data.c @@ -54,6 +62,7 @@ CFL=$(AM_CFLAGS) $(AM_CPPFLAGS) \ LIBS=$(NATIVE_DRIVER_LIB) $(INCORE_DRIVER_LIB) \ $(STDFD_DEV_LIB) $(YOD_DRIVER_LIB) \ + $(SOCKETS_DRIVER_LIB) \ $(top_builddir)/src/libsysio.a test_copy_SOURCES=test_copy.c $(CMNSRC) |
From: Mei <me...@us...> - 2003-09-08 03:52:33
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1:/tmp/cvs-serv20406/drivers/sockets Added Files: Tag: b_lustre sockets.c Makefile.am Log Message: add Lee's socket driver, with: - use real fd number to _sysio_fd_set() - disable bind(),listen()... - build fix in tests --- 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... */ #ifdef __linux__ #define _BSD_SOURCE #endif #include <stdio.h> /* for NULL */ #include <stdlib.h> #ifdef __linux__ #include <string.h> #endif #include <unistd.h> #include <errno.h> #include <assert.h> #include <syscall.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> #include <sys/queue.h> #include <sys/syscall.h> #include <sys/socket.h> #include <linux/net.h> #include "sysio.h" #include "fs.h" #include "inode.h" #include "file.h" #include "dev.h" /* _sysio_nodev_ops */ /* * Sockets interface driver */ /* * Sockets file identifiers format. */ struct sockets_ino_identifier { ino_t inum; /* i-number */ }; /* * Driver-private i-node information we keep about in-use sockets. */ struct socket_info { struct sockets_ino_identifier ski_ident; /* unique identifier */ struct file_identifier ski_fileid; /* ditto */ int ski_fd; /* host fildes */ }; static int sockets_inop_close(struct inode *ino); static int sockets_inop_ipreadv(struct inode *ino, struct io_arguments *ioargs, struct ioctx **ioctxp); static int sockets_inop_ipwritev(struct inode *ino, struct io_arguments *ioargs, struct ioctx **ioctxp); static int sockets_inop_iodone(struct ioctx *ioctx); static int sockets_inop_sync(struct inode *ino); static int sockets_inop_datasync(struct inode *ino); static int sockets_inop_fcntl(struct inode *ino, int cmd, va_list ap); static int sockets_inop_ioctl(struct inode *ino, unsigned long int request, va_list ap); static void sockets_inop_gone(struct inode *ino); static void sockets_illop(void); /* * Given i-node, return driver private part. */ #define I2SKI(ino) ((struct socket_info *)((ino)->i_private)) struct filesys_ops sockets_filesys_ops = { (void (*)(struct filesys *))sockets_illop }; static struct filesys *sockets_fs; static struct inode_ops sockets_i_ops; /* * Initialize this driver. */ int _sysio_sockets_init() { sockets_i_ops = _sysio_nodev_ops; sockets_i_ops.inop_close = sockets_inop_close; sockets_i_ops.inop_ipreadv = sockets_inop_ipreadv; sockets_i_ops.inop_ipwritev = sockets_inop_ipwritev; sockets_i_ops.inop_iodone = sockets_inop_iodone; sockets_i_ops.inop_fcntl = sockets_inop_fcntl; sockets_i_ops.inop_sync = sockets_inop_sync; sockets_i_ops.inop_datasync = sockets_inop_datasync; sockets_i_ops.inop_ioctl = sockets_inop_ioctl; sockets_i_ops.inop_gone = sockets_inop_gone; sockets_fs = _sysio_fs_new(&sockets_filesys_ops, 0, NULL); if (!sockets_fs) return -ENOMEM; return 0; } static int sockets_inop_close(struct inode *ino) { struct socket_info *ski = I2SKI(ino); int err; if (ski->ski_fd < 0) return -EBADF; err = syscall(SYS_close, ski->ski_fd); if (err) return -errno; ski->ski_fd = -1; return 0; } /* * A helper function performing the real IO operation work. * * We don't really have async IO. We'll just perform the function * now. */ static int doio(ssize_t (*f)(int, const struct iovec *, int), struct inode *ino, struct io_arguments *ioargs, struct ioctx **ioctxp) { struct socket_info *ski = I2SKI(ino); struct ioctx *ioctx; assert(ski->ski_fd >= 0); if (ioargs->ioarg_iovlen && (int )ioargs->ioarg_iovlen < 0) return -EINVAL; /* * Get a new IO context. */ ioctx = _sysio_ioctx_new(ino, ioargs); if (!ioctx) return -ENOMEM; /* * Call the appropriate (read/write) IO function to * transfer the data now. */ ioctx->ioctx_cc = (*f)(ski->ski_fd, ioctx->ioctx_iovec, ioctx->ioctx_iovlen); if (ioctx->ioctx_cc < 0) ioctx->ioctx_errno = errno; *ioctxp = ioctx; return 0; } /* * Helper function passed to doio(), above, to accomplish a real readv. */ static ssize_t _readv(int fd, const struct iovec *vector, int count) { return syscall(SYS_readv, fd, vector, count); } static int sockets_inop_ipreadv(struct inode *ino, struct io_arguments *ioargs, struct ioctx **ioctxp) { return doio(_readv, ino, ioargs, ioctxp); } /* * Helper function passed to doio(), above, to accomplish a real writev. */ static ssize_t _writev(int fd, const struct iovec *vector, int count) { return syscall(SYS_writev, fd, vector, count); } static int sockets_inop_ipwritev(struct inode *ino, struct io_arguments *ioargs, struct ioctx **ioctxp) { return doio(_writev, ino, ioargs, ioctxp); } static int sockets_inop_iodone(struct ioctx *ioctxp __IS_UNUSED) { /* * It's always done in this driver. It completed when posted. */ return 1; } static int sockets_inop_fcntl(struct inode *ino __IS_UNUSED, int cmd __IS_UNUSED, va_list ap __IS_UNUSED) { /* * I'm lazy. Maybe implemented later. */ return -ENOTTY; } static int sockets_inop_sync(struct inode *ino) { assert(I2SKI(ino)->ski_fd >= 0); return syscall(SYS_fsync, I2SKI(ino)->ski_fd); } static int sockets_inop_datasync(struct inode *ino) { assert(I2SKI(ino)->ski_fd >= 0); return syscall(SYS_fdatasync, I2SKI(ino)->ski_fd); } static int sockets_inop_ioctl(struct inode *ino __IS_UNUSED, unsigned long int request __IS_UNUSED, va_list ap __IS_UNUSED) { /* * I'm lazy. Maybe implemented later. */ return -ENOTTY; } static void sockets_inop_gone(struct inode *ino) { (void )sockets_inop_close(ino); free(ino->i_private); } static void sockets_illop(void) { abort(); } static struct inode * _sysio_sockets_inew() { static ino_t inum = 1; struct socket_info *ski; struct inode *ino; ski = malloc(sizeof(struct socket_info)); if (!ski) return NULL; ski->ski_ident.inum = inum++; ski->ski_fileid.fid_data = &ski->ski_ident; ski->ski_fileid.fid_len = sizeof(ski->ski_ident); ski->ski_fd = -1; ino = _sysio_i_new(sockets_fs, ski->ski_ident.inum, &ski->ski_fileid, 0, 0, 0, &sockets_i_ops, ski); if (!ino) free(ski); return ino; } int socket(int domain, int type, int protocol) { int err; struct inode *ino; struct socket_info *ski; unsigned long avec[3]; struct file *fil; err = 0; fil = NULL; ino = _sysio_sockets_inew(); if (!ino) { err = -ENOMEM; goto error; } avec[0] = domain; avec[1] = type; avec[2] = protocol; ski = I2SKI(ino); ski->ski_fd = syscall(SYS_socketcall, SYS_SOCKET, avec); if (ski->ski_fd < 0) { err = -errno; goto error; } fil = _sysio_fnew(ino, O_RDWR); if (!fil) { err = -ENOMEM; goto error; } err = _sysio_fd_set(fil, ski->ski_fd); if (err < 0) goto error; return err; error: if (fil) F_RELE(fil); if (ino) I_RELE(ino); errno = -err; return -1; } int accept(int s, struct sockaddr *addr, socklen_t *addrlen) { int err; struct inode *ino; struct socket_info *ski; struct file *ofil, *nfil; unsigned long avec[3]; err = 0; nfil = NULL; ino = NULL; ofil = _sysio_fd_find(s); if (!ofil) { err = -EBADF; goto error; } ino = _sysio_sockets_inew(); if (!ino) { err = -ENOMEM; goto error; } nfil = _sysio_fnew(ino, O_RDWR); if (!nfil) { err = -ENOMEM; goto error; } avec[0] = I2SKI(ofil->f_ino)->ski_fd; avec[1] = (unsigned long )addr; avec[2] = (unsigned long )addrlen; ski = I2SKI(ino); ski->ski_fd = syscall(SYS_socketcall, SYS_ACCEPT, avec); if (ski->ski_fd < 0) { err = -errno; goto error; } err = _sysio_fd_set(nfil, ski->ski_fd); if (err < 0) goto error; return err; error: if (nfil) F_RELE(nfil); if (ino) I_RELE(ino); errno = -err; return -1; } #if 0 int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen) { int err; struct file *fil; unsigned long avec[3]; err = 0; fil = _sysio_fd_find(sockfd); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )my_addr; avec[2] = addrlen; if (syscall(SYS_socketcall, SYS_BIND, avec) != 0) { err = -errno; goto out; } return 0; out: errno = -err; return -1; } int listen(int s, int backlog) { int err; struct file *fil; unsigned long avec[2]; err = 0; fil = _sysio_fd_find(s); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = backlog; if (syscall(SYS_socketcall, SYS_LISTEN, avec) != 0) { err = -errno; goto out; } return 0; out: errno = -err; return -1; } int connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) { int err; struct file *fil; unsigned long avec[3]; err = 0; fil = _sysio_fd_find(sockfd); if (!fil) { err = -EBADF; goto out; } avec[0] = I2SKI(fil->f_ino)->ski_fd; avec[1] = (unsigned long )serv_addr; avec[2] = addrlen; if (syscall(SYS_socketcall, SYS_CONNECT, avec) != 0) { err = -errno; goto out; } return 0; out: errno = -err; return -1; } #endif --- NEW FILE --- lib_LIBRARIES = libsysio_sockets.a libsysio_sockets_a_SOURCES = sockets.c include $(top_srcdir)/Rules.make |
From: Mei <me...@us...> - 2003-09-08 03:52:33
|
Update of /cvsroot/libsysio/libsysio/drivers In directory sc8-pr-cvs1:/tmp/cvs-serv20406/drivers Modified Files: Tag: b_lustre Makefile.am Log Message: add Lee's socket driver, with: - use real fd number to _sysio_fd_set() - disable bind(),listen()... - build fix in tests Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/Makefile.am,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 --- Makefile.am 15 Aug 2003 07:43:15 -0000 1.2.4.1 +++ Makefile.am 8 Sep 2003 03:52:28 -0000 1.2.4.2 @@ -17,4 +17,10 @@ else YOD_DRIVER = endif -SUBDIRS = $(NATIVE_DRIVER) $(INCORE_DRIVER) $(YOD_DRIVER) +if WITH_SOCKETS +SOCKETS_DRIVER = sockets +else +SOCKETS_DRIVER = +endif + +SUBDIRS = $(NATIVE_DRIVER) $(INCORE_DRIVER) $(YOD_DRIVER) $(SOCKETS_DRIVER) |
From: Mei <me...@us...> - 2003-09-08 03:52:33
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv20406 Modified Files: Tag: b_lustre Rules.make configure.in Log Message: add Lee's socket driver, with: - use real fd number to _sysio_fd_set() - disable bind(),listen()... - build fix in tests Index: Rules.make =================================================================== RCS file: /cvsroot/libsysio/libsysio/Rules.make,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -u -w -b -B -p -r1.4 -r1.4.4.1 --- Rules.make 24 Mar 2003 22:06:38 -0000 1.4 +++ Rules.make 8 Sep 2003 03:52:28 -0000 1.4.4.1 @@ -5,6 +5,14 @@ else STFD_DEV_CPPFLAGS = endif +if WITH_SOCKETS +SOCKETS_CPPFLAGS=-DWITH_SOCKETS +else +SOCKETS_CPPFLAGS= +endif + DEV_CPPFLAGS = $(STDFD_DEV_CPPFLAGS) -AM_CPPFLAGS = $(AUTOMOUNT) $(DEV_CPPFLAGS) -I$(top_srcdir)/include +AM_CPPFLAGS = \ + $(AUTOMOUNT) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \ + -I$(top_srcdir)/include Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -u -w -b -B -p -r1.5.4.2 -r1.5.4.3 --- configure.in 18 Aug 2003 13:56:04 -0000 1.5.4.2 +++ configure.in 8 Sep 2003 03:52:28 -0000 1.5.4.3 @@ -102,6 +102,17 @@ AM_CONDITIONAL(WITH_CPLANT_TESTS, test x AM_CONDITIONAL(CYGWIN, test x$host_os = xcygwin) +AC_ARG_WITH(sockets, + AC_HELP_STRING([--with-sockets], + [build sockets interface driver]), + [ case "${withval}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-sockets) ;; + esac], + [with_stdfd_dev=yes]) +AM_CONDITIONAL(WITH_SOCKETS, test x$with_sockets = xyes) + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. @@ -365,6 +376,7 @@ AC_OUTPUT( drivers/native/Makefile drivers/incore/Makefile drivers/yod/Makefile + drivers/sockets/Makefile dev/Makefile dev/stdfd/Makefile tests/Makefile) |
From: Mei <me...@us...> - 2003-09-08 03:52:33
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv20406/src Modified Files: Tag: b_lustre init.c Log Message: add Lee's socket driver, with: - use real fd number to _sysio_fd_set() - disable bind(),listen()... - build fix in tests Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -u -w -b -B -p -r1.3.4.2 -r1.3.4.3 --- init.c 21 Aug 2003 07:40:43 -0000 1.3.4.2 +++ init.c 8 Sep 2003 03:52:28 -0000 1.3.4.3 @@ -67,6 +67,9 @@ int _sysio_init() { int err; +#ifdef WITH_SOCKETS + int _sysio_sockets_init(void); +#endif err = _sysio_ioctx_init(); if (err) @@ -87,6 +90,11 @@ _sysio_init() if (err) goto error; #endif +#endif +#ifdef WITH_SOCKETS + err = _sysio_sockets_init(); + if (err) + goto error; #endif goto out; |
From: Mei <me...@us...> - 2003-09-08 03:48:37
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1:/tmp/cvs-serv20139/sockets Log Message: Directory /cvsroot/libsysio/libsysio/drivers/sockets added to the repository --> Using per-directory sticky tag `b_lustre' |
From: Ruth K. <rk...@us...> - 2003-09-05 16:49:13
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv11254 Modified Files: Tag: RedStorm_merge configure.in Log Message: merge changes from Mike Levenhagen Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.5.6.4.2.1 retrieving revision 1.5.6.4.2.2 diff -u -w -b -B -p -r1.5.6.4.2.1 -r1.5.6.4.2.2 --- configure.in 5 Sep 2003 16:36:16 -0000 1.5.6.4.2.1 +++ configure.in 5 Sep 2003 16:49:08 -0000 1.5.6.4.2.2 @@ -24,8 +24,7 @@ AC_ARG_WITH(redstorm_driver, [ case "${withval}" in yes) if test x${with_stdfd_dev} != xyes; then with_stdfd_dev=yes - AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = -xyes) + AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes) fi ;; no) ;; *) AC_MSG_ERROR(bad value ${withval} for --with-redstorm-driver);; |
From: Ruth K. <rk...@us...> - 2003-09-05 16:37:20
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1:/tmp/cvs-serv8865 Added Files: Tag: RedStorm_merge .cvsignore Log Message: merge changes from Mike Levenhagen --- NEW FILE --- .deps Makefile test_copy test_getcwd test_list test_mounts test_path test_stats test_stdfd test_unlink |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:30
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1:/tmp/cvs-serv8570/tests Modified Files: Tag: RedStorm_merge drv_init_all.c test.h test_copy.c test_getcwd.c test_list.c test_mounts.c test_path.c test_stats.c test_stdfd.c Log Message: merge changes from Mike Levenhagen Index: drv_init_all.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/drv_init_all.c,v retrieving revision 1.1 retrieving revision 1.1.10.1 diff -u -w -b -B -p -r1.1 -r1.1.10.1 --- drv_init_all.c 22 Feb 2003 18:25:11 -0000 1.1 +++ drv_init_all.c 5 Sep 2003 16:36:17 -0000 1.1.10.1 @@ -1,3 +1,5 @@ +#ident "$Id$" + extern int (*drvinits[])(void); /* Index: test.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test.h,v retrieving revision 1.1 retrieving revision 1.1.10.1 diff -u -w -b -B -p -r1.1 -r1.1.10.1 --- test.h 22 Feb 2003 20:30:20 -0000 1.1 +++ test.h 5 Sep 2003 16:36:17 -0000 1.1.10.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #define DEFAULT_DRIVER "native" extern int (*drvinits[])(void); Index: test_copy.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.c,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.1.2.1 diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.1.2.1 --- test_copy.c 27 May 2003 12:58:47 -0000 1.5.6.1 +++ test_copy.c 5 Sep 2003 16:36:17 -0000 1.5.6.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #define _BSD_SOURCE #include <stdio.h> Index: test_getcwd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_getcwd.c,v retrieving revision 1.1.10.1 retrieving revision 1.1.10.1.2.1 diff -u -w -b -B -p -r1.1.10.1 -r1.1.10.1.2.1 --- test_getcwd.c 27 May 2003 12:58:47 -0000 1.1.10.1 +++ test_getcwd.c 5 Sep 2003 16:36:17 -0000 1.1.10.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdio.h> #include <stdlib.h> #include <string.h> Index: test_list.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_list.c,v retrieving revision 1.4.6.1 retrieving revision 1.4.6.1.2.1 diff -u -w -b -B -p -r1.4.6.1 -r1.4.6.1.2.1 --- test_list.c 27 May 2003 12:58:47 -0000 1.4.6.1 +++ test_list.c 5 Sep 2003 16:36:17 -0000 1.4.6.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdio.h> #include <stdlib.h> #include <string.h> Index: test_mounts.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_mounts.c,v retrieving revision 1.3.10.1 retrieving revision 1.3.10.1.2.1 diff -u -w -b -B -p -r1.3.10.1 -r1.3.10.1.2.1 --- test_mounts.c 27 May 2003 12:58:47 -0000 1.3.10.1 +++ test_mounts.c 5 Sep 2003 16:36:17 -0000 1.3.10.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdio.h> #include <stdlib.h> #include <string.h> Index: test_path.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_path.c,v retrieving revision 1.3.10.1 retrieving revision 1.3.10.1.2.1 diff -u -w -b -B -p -r1.3.10.1 -r1.3.10.1.2.1 --- test_path.c 27 May 2003 12:58:47 -0000 1.3.10.1 +++ test_path.c 5 Sep 2003 16:36:17 -0000 1.3.10.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdio.h> #include <stdlib.h> #include <string.h> Index: test_stats.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.c,v retrieving revision 1.3.10.2 retrieving revision 1.3.10.2.2.1 diff -u -w -b -B -p -r1.3.10.2 -r1.3.10.2.2.1 --- test_stats.c 27 May 2003 12:58:47 -0000 1.3.10.2 +++ test_stats.c 5 Sep 2003 16:36:17 -0000 1.3.10.2.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #define _BSD_SOURCE #include <stdio.h> Index: test_stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stdfd.c,v retrieving revision 1.2.6.1 retrieving revision 1.2.6.1.2.1 diff -u -w -b -B -p -r1.2.6.1 -r1.2.6.1.2.1 --- test_stdfd.c 27 May 2003 12:58:47 -0000 1.2.6.1 +++ test_stdfd.c 5 Sep 2003 16:36:17 -0000 1.2.6.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #if defined(__linux__) #define _BSD_SOURCE #endif |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:30
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv8570/src Modified Files: Tag: RedStorm_merge access.c chdir.c chmod.c chown.c dev.c dup.c fcntl.c file.c fs.c fsync.c getdirentries.c init.c inode.c ioctl.c ioctx.c iowait.c lseek.c mkdir.c mknod.c mount.c namei.c open.c read.c rmdir.c stat.c stat64.c statvfs.c symlink.c truncate.c unlink.c write.c Added Files: Tag: RedStorm_merge .cvsignore Log Message: merge changes from Mike Levenhagen --- NEW FILE --- .deps Makefile Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -u -w -b -B -p -r1.1.2.1 -r1.1.2.1.2.1 --- access.c 29 Jul 2003 20:17:22 -0000 1.1.2.1 +++ access.c 5 Sep 2003 16:36:17 -0000 1.1.2.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <errno.h> #include <sys/types.h> Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.3 retrieving revision 1.3.14.1 diff -u -w -b -B -p -r1.3 -r1.3.14.1 --- chdir.c 9 Mar 2003 16:57:47 -0000 1.3 +++ chdir.c 5 Sep 2003 16:36:17 -0000 1.3.14.1 @@ -63,6 +63,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <unistd.h> #include <string.h> @@ -238,7 +240,11 @@ _sysio_p_path(struct pnode *pno, char ** } char * +#if defined(BSD) || defined(REDSTORM) +__getcwd(char *buf, size_t size) +#else getcwd(char *buf, size_t size) +#endif { int err; Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- chmod.c 24 Mar 2003 22:09:06 -0000 1.3 +++ chmod.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <string.h> #include <errno.h> #include <assert.h> Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- chown.c 24 Mar 2003 22:09:06 -0000 1.3 +++ chown.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <string.h> #include <errno.h> #include <assert.h> Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.2.6.1 retrieving revision 1.2.6.1.2.1 diff -u -w -b -B -p -r1.2.6.1 -r1.2.6.1.2.1 --- dev.c 12 May 2003 11:48:45 -0000 1.2.6.1 +++ dev.c 5 Sep 2003 16:36:17 -0000 1.2.6.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <errno.h> #include <assert.h> Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.10.1 diff -u -w -b -B -p -r1.1.1.1 -r1.1.1.1.10.1 --- dup.c 22 Feb 2003 16:33:05 -0000 1.1.1.1 +++ dup.c 5 Sep 2003 16:36:17 -0000 1.1.1.1.10.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <sys/types.h> Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -u -w -b -B -p -r1.3 -r1.3.8.1 --- fcntl.c 4 Apr 2003 20:09:47 -0000 1.3 +++ fcntl.c 5 Sep 2003 16:36:17 -0000 1.3.8.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <sys/types.h> @@ -50,6 +52,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" int fcntl(int fd, int cmd, ...) @@ -95,3 +98,7 @@ out: } return err; } + +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(fcntl, _fcntl) +#endif Index: file.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/file.c,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -u -w -b -B -p -r1.4 -r1.4.6.1 --- file.c 9 Mar 2003 17:18:57 -0000 1.4 +++ file.c 5 Sep 2003 16:36:17 -0000 1.4.6.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <assert.h> #include <errno.h> Index: fs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fs.c,v retrieving revision 1.8 retrieving revision 1.8.10.1 diff -u -w -b -B -p -r1.8 -r1.8.10.1 --- fs.c 24 Apr 2003 02:15:29 -0000 1.8 +++ fs.c 5 Sep 2003 16:36:17 -0000 1.8.10.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <string.h> #include <errno.h> Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -u -w -b -B -p -r1.2 -r1.2.6.1 --- fsync.c 9 Mar 2003 06:22:43 -0000 1.2 +++ fsync.c 5 Sep 2003 16:36:17 -0000 1.2.6.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <sys/types.h> Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.1.10.2 retrieving revision 1.1.10.2.2.1 diff -u -w -b -B -p -r1.1.10.2 -r1.1.10.2.2.1 --- getdirentries.c 19 May 2003 14:05:34 -0000 1.1.10.2 +++ getdirentries.c 5 Sep 2003 16:36:17 -0000 1.1.10.2.2.1 @@ -1,3 +1,5 @@ +#ident "$Id$" + #include <stdlib.h> #ifdef __GLIBC__ #include <alloca.h> @@ -215,3 +217,6 @@ out: sysio_sym_strong_alias(getdirentries64, getdirentries) #endif +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(getdirentries, _getdirentries) +#endif Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- init.c 24 Mar 2003 22:09:06 -0000 1.3 +++ init.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <errno.h> #include <sys/types.h> Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.1.2.1 diff -u -w -b -B -p -r1.7.4.1 -r1.7.4.1.2.1 --- inode.c 29 Jul 2003 19:05:08 -0000 1.7.4.1 +++ inode.c 5 Sep 2003 16:36:17 -0000 1.7.4.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <string.h> #include <errno.h> @@ -281,7 +283,6 @@ _sysio_i_gone(struct inode *ino) void _sysio_i_undead(struct inode *ino) { - LIST_REMOVE(ino, i_link); ino->i_zombie = 1; } Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.18.1 diff -u -w -b -B -p -r1.1.1.1 -r1.1.1.1.18.1 --- ioctl.c 22 Feb 2003 16:33:07 -0000 1.1.1.1 +++ ioctl.c 5 Sep 2003 16:36:17 -0000 1.1.1.1.18.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <errno.h> #include <sys/ioctl.h> #include <sys/types.h> @@ -49,6 +51,7 @@ #include "sysio.h" #include "inode.h" #include "file.h" +#include "sysio-symbols.h" int ioctl(int fd, unsigned long request, ...) @@ -75,3 +78,7 @@ out: } return err; } + +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(ioctl, _ioctl) +#endif Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -u -w -b -B -p -r1.2 -r1.2.8.1 --- ioctx.c 7 Mar 2003 03:31:36 -0000 1.2 +++ ioctx.c 5 Sep 2003 16:36:17 -0000 1.2.8.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <string.h> #include <errno.h> Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- iowait.c 9 Mar 2003 06:25:45 -0000 1.3 +++ iowait.c 5 Sep 2003 16:36:17 -0000 1.3.6.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <errno.h> #include <sys/types.h> #include <sys/queue.h> Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.1.2.1 diff -u -w -b -B -p -r1.4.4.1 -r1.4.4.1.2.1 --- lseek.c 12 May 2003 11:48:45 -0000 1.4.4.1 +++ lseek.c 5 Sep 2003 16:36:17 -0000 1.4.4.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <errno.h> #include <unistd.h> #include <sys/types.h> Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- mkdir.c 24 Mar 2003 22:09:06 -0000 1.3 +++ mkdir.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <assert.h> Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.3.6.1 retrieving revision 1.3.6.1.2.1 diff -u -w -b -B -p -r1.3.6.1 -r1.3.6.1.2.1 --- mknod.c 12 May 2003 11:48:45 -0000 1.3.6.1 +++ mknod.c 5 Sep 2003 16:36:17 -0000 1.3.6.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #if defined(__linux__) #define _BSD_SOURCE #endif Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.5 retrieving revision 1.5.10.1 diff -u -w -b -B -p -r1.5 -r1.5.10.1 --- mount.c 18 Apr 2003 20:24:05 -0000 1.5 +++ mount.c 5 Sep 2003 16:36:17 -0000 1.5.10.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <string.h> #include <errno.h> @@ -57,6 +59,7 @@ #include "fs.h" #include "mount.h" #include "inode.h" +#include "sysio-symbols.h" /* * File system and volume mount support. @@ -270,7 +273,7 @@ _sysio_mount_root(const char *source, } int -mount(const char *source, +do_mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, @@ -357,6 +360,20 @@ out: } return err; } + +#if defined(BSD) || defined(REDSTORM) +int +mount(const char *type, + const char *dir, + int flags, + void *data) +{ + return do_mount( data, dir, type, 0, NULL ); +} + +#else +sysio_sym_weak_alias(do_mount, mount) +#endif /* * Unmount all file systems -- Usually as part of shutting everything down. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.1.2.1 diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.1.2.1 --- namei.c 29 Jul 2003 19:05:09 -0000 1.5.6.1 +++ namei.c 5 Sep 2003 16:36:17 -0000 1.5.6.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #if defined(AUTOMOUNT_FILE_NAME) && defined(__linux__) #define _BSD_SOURCE #endif Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.1.2.1 diff -u -w -b -B -p -r1.7.4.1 -r1.7.4.1.2.1 --- open.c 19 May 2003 13:51:20 -0000 1.7.4.1 +++ open.c 5 Sep 2003 16:36:17 -0000 1.7.4.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <stdlib.h> #include <string.h> #include <errno.h> @@ -55,6 +57,7 @@ #include "file.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" /* * Open file support. @@ -203,6 +206,10 @@ error: return -1; } +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(open, _open) +#endif + int close(int fd) { @@ -213,6 +220,10 @@ close(int fd) errno = -err; return err ? -1 : 0; } + +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(close, _close) +#endif int creat(const char *path, mode_t mode) Index: read.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/read.c,v retrieving revision 1.2 retrieving revision 1.2.14.1 diff -u -w -b -B -p -r1.2 -r1.2.14.1 --- read.c 9 Mar 2003 06:36:37 -0000 1.2 +++ read.c 5 Sep 2003 16:36:17 -0000 1.2.14.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <sys/types.h> @@ -52,6 +54,7 @@ #include "sysio.h" #include "file.h" #include "inode.h" +#include "sysio-symbols.h" /* * Schedule asynchronous read of iovec at some file extent. @@ -209,6 +212,10 @@ read(int fd, void *buf, size_t count) return -1; return iowait(ioid); } + +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(read, _read) +#endif #ifdef notdef int Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- rmdir.c 24 Mar 2003 22:09:06 -0000 1.3 +++ rmdir.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <assert.h> Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.3.6.2 retrieving revision 1.3.6.2.2.1 diff -u -w -b -B -p -r1.3.6.2 -r1.3.6.2.2.1 --- stat.c 19 May 2003 13:51:20 -0000 1.3.6.2 +++ stat.c 5 Sep 2003 16:36:17 -0000 1.3.6.2.2.1 @@ -41,12 +41,18 @@ * le...@sa... */ +#ident "$Id$" + #include <errno.h> #include <assert.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <sys/queue.h> +#if defined(BSD) || defined(REDSTORM) +#include <sys/param.h> +#include <sys/mount.h> +#endif #include "sysio.h" #include "inode.h" @@ -106,7 +112,10 @@ __fstat(int fd, struct stat *buf) return __fxstat(_STAT_VER, fd, buf); } +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(__fstat, _fstat) sysio_sym_weak_alias(__fstat, fstat) +#endif int __xstat(int __ver, const char *__filename, struct stat *__stat_buf) @@ -140,13 +149,21 @@ out: } int +#if defined(BSD) || defined(REDSTORM) +_stat(const char *filename, struct stat *buf) +#else __stat(const char *filename, struct stat *buf) +#endif { return __xstat(_STAT_VER, filename, buf); } +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(_stat, stat) +#else sysio_sym_weak_alias(__stat, stat) +#endif int __lxstat(int __ver, const char *__filename, struct stat *__stat_buf) Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.3.6.1 retrieving revision 1.3.6.1.2.1 diff -u -w -b -B -p -r1.3.6.1 -r1.3.6.1.2.1 --- stat64.c 12 May 2003 11:48:45 -0000 1.3.6.1 +++ stat64.c 5 Sep 2003 16:36:17 -0000 1.3.6.1.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #ifdef _LARGFILE64_SOURCE #include <errno.h> Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.3.6.1 retrieving revision 1.3.6.1.2.1 diff -u -w -b -B -p -r1.3.6.1 -r1.3.6.1.2.1 --- statvfs.c 12 May 2003 11:48:45 -0000 1.3.6.1 +++ statvfs.c 5 Sep 2003 16:36:17 -0000 1.3.6.1.2.1 @@ -41,7 +41,7 @@ * le...@sa... */ -#if !(defined(BSD) || defined(REDSTORM)) +#ident "$Id$" #include <unistd.h> #include <errno.h> @@ -138,4 +138,3 @@ err: out: return err; } -#endif /* if !(defined(BSD) || defined(REDSTORM)) */ Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- symlink.c 24 Mar 2003 22:09:07 -0000 1.3 +++ symlink.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <assert.h> Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- truncate.c 24 Mar 2003 22:09:07 -0000 1.3 +++ truncate.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <string.h> #include <errno.h> Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- unlink.c 24 Mar 2003 22:09:07 -0000 1.3 +++ unlink.c 5 Sep 2003 16:36:17 -0000 1.3.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <assert.h> Index: write.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/write.c,v retrieving revision 1.2 retrieving revision 1.2.16.1 diff -u -w -b -B -p -r1.2 -r1.2.16.1 --- write.c 7 Mar 2003 03:31:36 -0000 1.2 +++ write.c 5 Sep 2003 16:36:17 -0000 1.2.16.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #include <unistd.h> #include <errno.h> #include <sys/types.h> @@ -54,6 +56,7 @@ #include "inode.h" #include "fs.h" #include "mount.h" +#include "sysio-symbols.h" /* * Schedule asynchronous write of iovec at some file extent. @@ -205,6 +208,10 @@ writev(int fd, const struct iovec *iov, return iowait(ioid); } +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias( writev, _writev ) +#endif + ssize_t write(int fd, const void *buf, size_t count) { @@ -215,6 +222,10 @@ write(int fd, const void *buf, size_t co return -1; return iowait(ioid); } + +#if defined(BSD) || defined(REDSTORM) +sysio_sym_weak_alias(write, _write) +#endif #ifdef notdef int |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:30
|
Update of /cvsroot/libsysio/libsysio/drivers/redstorm In directory sc8-pr-cvs1:/tmp/cvs-serv8570/drivers/redstorm Added Files: Tag: RedStorm_merge Makefile.am fs_redstorm.c fs_redstorm.h mountFiles.c start_sysio.c Log Message: merge changes from Mike Levenhagen --- NEW FILE --- lib_LIBRARIES = libsysio_redstorm.a EXTRA_DIST = fs_redstorm.h libsysio_redstorm_a_SOURCES = fs_redstorm.c start_sysio.c mountFiles.c include $(top_srcdir)/Rules.make --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* [...1218 lines suppressed...] static void redstorm_inop_gone(struct inode *ino) { struct redstorm_inode *nino = I2NI(ino); if (nino->ni_fd) (void )close(nino->ni_fd); free(ino->i_private); } static void redstorm_fsop_gone(struct filesys *fs __IS_UNUSED) { /* * Do nothing. There is no private part maintained for the * redstorm file interface. */ } --- NEW FILE --- /* * This Cplant(TM) source code is the property of Sandia National * Laboratories. * * This Cplant(TM) source code is copyrighted by Sandia National * Laboratories. * * The redistribution of this Cplant(TM) source code is subject to the * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * * Cplant(TM) Copyright 1998-2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States * Government. */ /* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Questions or comments about this library should be sent to: * * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 * Albuquerque, NM 87185-1110 * * le...@sa... */ /* * Native file system driver support. */ #ident "$Id: fs_redstorm.h,v 1.1.2.1 2003/09/05 16:36:17 rklundt Exp $" extern int _sysio_redstorm_init(void); extern void start_sysio(void); extern void mountFiles(void); --- NEW FILE --- #ident "$Id: mountFiles.c,v 1.1.2.1 2003/09/05 16:36:17 rklundt Exp $" #include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/param.h> #include <sys/mount.h> #include <catamount/lprintf.h> #include "fs_redstorm.h" void mountFiles(void) { if ((mkdir("/home", 0777)) != 0 && errno != EEXIST) { lprintf("mountFiles() mkdir failed\n"); while(1); } if ((mkdir("/tmp", 0777)) != 0 && errno != EEXIST) { lprintf("mountFiles() mkdir failed\n"); while(1); } if ((mkdir("/etc", 0777)) != 0 && errno != EEXIST) { lprintf("mountFiles() mkdir failed\n"); while(1); } if ((mount("redstorm", "/home", 0, "/home")) != 0) { lprintf("mountFiles() mount failed\n"); while(1); } if ((mount("redstorm", "/tmp", 0, "/tmp")) != 0) { lprintf("mountFiles() mount failed\n"); while(1); } if ((mount("redstorm", "/etc", 0, "/etc" )) != 0) { lprintf("mountFiles() mount failed\n"); while(1); } } --- NEW FILE --- #ident "$Id: start_sysio.c,v 1.1.2.1 2003/09/05 16:36:17 rklundt Exp $" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <dev.h> #include <stdfd.h> #include <sysio.h> #include <mount.h> #include <errno.h> #include <catamount/lprintf.h> #include "fs_redstorm.h" void start_sysio(void) { static int sysio_init_done = 0; int i, fd[3]; struct stdio { char *path; mode_t mode; int flags; int dev; } std[3] = { { "/dev/stdin", (S_IFCHR | 0444), O_RDONLY, SYSIO_MKDEV(SYSIO_C_STDFD_MAJOR, 0) }, { "/dev/stdout", (S_IFCHR | 0222), O_WRONLY, SYSIO_MKDEV(SYSIO_C_STDFD_MAJOR, 1) }, { "/dev/stderr", (S_IFCHR | 0222), O_WRONLY, SYSIO_MKDEV(SYSIO_C_STDFD_MAJOR, 2) } }; if (sysio_init_done) return; sysio_init_done = 1; if (_sysio_init() != 0) { lprintf("_sysio_init failed\n"); return; } if (_sysio_incore_init() != 0) { lprintf("_sysio_incore_init() failed\n"); return; } if ((_sysio_mount_root("0777+0+0", "incore", 0, NULL)) != 0) { lprintf("_sysio_mount_root() failed\n"); return; } if ((mkdir("/dev", 0777)) != 0 && errno != EEXIST) { lprintf("mkdir(\"/dev\") failed\n"); return; } for (i = 0; i < 3; i++) { if (mknod(std[i].path, std[i].mode, std[i].dev) == 0) { if ( ( fd[i] = open(std[i].path, std[i].flags )) < 0 ) { lprintf("start_sysio() open failed errno %i \n",errno); return; } } else { lprintf("start_sysio() mknod failed errno %i %s\n",errno, std[i].path ); } } } |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:30
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv8570 Modified Files: Tag: RedStorm_merge Makefile.am README configure.in Added Files: Tag: RedStorm_merge .cvsignore run.sh Log Message: merge changes from Mike Levenhagen --- NEW FILE --- Makefile autom4te.cache linux32 sysioV2.log sysioV2.make.log snos32 config.log config.status snos64 cnos32 cnos64 --- NEW FILE --- #!/bin/bash ############################################################################ # # File: run.sh # # Description: Script to exercise the sysioV2 library. # # Usage: # run.sh # # Limitations: # 1. Doesn't exercise all of sysioV2. # ############################################################################ # defaults - change as necessary for local system TEST_PATH=./tests SCRATCH=scratch.$$ SRC=/tmp/test_copy.src.$$ DEST=/tmp/test_copy.dest.$$ NEWDIR=/tmp/newdir.$$ PASSCNT=0 #This is the anticipated count of passes # main processing logic follows cp /dev/null $SCRATCH rm -f $SRC $DEST if [ -f $SRC ] then echo "Could not remove $SRC - test INDETERMINATE" >> $SCRATCH exit 5 fi if [ -f $DEST ] then echo "Could not remove $DEST - test INDETERMINATE" >> $SCRATCH exit 5 fi if ( ! cp /usr/include/stdio.h $SRC ) # just picked something handy then echo "Could not create source file - test INDETERMINATE" >> $SCRATCH exit 5 fi # # Run the copy test # PASSCNT=`expr $PASSCNT + 1` echo "++++Running test_copy" >> $SCRATCH ${TEST_PATH}/test_copy ${SRC} ${DEST} SRC_VERF=`cksum $SRC | awk '{ print $1 }'` DEST_VERF=`cksum $DEST | awk '{ print $1 }'` if [ -z $DEST_VERF ] then echo "Copy failed; test_copy FAILED" >> $SCRATCH elif [ "$SRC_VERF" -ne "$DEST_VERF" ] then echo "The source and destination files did not match; test_copy FAILED" >> $SCRATCH 2>&1 else echo "The source and destination files matched $SRC_VERF; test_copy PASSED" >> $SCRATCH 2>&1 fi # # Run the list test # PASSCNT=`expr $PASSCNT + 1` echo " " >> $SCRATCH echo "++++Running test_list" >> $SCRATCH ${TEST_PATH}/test_list /tmp >> $SCRATCH 2>&1 if ( grep `basename $SRC` $SCRATCH > /dev/null ) && ( grep `basename $DEST` $SCRATCH > /dev/null ) then echo "The list found newly created files; test_list PASSED" >> $SCRATCH else echo "File list did not find expected files; test_list FAILED" >> $SCRATCH fi # # Run the test_stats # PASSCNT=`expr $PASSCNT + 1` echo " " >> $SCRATCH echo "++++Running test_stats" >> $SCRATCH ${TEST_PATH}/test_stats $SRC >> $SCRATCH if ( grep ${SRC}: $SCRATCH | grep ino > /dev/null ) then echo "The stat succeeeded; test_stats PASSED" >> $SCRATCH else echo "Unexpected stat result; test_stats FAILED" >> $SCRATCH fi # # Run the test_cwd # PASSCNT=`expr $PASSCNT + 1` echo " " >> $SCRATCH echo "++++Running test_getcwd" >> $SCRATCH mkdir $NEWDIR ${TEST_PATH}/test_getcwd $NEWDIR >> $SCRATCH 2>/dev/null if ( grep $NEWDIR $SCRATCH > /dev/null ) then echo "Chdir and getcwd gave expected result; test_getcwd PASSED" >> $SCRATCH else echo "Unexpected output from chdir and getcwd; test_getcwd FAILED" >> $SCRATCH fi # # Run the test_path # PASSCNT=`expr $PASSCNT + 1` echo " " >> $SCRATCH echo "++++Running test_path" >> $SCRATCH ${TEST_PATH}/test_path $NEWDIR $SRC >> $SCRATCH 2>&1 if ( grep "$NEWDIR: d" $SCRATCH > /dev/null ) && ( grep "$SRC: f" $SCRATCH > /dev/null ) then echo "Found expected results; test_path PASSED" >> $SCRATCH else echo "Unexpected results; test_path FAILED" >> $SCRATCH fi # # Report test results # echo "" if grep "FAILED" $SCRATCH > /dev/null then cat $SCRATCH echo "TEST $0 FAILED - found failed" RC=8 elif test `grep -c "PASSED" $SCRATCH` -ne $PASSCNT > /dev/null then cat $SCRATCH echo "TEST $0 FAILED - wrong pass count" RC=4 else echo "TEST $0 PASSED" RC=0 fi #Cleanup rm -f $SRC $DEST rmdir $NEWDIR exit $RC Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v retrieving revision 1.7 retrieving revision 1.7.10.1 diff -u -w -b -B -p -r1.7 -r1.7.10.1 --- Makefile.am 26 Mar 2003 00:00:15 -0000 1.7 +++ Makefile.am 5 Sep 2003 16:36:16 -0000 1.7.10.1 @@ -15,7 +15,9 @@ really-clean: maintainer-clean -rm -rf autom4te-2.53.cache -rm -rf .deps -rm -f Makefile.in \ - drivers/native/Makefile.in drivers/incore/Makefile.in \ + drivers/native/Makefile.in \ + drivers/incore/Makefile.in \ + drivers/redstorm/Makefile.in \ drivers/Makefile.in \ dev/stdfd/Makefile.in \ dev/Makefile.in \ Index: README =================================================================== RCS file: /cvsroot/libsysio/libsysio/README,v retrieving revision 1.2.12.2 retrieving revision 1.2.12.2.2.1 diff -u -w -b -B -p -r1.2.12.2 -r1.2.12.2.2.1 --- README 27 May 2003 13:44:30 -0000 1.2.12.2 +++ README 5 Sep 2003 16:36:16 -0000 1.2.12.2.2.1 @@ -63,4 +63,8 @@ The following works for me: export CFLAGS="-DREDSTORM -nostdinc -isystem /home/lee/REDSTORM/catamount/computeincs/i386 -isystem /home/lee/REDSTORM/catamount/include -g -W -Wall -ansi" -sh configure --with-autmount=".mount" --with-native=yes --with-incore-yes --with-stdfd=yes --with-tests=yes +# No tests until the compute libraries include support for getopt! +sh configure --with-autmount=".mount" --with-native=yes --with-incore-yes --with-stdfd=yes --with-tests=no + +Support for getopt is supposed to be coming soon. The tests can be reenabled +when that happens, I hope. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.5.6.4 retrieving revision 1.5.6.4.2.1 diff -u -w -b -B -p -r1.5.6.4 -r1.5.6.4.2.1 --- configure.in 29 Jul 2003 20:17:22 -0000 1.5.6.4 +++ configure.in 5 Sep 2003 16:36:16 -0000 1.5.6.4.2.1 @@ -19,6 +19,20 @@ AC_HEADER_STDC AC_HEADER_STAT AC_HEADER_TIME +AC_ARG_WITH(redstorm_driver, + [ --with-redstorm-driver build redstorm driver], + [ case "${withval}" in + yes) if test x${with_stdfd_dev} != xyes; then + with_stdfd_dev=yes + AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = +xyes) + fi ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-redstorm-driver);; + esac], + [with_redstorm_driver=no]) +AM_CONDITIONAL(WITH_REDSTORM_DRIVER, test x$with_redstorm_driver = xyes) + AC_ARG_WITH(native_driver, [ --with-native-driver build native test driver], [ with_native_driver=${withval} @@ -213,19 +227,6 @@ AC_MSG_RESULT($have__st_ino) if test x$have__st_ino = xyes; then AC_DEFINE(HAVE__ST_INO) fi -# Check for st_gen -# -AC_MSG_CHECKING(for st_gen) -AC_TRY_COMPILE([ -#include <sys/stat.h>], -[struct stat st; -st.st_gen = 0;], - have_st_gen=yes, - have_st_gen=no) -AC_MSG_RESULT($have_st_gen) -if test x$have_st_gen = xyes; then - AC_DEFINE(HAVE_GENERATION) -fi # Check for getdents64 call # @@ -348,6 +349,7 @@ AC_OUTPUT( Makefile src/Makefile drivers/Makefile + drivers/redstorm/Makefile drivers/native/Makefile drivers/incore/Makefile dev/Makefile |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:30
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv8570/include Modified Files: Tag: RedStorm_merge dev.h file.h fs.h inode.h mount.h sysio-symbols.h sysio.h Log Message: merge changes from Mike Levenhagen Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.2.6.1 retrieving revision 1.2.6.1.2.1 diff -u -w -b -B -p -r1.2.6.1 -r1.2.6.1.2.1 --- dev.h 12 May 2003 11:48:45 -0000 1.2.6.1 +++ dev.h 5 Sep 2003 16:36:17 -0000 1.2.6.1.2.1 @@ -49,6 +49,8 @@ * Make a device number, composed of major and minor parts. We *assume* that * the system version of a dev_t is 16 bits or more. */ +#ident "$Id$" + #define SYSIO_MKDEV(major, minor) \ ((((major) & 0xff) << 8) | ((minor) & 0xff)) Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.1.2.1 diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.1.2.1 --- file.h 12 May 2003 11:48:45 -0000 1.5.6.1 +++ file.h 5 Sep 2003 16:36:17 -0000 1.5.6.1.2.1 @@ -50,6 +50,8 @@ * all the info necessary to track the context and parameters for the * operations that may be performed. */ +#ident "$Id$" + struct file { struct inode *f_ino; /* path node */ _SYSIO_OFF_T f_pos; /* current stream pos */ Index: fs.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/fs.h,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- fs.h 24 Mar 2003 22:09:05 -0000 1.4 +++ fs.h 5 Sep 2003 16:36:17 -0000 1.4.2.1 @@ -45,6 +45,8 @@ * File system or volume support. */ +#ident "$Id$" + struct filesys; struct pnode; Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.2.2.1 diff -u -w -b -B -p -r1.6.4.2 -r1.6.4.2.2.1 --- inode.h 29 Jul 2003 19:05:08 -0000 1.6.4.2 +++ inode.h 5 Sep 2003 16:36:17 -0000 1.6.4.2.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #if defined(AUTOMOUNT_FILE_NAME) && !defined(MAX_MOUNT_DEPTH) /* * Maximum number of automounts to attempt in path traversal. Index: mount.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/mount.h,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -u -w -b -B -p -r1.3 -r1.3.8.1 --- mount.h 7 Mar 2003 03:31:36 -0000 1.3 +++ mount.h 5 Sep 2003 16:36:17 -0000 1.3.8.1 @@ -41,6 +41,10 @@ * le...@sa... */ +#ident "$Id$" + +#include <sys/queue.h> + /* * Mount support. */ Index: sysio-symbols.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-symbols.h,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -u -w -b -B -p -r1.2 -r1.2.8.1 --- sysio-symbols.h 7 Mar 2003 03:31:36 -0000 1.2 +++ sysio-symbols.h 5 Sep 2003 16:36:17 -0000 1.2.8.1 @@ -1,3 +1,5 @@ +#ident "$Id$" + #if defined(HAVE_ASM_WEAK_DIRECTIVE) || defined(HAVE_ASM_WEAKEXT_DIRECTIVE) #define HAVE_WEAK_SYMBOLS #endif Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.7.6.2 retrieving revision 1.7.6.2.2.1 diff -u -w -b -B -p -r1.7.6.2 -r1.7.6.2.2.1 --- sysio.h 29 Jul 2003 20:17:22 -0000 1.7.6.2 +++ sysio.h 5 Sep 2003 16:36:17 -0000 1.7.6.2.2.1 @@ -45,8 +45,17 @@ * System IO common information. */ +#ident "$Id$" + #include <stdarg.h> +#if defined(BSD) || defined(REDSTORM) +#include <sys/param.h> +#include <sys/mount.h> +#else +#include <sys/vfs.h> +#endif + #ifndef _IOID_T_DEFINED #define _IOID_T_DEFINED /* @@ -162,6 +171,7 @@ extern int stat(const char *path, struct extern int statvfs(const char *path, struct statvfs *buf); extern int fstatvfs(int fd, struct statvfs *buf); #endif +extern int fstatfs(int fd, struct statfs *buf); extern int truncate(const char *path, off_t length); extern int rmdir(const char *path); extern int symlink(const char *path1, const char *path2); @@ -193,8 +203,12 @@ extern ioid_t iwrite(int fd, const void extern ssize_t writev(int fd, const struct iovec *iov, int count); extern ssize_t write(int fd, const void *buf, size_t count); extern int mknod(const char *path, mode_t mode, dev_t dev); +#if defined(BSD) || defined(REDSTORM) +extern int mount(const char *, const char *, int, void *); +#else extern int mount(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data); +#endif extern int umount(const char *target); |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:28
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv8570/drivers/native Modified Files: Tag: RedStorm_merge fs_native.c fs_native.h Added Files: Tag: RedStorm_merge .cvsignore Log Message: merge changes from Mike Levenhagen --- NEW FILE --- .deps Makefile Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.11.4.6 retrieving revision 1.11.4.6.2.1 diff -u -w -b -B -p -r1.11.4.6 -r1.11.4.6.2.1 --- fs_native.c 4 Aug 2003 15:37:05 -0000 1.11.4.6 +++ fs_native.c 5 Sep 2003 16:36:17 -0000 1.11.4.6.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #ifdef __linux__ #define _BSD_SOURCE #endif @@ -1073,7 +1075,7 @@ native_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. */ - if (!syscall(SYS_unlink, path)) + if (syscall(SYS_unlink, path) != 0) err = -errno; free(path); return err; @@ -1127,7 +1129,7 @@ doio(ssize_t (*f)(int, const struct iove * Avoid the reposition call if we're already at the right place. * Allows us to access pipes and fifos. */ - result = ioctx->ioctx_offset; + result = nino->ni_fpos; if (ioctx->ioctx_offset != nino->ni_fpos) { int err; Index: fs_native.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.10.1 diff -u -w -b -B -p -r1.1.1.1 -r1.1.1.1.10.1 --- fs_native.h 22 Feb 2003 16:33:14 -0000 1.1.1.1 +++ fs_native.h 5 Sep 2003 16:36:17 -0000 1.1.1.1.10.1 @@ -45,4 +45,6 @@ * Native file system driver support. */ +#ident "$Id$" + extern int _sysio_native_init(void); |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:28
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1:/tmp/cvs-serv8570/dev/stdfd Modified Files: Tag: RedStorm_merge stdfd.c stdfd.h Added Files: Tag: RedStorm_merge .cvsignore Log Message: merge changes from Mike Levenhagen --- NEW FILE --- Makefile .deps Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.2 retrieving revision 1.2.10.1 diff -u -w -b -B -p -r1.2 -r1.2.10.1 --- stdfd.c 24 Mar 2003 22:09:02 -0000 1.2 +++ stdfd.c 5 Sep 2003 16:36:16 -0000 1.2.10.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #ifdef __linux__ #define _BSD_SOURCE #endif @@ -57,6 +59,10 @@ #include "dev.h" #include "stdfd.h" + +#ifdef REDSTORM +#include <catamount/syscall.h> +#endif /* * Pre-opened standard file descriptors driver. Index: stdfd.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -w -b -B -p -r1.2 -r1.2.2.1 --- stdfd.h 24 Mar 2003 22:09:02 -0000 1.2 +++ stdfd.h 5 Sep 2003 16:36:16 -0000 1.2.2.1 @@ -45,6 +45,8 @@ * Std{in,out,err} pseudo-device-driver support. */ +#ident "$Id$" + #define SYSIO_C_STDFD_MAJOR 0 extern int _sysio_stdfd_init(void); |
From: Ruth K. <rk...@us...> - 2003-09-05 16:36:27
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1:/tmp/cvs-serv8570/drivers/incore Modified Files: Tag: RedStorm_merge fs_incore.c fs_incore.h Added Files: Tag: RedStorm_merge .cvsignore Log Message: merge changes from Mike Levenhagen --- NEW FILE --- .deps Makefile Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.2.2.1 diff -u -w -b -B -p -r1.4.4.2 -r1.4.4.2.2.1 --- fs_incore.c 19 May 2003 14:25:24 -0000 1.4.4.2 +++ fs_incore.c 5 Sep 2003 16:36:16 -0000 1.4.4.2.2.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ident "$Id$" + #ifdef __linux__ #define _BSD_SOURCE #endif Index: fs_incore.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -w -b -B -p -r1.2 -r1.2.2.1 --- fs_incore.h 24 Mar 2003 22:09:03 -0000 1.2 +++ fs_incore.h 5 Sep 2003 16:36:16 -0000 1.2.2.1 @@ -45,4 +45,6 @@ * Native file system driver support. */ +#ident "$Id$" + extern int _sysio_incore_init(void); |