libsysio-commit Mailing List for libsysio (Page 49)
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-05-19 14:37:10
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv4131/src Modified Files: Tag: RedStorm open.c stat.c Log Message: Finish redstorm port to the point of compilation. This is very hard to get setup to build. Definately see the README. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -u -w -b -B -p -r1.7 -r1.7.4.1 --- open.c 23 Apr 2003 18:13:44 -0000 1.7 +++ open.c 19 May 2003 13:51:20 -0000 1.7.4.1 @@ -144,7 +144,12 @@ open(const char *path, int flags, ...) * Will need mode too. */ va_start(ap, flags); - mode = va_arg(ap, mode_t); + mode = +#ifndef REDSTORM + va_arg(ap, mode_t); +#else + va_arg(ap, int); +#endif va_end(ap); mode &= ~_sysio_umask; /* apply umask */ Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.3.6.1 retrieving revision 1.3.6.2 diff -u -w -b -B -p -r1.3.6.1 -r1.3.6.2 --- stat.c 12 May 2003 11:48:45 -0000 1.3.6.1 +++ stat.c 19 May 2003 13:51:20 -0000 1.3.6.2 @@ -66,7 +66,7 @@ #define _STAT_VER 0 #endif -#if !(defined(__GLIBC__) && __GLIBC__ >= 2) +#if 0 && !(defined(__GLIBC__) && __GLIBC__ >= 2) #warning Check assumptions here about stat/stat64 sizes and offsets #endif |
From: Lee W. <lw...@us...> - 2003-05-19 14:37:09
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv4131 Modified Files: Tag: RedStorm README configure.in Log Message: Finish redstorm port to the point of compilation. This is very hard to get setup to build. Definately see the README. Index: README =================================================================== RCS file: /cvsroot/libsysio/libsysio/README,v retrieving revision 1.2 retrieving revision 1.2.12.1 diff -u -w -b -B -p -r1.2 -r1.2.12.1 --- README 7 Mar 2003 03:31:35 -0000 1.2 +++ README 19 May 2003 13:51:20 -0000 1.2.12.1 @@ -53,3 +53,18 @@ is required. They are not on a timer, un one for them. They just disappear as resource is needed elsewhere. As they were automatically mounted to begin with, they should re-establish as needed, transparently. + +REDSTORM +-------- + +The following works for me: + +#!/bin/sh + +export CFLAGS="-DREDSTORM -nostdinc -isystem /home/lee/REDSTORM/catamount/computeincs/i386 -isystem /home/lee/REDSTORM/catamount/include -g -W -Wall -ansi" + +# 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.1 retrieving revision 1.5.6.2 diff -u -w -b -B -p -r1.5.6.1 -r1.5.6.2 --- configure.in 12 May 2003 11:48:45 -0000 1.5.6.1 +++ configure.in 19 May 2003 13:51:20 -0000 1.5.6.2 @@ -19,7 +19,7 @@ AC_HEADER_STDC AC_HEADER_STAT AC_HEADER_TIME -AC_ARG_WITH(with_native_driver, +AC_ARG_WITH(native_driver, [ --with-native-driver build native test driver], [ with_native_driver=${withval} case "${withval}" in @@ -30,7 +30,7 @@ AC_ARG_WITH(with_native_driver, [with_native_driver=yes]) AM_CONDITIONAL(WITH_NATIVE_DRIVER, test x$with_native_driver = xyes) -AC_ARG_WITH(with_incore_driver, +AC_ARG_WITH(incore_driver, [ --with-incore-driver build incore test driver], [ with_incore_driver=${withval} case "${withval}" in @@ -41,7 +41,7 @@ AC_ARG_WITH(with_incore_driver, [with_incore_driver=yes]) AM_CONDITIONAL(WITH_INCORE_DRIVER, test x$with_incore_driver = xyes) -AC_ARG_WITH(with_tests, +AC_ARG_WITH(tests, [ --with-tests build tests], [ with_tests=${withval} case "${withval}" in @@ -61,7 +61,7 @@ if test x$with_automount != x; then fi AC_SUBST(AUTOMOUNT) -AC_ARG_WITH(with_stdfd_dev, +AC_ARG_WITH(stdfd_dev, [ --with-stdfd-dev build standard file descriptors pseudo-driver], [ with_stdfd_dev=${withval} case "${withval}" in |
From: Lee W. <lw...@us...> - 2003-05-19 14:37:04
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv4131/drivers/native Modified Files: Tag: RedStorm fs_native.c Log Message: Finish redstorm port to the point of compilation. This is very hard to get setup to build. Definately see the README. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.11.4.1 retrieving revision 1.11.4.2 diff -u -w -b -B -p -r1.11.4.1 -r1.11.4.2 --- fs_native.c 12 May 2003 11:48:45 -0000 1.11.4.1 +++ fs_native.c 19 May 2003 13:51:20 -0000 1.11.4.2 @@ -1249,7 +1249,9 @@ native_inop_datasync(struct inode *ino) #ifdef NATIVE_FDATASYNC return syscall(NATIVE_FDATASYNC, I2NI(ino)->ni_fd); #else +#if 0 #warning No fdatasync system call -- Using fsync instead! +#endif return syscall(SYS_fsync, I2NI(ino)->ni_fd); #endif } |
From: Lee W. <lw...@us...> - 2003-05-19 14:26:34
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv29970/drivers/native Modified Files: Tag: RedStorm fs_native.c Log Message: It's SYS__llseek, not SYS_llseek. Fixed a cast. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.11.4.2 retrieving revision 1.11.4.3 diff -u -w -b -B -p -r1.11.4.2 -r1.11.4.3 --- fs_native.c 19 May 2003 13:51:20 -0000 1.11.4.2 +++ fs_native.c 19 May 2003 14:26:31 -0000 1.11.4.3 @@ -793,9 +793,9 @@ native_pos(int fd, { int err; err = - syscall(SYS_llseek, - (unsigned int)nino->ni_fd, - (unsigned int)*offset >> 32, + syscall(SYS__llseek, + (unsigned int)fd, + (unsigned int)(*offset >> 32), (unsigned int)*offset, offset, SEEK_SET); |
From: Lee W. <lw...@us...> - 2003-05-19 14:25:27
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1:/tmp/cvs-serv29123/drivers/incore Modified Files: Tag: RedStorm fs_incore.c Log Message: Fixed a syntax error when compiled for Linux-IA32. Needed record length, in order to clear directory entry in unlink call, when compiled for Linux-IA32. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.2 diff -u -w -b -B -p -r1.4.4.1 -r1.4.4.2 --- fs_incore.c 12 May 2003 11:48:45 -0000 1.4.4.1 +++ fs_incore.c 19 May 2003 14:25:24 -0000 1.4.4.2 @@ -711,8 +711,9 @@ incore_directory_probe(void *data, size_t siz, _SYSIO_OFF_T origin #ifndef _DIRENT_HAVE_D_OFF - __IS_UNUSED, + __IS_UNUSED #endif + , probe_ty entry, probe_ty hole, void *arg) @@ -1185,9 +1186,8 @@ incore_unlink_entry(struct incore_inode { struct lookup_data lookup_data; struct intnl_dirent *de; -#ifndef _DIRENT_HAVE_D_OFF size_t reclen; -#else +#ifdef _DIRENT_HAVE_D_OFF size_t off; #endif @@ -1210,6 +1210,7 @@ incore_unlink_entry(struct incore_inode reclen = de->d_reclen; #else off = de->d_off; + reclen = off - ((void *)de - icino->ici_data); #endif (void )memset(de, 0, reclen); #ifndef _DIRENT_HAVE_D_OFF |
From: Lee W. <lw...@us...> - 2003-05-19 14:05:37
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv14416/src Modified Files: Tag: RedStorm getdirentries.c Log Message: In order to prototype alloca, we need to check for __GLIBC__. This is not defined if alloca.h is first. Need something before that. Now have stdlib.h included prior. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.1.10.1 retrieving revision 1.1.10.2 diff -u -w -b -B -p -r1.1.10.1 -r1.1.10.2 --- getdirentries.c 12 May 2003 11:48:45 -0000 1.1.10.1 +++ getdirentries.c 19 May 2003 14:05:34 -0000 1.1.10.2 @@ -1,7 +1,6 @@ +#include <stdlib.h> #ifdef __GLIBC__ #include <alloca.h> -#else -#include <stdlib.h> #endif #include <string.h> #include <errno.h> |
From: Mei <me...@us...> - 2003-05-18 15:36:53
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv7520 Modified Files: Tag: b_lustre namei.c Log Message: back out the previous change on intent. suggested by Lee Ward, handle the issue in lustre instead of libsysio. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -u -w -b -B -p -r1.5.4.1 -r1.5.4.2 --- namei.c 18 May 2003 10:54:10 -0000 1.5.4.1 +++ namei.c 18 May 2003 15:36:49 -0000 1.5.4.2 @@ -369,15 +369,11 @@ _sysio_path_walk(struct pnode *parent, s * node it is looking up, including the last, via the base * path node and it's ancestor chain. */ - /* I don't know why we need pass intent when first walk into the - * filesyste. But for lustre, we definetely don't want the intent - * unless we are handling the last component. -meijia FIXME - */ err = lookup(parent, &this, &nd->nd_pno, - (/*path ||*/!next.len) + (path || !next.len) ? nd->nd_intent : NULL, (path && next.len) ? path : NULL); |
From: Mei <me...@us...> - 2003-05-18 10:54:17
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv14428 Modified Files: Tag: b_lustre namei.c Log Message: don't pass down intent until we reached the last component. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -u -w -b -B -p -r1.5 -r1.5.4.1 --- namei.c 24 Mar 2003 22:09:06 -0000 1.5 +++ namei.c 18 May 2003 10:54:10 -0000 1.5.4.1 @@ -369,11 +369,15 @@ _sysio_path_walk(struct pnode *parent, s * node it is looking up, including the last, via the base * path node and it's ancestor chain. */ + /* I don't know why we need pass intent when first walk into the + * filesyste. But for lustre, we definetely don't want the intent + * unless we are handling the last component. -meijia FIXME + */ err = lookup(parent, &this, &nd->nd_pno, - (path || !next.len) + (/*path ||*/!next.len) ? nd->nd_intent : NULL, (path && next.len) ? path : NULL); |
From: Mei <me...@us...> - 2003-05-17 11:59:59
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv21640 Modified Files: Tag: b_lustre open.c Log Message: a trick for lustre's intent locking. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -w -b -B -p -r1.7 -r1.7.2.1 --- open.c 23 Apr 2003 18:13:44 -0000 1.7 +++ open.c 17 May 2003 11:59:56 -0000 1.7.2.1 @@ -160,7 +160,7 @@ open(const char *path, int flags, ...) * Find the file. */ fil = NULL; - INTENT_INIT(&intent, intent.int_opmask, &mode, NULL); + INTENT_INIT(&intent, intent.int_opmask, &mode, &flags); pno = NULL; err = _sysio_namei(_sysio_cwd, path, ndflags, &intent, &pno); if (err) { |
From: Lee W. <lw...@us...> - 2003-05-12 11:48:49
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv27060/src Modified Files: Tag: RedStorm Makefile.am dev.c getdirentries.c lseek.c mknod.c stat.c stat64.c statvfs.c statvfs64.c Log Message: Modifications for the Cray RedStorm compute node operating system. This is a BSD-based libc. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/Makefile.am,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- Makefile.am 24 Mar 2003 22:09:06 -0000 1.5 +++ Makefile.am 12 May 2003 11:48:45 -0000 1.5.6.1 @@ -3,6 +3,6 @@ lib_LIBRARIES = libsysio.a libsysio_a_SOURCES = 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 + stat64.c symlink.c truncate.c unlink.c write.c include $(top_srcdir)/Rules.make Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -u -w -b -B -p -r1.2 -r1.2.6.1 --- dev.c 24 Mar 2003 22:09:06 -0000 1.2 +++ dev.c 12 May 2003 11:48:45 -0000 1.2.6.1 @@ -72,7 +72,9 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_datasync, _sysio_nodev_inop_ioctl, _sysio_nodev_inop_mknod, +#ifdef _HAVE_STATVFS _sysio_nodev_inop_statvfs, +#endif _sysio_nodev_inop_gone }; Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.1 retrieving revision 1.1.10.1 diff -u -w -b -B -p -r1.1 -r1.1.10.1 --- getdirentries.c 9 Mar 2003 13:53:53 -0000 1.1 +++ getdirentries.c 12 May 2003 11:48:45 -0000 1.1.10.1 @@ -1,4 +1,4 @@ -#ifdef __GNUC__ +#ifdef __GLIBC__ #include <alloca.h> #else #include <stdlib.h> @@ -20,7 +20,10 @@ #endif ssize_t -getdirentries64(int fd, char *buf, size_t nbytes, off64_t * __restrict basep) +getdirentries64(int fd, + char *buf, + size_t nbytes, + _SYSIO_OFF_T * __restrict basep) { struct file *fil; ssize_t cc; @@ -56,33 +59,59 @@ getdirentries64(int fd, char *buf, size_ #define _namlen(dp) (strlen((dp)->d_name)) #endif +#ifndef _rndup +#define _rndup(n, boundary) \ + ((((n) + (boundary) - 1 ) / (boundary)) * (boundary)) +#endif + +#if !(defined(BSD) || defined(REDSTORM)) ssize_t -getdirentries(int fd, char *buf, size_t nbytes, off_t * __restrict basep) +getdirentries(int fd, + char *buf, + size_t nbytes, + off_t * __restrict basep) +#else +int +getdirentries(int fd, + char *buf, + int nbytes, + long * __restrict basep) +#endif { size_t inbytes; void *ibuf; - off64_t ibase; + _SYSIO_OFF_T ibase; ssize_t cc; struct dirent *dp, *nxtdp; - struct dirent64 *od64p, *d64p; +#if defined(BSD) || defined(REDSTORM) + int off; +#endif + struct intnl_dirent *od64p, *d64p; size_t n; size_t reclen; char *cp; #define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) -#ifdef __GNUC__ +#ifdef __GLIBC__ #define _dreclen(namlen) \ ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ ~(__alignof__ (struct dirent) - 1)) #define _fast_alloc(n) alloca(n) #define _fast_free(p) -#else /* !defined(__GNUC__) */ -#define _dreclen(namelen) \ - (_rndup(_dbaselen + (namlen) + 1, sizeof(unsigned long long)) +#else /* !defined(__GLIBC__) */ +#define _dreclen(namlen) \ + _rndup(_dbaselen + (namlen) + 1, sizeof(int)) #define _fast_alloc(n) malloc(n) #define _fast_free(p) free(p) #endif +#if defined(BSD) || defined(REDSTORM) + if (nbytes < 0) { + errno = -EINVAL; + return -1; + } +#endif + inbytes = nbytes; if (inbytes > 8 * 1024) { /* @@ -110,6 +139,9 @@ getdirentries(int fd, char *buf, size_t goto out; } +#if defined(BSD) || defined(REDSTORM) + off = *basep; +#endif od64p = NULL; d64p = ibuf; for (;;) { @@ -121,14 +153,22 @@ getdirentries(int fd, char *buf, size_t n = strlen(d64p->d_name); #endif reclen = _dreclen(n); - if (reclen >= nbytes) + if (reclen >= (unsigned )nbytes) break; dp->d_ino = (ino_t )d64p->d_ino; +#if !(defined(BSD) || defined(REDSTORM)) dp->d_off = (off_t )d64p->d_off; +#endif if ((sizeof(dp->d_ino) != sizeof(d64p->d_ino) && - dp->d_ino != d64p->d_ino) && + dp->d_ino != d64p->d_ino) + || +#if !(defined(BSD) || defined(REDSTORM)) (sizeof(dp->d_off) != sizeof(d64p->d_off) && - dp->d_off != d64p->d_off)) { + dp->d_off != d64p->d_off) +#else + (off + (int )reclen < off) +#endif + ) { cc = -EOVERFLOW; break; } @@ -142,6 +182,9 @@ getdirentries(int fd, char *buf, size_t od64p = d64p; d64p = (void *)d64p + d64p->d_reclen; nbytes -= reclen; +#if defined(BSD) || defined(REDSTORM) + off += reclen; +#endif dp = nxtdp; } @@ -154,10 +197,15 @@ out: } cc = (char *)dp - buf; if (cc) - *basep = od64p->d_off; + *basep = +#if !(defined(BSD) || defined(REDSTORM)) + od64p->d_off; +#else + off; +#endif return cc; -#ifdef __GNUC__ +#ifdef __GLIBC__ #undef _fast_alloc #undef _fast_free #endif Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -u -w -b -B -p -r1.4 -r1.4.4.1 --- lseek.c 27 Apr 2003 13:20:01 -0000 1.4 +++ lseek.c 12 May 2003 11:48:45 -0000 1.4.4.1 @@ -53,8 +53,8 @@ #include "sysio-symbols.h" -static off64_t -_sysio_lseek(int fd, off64_t offset, int whence) +static _SYSIO_OFF_T +_sysio_lseek(int fd, _SYSIO_OFF_T offset, int whence) { int err; struct file *fil; Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- mknod.c 26 Mar 2003 00:06:05 -0000 1.3 +++ mknod.c 12 May 2003 11:48:45 -0000 1.3.6.1 @@ -62,6 +62,10 @@ #undef mknod #undef __xmknod +#if defined(BSD) || defined(REDSTORM) +#define _MKNOD_VER 0 +#endif + int __xmknod(int __ver, const char *path, mode_t mode, dev_t *dev) { Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- stat.c 24 Mar 2003 22:09:07 -0000 1.3 +++ stat.c 12 May 2003 11:48:45 -0000 1.3.6.1 @@ -62,7 +62,11 @@ #undef __xstat #undef __lxstat -#if !(defined(__GNUC__) && __GNUC__ >= 2) +#if !defined(_STAT_VER) +#define _STAT_VER 0 +#endif + +#if !(defined(__GLIBC__) && __GLIBC__ >= 2) #warning Check assumptions here about stat/stat64 sizes and offsets #endif Index: stat64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat64.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- stat64.c 24 Mar 2003 22:09:07 -0000 1.3 +++ stat64.c 12 May 2003 11:48:45 -0000 1.3.6.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#ifdef _LARGFILE64_SOURCE + #include <errno.h> #include <assert.h> #include <sys/types.h> @@ -164,3 +166,4 @@ lstat64(const char *filename, struct sta return __lxstat64(_STAT_VER, filename, buf); } +#endif /* defined(_LARGEFILE64_SOURCE) */ Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- statvfs.c 24 Mar 2003 22:09:07 -0000 1.3 +++ statvfs.c 12 May 2003 11:48:45 -0000 1.3.6.1 @@ -41,6 +41,8 @@ * le...@sa... */ +#if !(defined(BSD) || defined(REDSTORM)) + #include <unistd.h> #include <errno.h> #include <assert.h> @@ -136,3 +138,4 @@ err: out: return err; } +#endif /* if !(defined(BSD) || defined(REDSTORM)) */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -u -w -b -B -p -r1.3 -r1.3.6.1 --- statvfs64.c 24 Mar 2003 22:09:07 -0000 1.3 +++ statvfs64.c 12 May 2003 11:48:45 -0000 1.3.6.1 @@ -41,6 +41,7 @@ * le...@sa... */ +#if !(defined(BSD) || defined(REDSTORM)) #include <unistd.h> #include <errno.h> #include <assert.h> @@ -93,3 +94,4 @@ out: } return err; } +#endif /* if !(defined(BSD) || defined(REDSTORM)) */ |
From: Lee W. <lw...@us...> - 2003-05-12 11:48:48
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1:/tmp/cvs-serv27060/drivers/incore Modified Files: Tag: RedStorm fs_incore.c Log Message: Modifications for the Cray RedStorm compute node operating system. This is a BSD-based libc. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -u -w -b -B -p -r1.4 -r1.4.4.1 --- fs_incore.c 23 Apr 2003 18:16:57 -0000 1.4 +++ fs_incore.c 12 May 2003 11:48:45 -0000 1.4.4.1 @@ -56,7 +56,9 @@ #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> +#ifdef _HAVE_STATVFS #include <sys/statvfs.h> +#endif #include <sys/queue.h> #include "sysio.h" @@ -132,7 +134,7 @@ static int _sysio_incore_inop_setattr(st static ssize_t _sysio_incore_dirop_getdirentries(struct inode *ino, char *buf, size_t nbytes, - off64_t *basep); + _SYSIO_OFF_T *basep); static int _sysio_incore_dirop_mkdir(struct pnode *pno, mode_t mode); static int _sysio_incore_dirop_rmdir(struct pnode *pno); static int _sysio_incore_inop_open(struct pnode *pno, int flags, mode_t mode); @@ -151,9 +153,11 @@ static int _sysio_incore_filop_ioctl(str unsigned long int request, va_list ap); static int _sysio_incore_dirop_mknod(struct pnode *pno, mode_t mode, dev_t dev); +#ifdef _HAVE_STATVFS static int _sysio_incore_inop_statvfs(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); +#endif static void _sysio_incore_inop_gone(struct inode *ino); static int _sysio_incore_e_isdir(void); static int _sysio_incore_e_notdir(void); @@ -202,7 +206,9 @@ static struct inode_ops _sysio_incore_di _sysio_incore_inop_sync, _sysio_incore_dirop_ioctl, _sysio_incore_dirop_mknod, +#ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, +#endif _sysio_incore_inop_gone }; @@ -215,7 +221,7 @@ static struct inode_ops _sysio_incore_di (ssize_t (*)(struct inode *, \ char *, \ size_t, \ - off64_t *))_sysio_incore_e_notdir + _SYSIO_OFF_T *))_sysio_incore_e_notdir #define _sysio_incore_filop_mkdir \ (int (*)(struct pnode *, mode_t))_sysio_incore_e_notdir #define _sysio_incore_filop_rmdir \ @@ -249,7 +255,9 @@ static struct inode_ops _sysio_incore_fi _sysio_incore_inop_sync, _sysio_incore_filop_ioctl, _sysio_incore_filop_mknod, +#ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, +#endif _sysio_incore_inop_gone }; @@ -273,7 +281,9 @@ static struct inode_ops _sysio_incore_de _sysio_nodev_inop_sync, _sysio_nodev_inop_ioctl, _sysio_incore_filop_mknod, +#ifdef _HAVE_STATVFS _sysio_incore_inop_statvfs, +#endif _sysio_incore_inop_gone }; @@ -350,14 +360,26 @@ _sysio_incore_init() * Fill in the directory template. */ de = (struct intnl_dirent *)incore_dir_template; - de->d_off = off = de->d_reclen = INCORE_D_RECLEN(1); +#ifdef _DIRENT_HAVE_D_OFF + de->d_off = +#endif + off = de->d_reclen = INCORE_D_RECLEN(1); de->d_type = INCORE_D_TYPEOF(S_IFDIR); de->d_name[0] = '.'; - de = (void *)de + de->d_off; +#ifdef _DIRENT_HAVE_D_NAMLEN + de->d_namlen = 1; +#endif + de = (void *)de + off; de->d_reclen = INCORE_D_RECLEN(2); - de->d_off = off += de->d_reclen; +#ifdef _DIRENT_HAVE_D_OFF + de->d_off = +#endif + off += de->d_reclen; de->d_type = INCORE_D_TYPEOF(S_IFDIR); de->d_name[0] = de->d_name[1] = '.'; +#ifdef _DIRENT_HAVE_D_NAMLEN + de->d_namlen = 2; +#endif return _sysio_fssw_register("incore", &incore_fssw_ops); } @@ -394,9 +416,9 @@ incore_i_alloc(struct incore_filesys *ic } static int -incore_trunc(struct incore_inode *icino, off64_t size, int clear) +incore_trunc(struct incore_inode *icino, _SYSIO_OFF_T size, int clear) { - off64_t n; + _SYSIO_OFF_T n; void *p; if (size < 0) @@ -464,7 +486,12 @@ incore_directory_new(struct incore_files sizeof(incore_dir_template)); de = icino->ici_data; de->d_ino = st->st_ino; - (void *)de += de->d_off; + (void *)de += +#ifdef _DIRENT_HAVE_D_OFF + de->d_off; +#else + de->d_reclen; +#endif de->d_ino = parent->ici_st.st_ino; /* @@ -682,7 +709,10 @@ _sysio_incore_fsop_gone(struct filesys * static void * incore_directory_probe(void *data, size_t siz, - off64_t origin, + _SYSIO_OFF_T origin +#ifndef _DIRENT_HAVE_D_OFF + __IS_UNUSED, +#endif probe_ty entry, probe_ty hole, void *arg) @@ -693,15 +723,21 @@ incore_directory_probe(void *data, de = data; for (;;) { +#ifdef _DIRENT_HAVE_D_OFF assert(de->d_off); +#else + assert(de->d_reclen); +#endif if (entry && (p = (*entry)(de, de->d_reclen, arg))) return p; - n = de->d_off - origin; - if (hole && n > de->d_reclen) { - p = - (*hole)((void *)de + de->d_reclen, - n - de->d_reclen, - arg); + n = +#ifdef _DIRENT_HAVE_D_OFF + de->d_off - origin; +#else + ((void *)de - data) + de->d_reclen; +#endif + if (hole) { + p = (*hole)((void *)de, de->d_reclen, arg); if (p) return p; } @@ -719,7 +755,16 @@ incore_directory_match(struct intnl_dire struct lookup_data *ld) { - if (strncmp(de->d_name, ld->name->name, ld->name->len) == 0) +#if defined(BSD) || defined(REDSTORM) + if (IFTODT(de->d_type) == DT_WHT) + return NULL; +#endif + if ( +#ifdef _DIRENT_HAVE_D_NAMLEN + ld->name->len == de->d_namlen && +#endif + strncmp(de->d_name, ld->name->name, ld->name->len) == 0 + ) return de; ld->de = de; return NULL; @@ -879,6 +924,13 @@ struct copy_info { size_t nbytes; }; +/* + * Eumeration callback. + * + * Note: + * On those systems supporting white-out entries, they are returned. On + * systems without, they are not. + */ static void * incore_directory_enumerate(struct intnl_dirent *de, size_t reclen, @@ -896,7 +948,7 @@ static ssize_t _sysio_incore_dirop_getdirentries(struct inode *ino, char *buf, size_t nbytes, - off64_t *basep) + _SYSIO_OFF_T *basep) { struct incore_inode *icino = I2IC(ino); off_t off; @@ -960,7 +1012,9 @@ incore_directory_insert(struct incore_in size_t reclen; struct lookup_data lookup_data; struct intnl_dirent *de; + size_t xt; size_t n; + size_t r; reclen = INCORE_D_RECLEN(name->len); INCORE_LD_INIT(&lookup_data, reclen, name); @@ -974,38 +1028,74 @@ incore_directory_insert(struct incore_in if (de) return -EEXIST; de = lookup_data.de; - n = de->d_off; - if (n >= (size_t )parent->ici_st.st_size) { + xt = (void *)lookup_data.de - parent->ici_data; + n = +#ifdef _DIRENT_HAVE_D_OFF + de->d_off; +#else + xt + de->d_reclen; +#endif + r = +#ifdef _DIRENT_HAVE_D_OFF + de->d_reclen; +#else + INCORE_D_RECLEN(de->d_namlen); +#endif + if (!parent->ici_st.st_size || + xt + r + reclen > (size_t )parent->ici_st.st_size) { int err; - size_t xt; - xt = (void *)lookup_data.de - parent->ici_data; - err = - incore_trunc(parent, - ((size_t )((void *)de - parent->ici_data) + - de->d_reclen + - reclen), - 1); + err = incore_trunc(parent, xt + r + reclen, 1); if (err) return err; de = parent->ici_data + xt; n = parent->ici_st.st_size; } +#ifdef _DIRENT_HAVE_D_OFF + de->d_off = xt + r; /* trim */ +#else + de->d_reclen = r; +#endif + (void *)de += r; /* reposition */ + xt += r; + +#ifndef _DIRENT_HAVE_D_OFF /* - * Fix previous entry. + * Will we split this hole or use all of it? */ - de->d_off = (void *)de - parent->ici_data + de->d_reclen; + if (lookup_data.hole.len - reclen && + lookup_data.hole.len - reclen <= INCORE_D_RECLEN(1)) + reclen = lookup_data.hole.len; +#endif /* * Insert new. */ - (void *)de += de->d_reclen; de->d_ino = inum; +#ifdef _DIRENT_HAVE_D_OFF de->d_off = n; +#endif de->d_reclen = reclen; de->d_type = type; (void )memcpy(de->d_name, name->name, name->len); +#ifdef _DIRENT_HAVE_D_NAMLEN + de->d_namlen = name->len; +#endif + +#ifndef _DIRENT_HAVE_D_OFF + xt += reclen; + if (n - xt) { + /* + * White-out remaining part of the hole. + */ + (void *)de += reclen; + de->d_ino = 0; + de->d_reclen = n - xt; + de->d_type = DT_WHT; + de->d_namlen = 0; + } +#endif /* * Update attributes to reflect the new entry. @@ -1095,6 +1185,11 @@ incore_unlink_entry(struct incore_inode { struct lookup_data lookup_data; struct intnl_dirent *de; +#ifndef _DIRENT_HAVE_D_OFF + size_t reclen; +#else + size_t off; +#endif if (!S_ISDIR(icino->ici_st.st_mode)) return -ENOTDIR; @@ -1111,8 +1206,18 @@ incore_unlink_entry(struct incore_inode return -ENOENT; assert((size_t )((void *)de - icino->ici_data) >= sizeof(incore_dir_template)); - lookup_data.de->d_off = de->d_off; /* unlink */ - (void )memset(de, 0, de->d_reclen); /* clear */ +#ifndef _DIRENT_HAVE_D_OFF + reclen = de->d_reclen; +#else + off = de->d_off; +#endif + (void )memset(de, 0, reclen); +#ifndef _DIRENT_HAVE_D_OFF + de->d_type = (__uint8_t )DTTOIF(DT_WHT); + de->d_reclen = reclen; +#else + lookup_data.de->d_off = off; +#endif return 0; } @@ -1304,11 +1409,11 @@ incore_doio(ssize_t (*f)(struct incore_i static ssize_t incore_read(struct incore_inode *icino, off_t off, char *buf, size_t nbytes) { - off64_t n; + _SYSIO_OFF_T n; if (!nbytes || off > icino->ici_st.st_size) return 0; - n = (off64_t )nbytes; + n = (_SYSIO_OFF_T )nbytes; if (!(n > 0 && (size_t )n == nbytes)) return -EINVAL; if (n > icino->ici_st.st_size - off) @@ -1334,11 +1439,11 @@ incore_write(struct incore_inode *icino, size_t nbytes) { int err; - off64_t n; + _SYSIO_OFF_T n; if (!nbytes) return 0; - n = (off64_t )nbytes; + n = (_SYSIO_OFF_T )nbytes; if (!(n > 0 && (size_t )n == nbytes)) return -EINVAL; if (off + n > icino->ici_st.st_size) { @@ -1430,7 +1535,7 @@ _sysio_incore_dirop_mknod(struct pnode * return -EINVAL; /* - * Must create a new, regular, file. + * Initialize attributes. */ (void )memset(&stat, 0, sizeof(stat)); stat.st_dev = pno->p_parent->p_base->pb_ino->i_fs->fs_dev; @@ -1452,6 +1557,7 @@ _sysio_incore_dirop_mknod(struct pnode * return incore_create(pno, &stat); } +#ifdef _HAVE_STATVFS static int _sysio_incore_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -1484,6 +1590,7 @@ _sysio_incore_inop_statvfs(struct pnode return 0; } +#endif void _sysio_incore_inop_gone(struct inode *ino) |
From: Lee W. <lw...@us...> - 2003-05-12 11:48:48
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv27060/drivers/native Modified Files: Tag: RedStorm fs_native.c Log Message: Modifications for the Cray RedStorm compute node operating system. This is a BSD-based libc. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.11 retrieving revision 1.11.4.1 diff -u -w -b -B -p -r1.11 -r1.11.4.1 --- fs_native.c 23 Apr 2003 18:18:38 -0000 1.11 +++ fs_native.c 12 May 2003 11:48:45 -0000 1.11.4.1 @@ -57,8 +57,12 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/fcntl.h> +#if 0 #include <sys/vfs.h> +#endif +#ifdef _HAVE_STATVFS #include <sys/statvfs.h> +#endif #include <utime.h> #include <sys/queue.h> @@ -133,12 +137,6 @@ 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 @@ -182,7 +180,7 @@ static int native_inop_setattr(struct pn static ssize_t native_getdirentries(struct inode *ino, char *buf, size_t nbytes, - off64_t *basep); + _SYSIO_OFF_T *basep); static int native_inop_mkdir(struct pnode *pno, mode_t mode); static int native_inop_rmdir(struct pnode *pno); static int native_inop_symlink(struct pnode *pno, const char *data); @@ -204,9 +202,11 @@ static int native_inop_ioctl(struct inod unsigned long int request, va_list ap); static int native_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); +#ifdef _HAVE_STATVFS static int native_inop_statvfs(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); +#endif static void native_inop_gone(struct inode *ino); static struct inode_ops native_i_ops = { @@ -229,7 +229,9 @@ static struct inode_ops native_i_ops = { native_inop_datasync, native_inop_ioctl, native_inop_mknod, +#ifdef _HAVE_STATVFS native_inop_statvfs, +#endif native_inop_gone }; @@ -774,28 +776,75 @@ out: return err; } +static int +native_pos(int fd, +#ifdef _LARGEFILE64_SOURCE + loff_t *offset +#else + _SYSIO_OFF_T *offset +#endif + ) +{ + + assert(fd >= 0); + assert(*offset >= 0); + +#ifdef _LARGEFILE64_SOURCE + { + int err; + err = + syscall(SYS_llseek, + (unsigned int)nino->ni_fd, + (unsigned int)*offset >> 32, + (unsigned int)*offset, + offset, + SEEK_SET); + if (err == -1) + return -errno; + } +#else + *offset = + syscall(SYS_lseek, + fd, + *offset, + SEEK_SET); + if (*offset == -1) + return -errno; +#endif + + return 0; +} + + static ssize_t native_getdirentries(struct inode *ino, char *buf, size_t nbytes, - off64_t *basep) + _SYSIO_OFF_T *basep) { struct native_inode *nino = I2NI(ino); + int err; +#ifdef _LARGEFILE64_SOURCE loff_t result; +#else + _SYSIO_OFF_T result; +#endif ssize_t cc; assert(nino->ni_fd >= 0); result = *basep; - if (*basep != nino->ni_fpos && - syscall(SYS_lseek, - nino->ni_fd, - *basep, - &result, - SEEK_SET) == -1) - return -errno; + if (*basep != nino->ni_fpos) { + err = native_pos(nino->ni_fd, &result); + if (err) + return err; + } nino->ni_fpos = result; +#ifndef USE_NATURAL_GETDENTS cc = syscall(SYS_getdents64, nino->ni_fd, buf, nbytes); +#else + cc = syscall(SYS_getdents, nino->ni_fd, buf, nbytes); +#endif if (cc < 0) return -errno; nino->ni_fpos += cc; @@ -1002,13 +1051,14 @@ doio(ssize_t (*f)(int, const struct iove { struct native_inode *nino = I2NI(ino); struct ioctx *ioctx; +#ifdef _LARGEFILE64_SOURCE loff_t result; +#else + _SYSIO_OFF_T result; +#endif assert(nino->ni_fd >= 0); - if (ioargs->ioarg_iovlen && (int )ioargs->ioarg_iovlen < 0) - return -EINVAL; - /* * Get a new IO context. */ @@ -1016,9 +1066,15 @@ doio(ssize_t (*f)(int, const struct iove if (!ioctx) return -ENOMEM; + if ((ioargs->ioarg_iovlen && (int )ioargs->ioarg_iovlen < 0) || + !(S_ISCHR(ino->i_mode) || + S_ISSOCK(ino->i_mode) || + S_ISFIFO(ino->i_mode))) + return -EINVAL; + /* * This implementation first positions the real system descriptor, then - * performs the operation. This is silly because it's not atomic. + * performs the operation. This is not atomic. * * An alternative, more complex, less efficient but atomic, * implementation might consider each entry of the iovec separately. @@ -1029,18 +1085,17 @@ doio(ssize_t (*f)(int, const struct iove * Allows us to access pipes and fifos. */ result = nino->ni_fpos; - if (ioctx->ioctx_offset != nino->ni_fpos && - !(S_ISCHR(ino->i_mode) || - S_ISSOCK(ino->i_mode) || - S_ISFIFO(ino->i_mode)) && - syscall(SYS_lseek, - nino->ni_fd, - ioctx->ioctx_offset, - &result, - SEEK_SET) == -1) { + if (ioctx->ioctx_offset != nino->ni_fpos) { + int err; + + err = native_pos(nino->ni_fd, &result); + if (err) { ioctx->ioctx_cc = -1; - ioctx->ioctx_errno = errno; - } else { + ioctx->ioctx_errno = -err; + goto out; + } + } + /* * Call the appropriate (read/write) IO function to * transfer the data now. @@ -1052,9 +1107,9 @@ doio(ssize_t (*f)(int, const struct iove ioctx->ioctx_errno = errno; if (ioctx->ioctx_cc > 0) nino->ni_fpos += ioctx->ioctx_cc; - } *ioctxp = ioctx; +out: return 0; } @@ -1128,6 +1183,7 @@ native_inop_mknod(struct pnode *pno __IS return -ENOSYS; } +#ifdef _HAVE_STATVFS static int native_inop_statvfs(struct pnode *pno, struct inode *ino, @@ -1173,6 +1229,7 @@ native_inop_statvfs(struct pnode *pno, buf->f_namemax = fs.f_namelen; return 0; } +#endif static int native_inop_sync(struct inode *ino) @@ -1189,7 +1246,12 @@ native_inop_datasync(struct inode *ino) assert(I2NI(ino)->ni_fd >= 0); - return syscall(__SYS_FDATASYNC, I2NI(ino)->ni_fd); +#ifdef NATIVE_FDATASYNC + return syscall(NATIVE_FDATASYNC, I2NI(ino)->ni_fd); +#else +#warning No fdatasync system call -- Using fsync instead! + return syscall(SYS_fsync, I2NI(ino)->ni_fd); +#endif } static int |
From: Lee W. <lw...@us...> - 2003-05-12 11:48:48
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv27060/include Modified Files: Tag: RedStorm dev.h file.h inode.h sysio.h Log Message: Modifications for the Cray RedStorm compute node operating system. This is a BSD-based libc. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -u -w -b -B -p -r1.2 -r1.2.6.1 --- dev.h 24 Mar 2003 22:09:04 -0000 1.2 +++ dev.h 12 May 2003 11:48:45 -0000 1.2.6.1 @@ -84,7 +84,7 @@ extern const struct inode_ops _sysio_nod (ssize_t (*)(struct inode *, \ char *, \ size_t , \ - off64_t *))_sysio_dev_e_notdir + _SYSIO_OFF_T *))_sysio_dev_e_notdir #define _sysio_nodev_inop_mkdir \ (int (*)(struct pnode *, \ mode_t))_sysio_dev_e_notdir @@ -131,10 +131,12 @@ extern const struct inode_ops _sysio_nod (int (*)(struct pnode *, \ mode_t, \ dev_t))_sysio_dev_e_notdir +#ifdef _HAVE_STATVFS #define _sysio_nodev_inop_statvfs \ (int (*)(struct pnode *, \ struct inode *, \ struct intnl_statvfs *))_sysio_dev_e_inval +#endif #define _sysio_nodev_inop_gone \ (void (*)(struct inode *ino))_sysio_dev_noop Index: file.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/file.h,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- file.h 24 Mar 2003 22:09:05 -0000 1.5 +++ file.h 12 May 2003 11:48:45 -0000 1.5.6.1 @@ -52,7 +52,7 @@ */ struct file { struct inode *f_ino; /* path node */ - off64_t f_pos; /* current stream pos */ + _SYSIO_OFF_T f_pos; /* current stream pos */ unsigned f_ref; /* ref count */ int f_flags; /* open/fcntl flags */ }; Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -u -w -b -B -p -r1.6 -r1.6.4.1 --- inode.h 23 Apr 2003 19:45:51 -0000 1.6 +++ inode.h 12 May 2003 11:48:45 -0000 1.6.4.1 @@ -63,7 +63,9 @@ struct inode; struct intent; struct intnl_dirent; struct intnl_stat; +#ifdef _HAVE_STATVFS struct intnl_statvfs; +#endif struct io_arguments; struct ioctx; @@ -87,7 +89,7 @@ struct inode_ops { ssize_t (*inop_getdirentries)(struct inode *ino, char *buf, size_t nbytes, - off64_t *basep); + _SYSIO_OFF_T *basep); int (*inop_mkdir)(struct pnode *pno, mode_t mode); int (*inop_rmdir)(struct pnode *pno); int (*inop_symlink)(struct pnode *pno, const char *data); @@ -107,9 +109,11 @@ struct inode_ops { int (*inop_datasync)(struct inode *ino); int (*inop_ioctl)(struct inode *ino, unsigned long int request, va_list ap); int (*inop_mknod)(struct pnode *pno, mode_t mode, dev_t dev); +#ifdef _HAVE_STATVFS int (*inop_statvfs)(struct pnode *pno, struct inode *ino, struct intnl_statvfs *buf); +#endif void (*inop_gone)(struct inode *ino); }; @@ -343,7 +347,7 @@ struct nameidata { struct io_arguments { const struct iovec *ioarg_iovec; /* io vector */ size_t ioarg_iovlen; /* iovec length */ - off64_t ioarg_offset; /* beginning offset */ + _SYSIO_OFF_T ioarg_offset; /* beginning offset */ void (*ioarg_completion)(void *); /* callback */ void *ioarg_completion_arg; /* callback data */ }; @@ -370,7 +374,7 @@ struct ioctx { struct inode *ioctx_ino; /* i-node */ const struct iovec *ioctx_iovec; /* scatter/gather vec */ size_t ioctx_iovlen; /* iovec length */ - off64_t ioctx_offset; /* file offset */ + _SYSIO_OFF_T ioctx_offset; /* file offset */ ssize_t ioctx_cc; /* rtn char count */ int ioctx_errno; /* error number */ void (*ioctx_cb)(void *); /* callback */ Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -u -w -b -B -p -r1.7 -r1.7.6.1 --- sysio.h 26 Mar 2003 00:06:04 -0000 1.7 +++ sysio.h 12 May 2003 11:48:45 -0000 1.7.6.1 @@ -80,6 +80,15 @@ typedef void *ioid_t; #endif /* + * Define internal file-offset type. + */ +#ifdef _LARGEFILE64_SOURCE +#define _SYSIO_OFF_T off64_t +#else +#define _SYSIO_OFF_T off_t +#endif + +/* * Internally, all directory entries are carried in the 64-bit capable * structure. */ @@ -101,6 +110,7 @@ struct dirent; #endif struct stat; +#ifdef _HAVE_STATVFS #ifdef _LARGEFILE64_SOURCE #define intnl_statvfs statvfs64 #else @@ -108,6 +118,7 @@ struct stat; #define INTNL_STATVFS_IS_NATURAL 1 #endif struct statvfs; +#endif struct iovec; struct pnode; @@ -140,14 +151,20 @@ extern int ftruncate(int fd, off_t lengt extern char *getcwd(char *buf, size_t size); extern off_t lseek(int fd, off_t offset, int whence); extern int lstat(const char *path, struct stat *buf); +#if defined(BSD) || defined(REDSTORM) +extern ssize_t getdirentries(int fd, char *buf, int nbytes , long *basep); +#else extern ssize_t getdirentries(int fd, char *buf, size_t nbytes , off_t *basep); +#endif extern int mkdir(const char *path, mode_t mode); extern int open(const char *path, int flag, ...); extern int creat(const char *path, mode_t mode); extern int stat(const char *path, struct stat *buf); +#ifdef _HAVE_STATVFS extern int statvfs(const char *path, struct statvfs *buf); -extern int truncate(const char *path, off_t length); extern int fstatvfs(int fd, struct statvfs *buf); +#endif +extern int truncate(const char *path, off_t length); extern int rmdir(const char *path); extern int symlink(const char *path1, const char *path2); extern int unlink(const char *path); |
From: Lee W. <lw...@us...> - 2003-05-12 11:48:48
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv27060 Modified Files: Tag: RedStorm configure.in Log Message: Modifications for the Cray RedStorm compute node operating system. This is a BSD-based libc. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -u -w -b -B -p -r1.5 -r1.5.6.1 --- configure.in 26 Mar 2003 00:05:59 -0000 1.5 +++ configure.in 12 May 2003 11:48:45 -0000 1.5.6.1 @@ -120,7 +120,7 @@ AC_TRY_COMPILE([ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h>], [ -struct stat64 st64; printf("%u\n", sizeof(struct stat64));], +struct stat64 st64;], sysio_largefile64_source_required=no, sysio_largefile64_source_required=maybe) if test x$sysio_largefile64_source_required = xmaybe; then @@ -129,7 +129,7 @@ if test x$sysio_largefile64_source_requi #include <sys/types.h> #include <sys/stat.h> #include <unistd.h>], [ -int i; i = 0;], +struct stat64 st64;], sysio_largefile64_source_required=yes, sysio_largefile64_source_required=no) fi @@ -173,15 +173,19 @@ fi # Check for fdatasync syscall # AC_MSG_CHECKING(for fdatasync system call) +if test x$alpha_linux_env == xyes; then + _syscallnum=SYS_osf_fdatasync +else + _syscallnum=SYS_fdatasync +fi AC_TRY_COMPILE([ -#include <syscall.h>], -[int fd = 0; -syscall(SYS_fdatasync, fd);], +#include <syscall.h>], [ +syscall($_syscallnum, 0);], syscall_fdatasync_exists=yes, syscall_fdatasync_exists=no) AC_MSG_RESULT($syscall_fdatasync_exists) -if test x$syscall_fdatasync_exists = xno; then - AC_DEFINE(USE_NATIVE_FDATASYNC) +if test x$syscall_fdatasync_exists = xyes; then + AC_DEFINE_UNQUOTED(NATIVE_FDATASYNC, $_syscallnum) fi # Check for SYS_utime @@ -208,6 +212,20 @@ st.__st_ino = 0;], AC_MSG_RESULT($have__st_ino) if test x$have__st_ino = xyes; then AC_DEFINE(HAVE__ST_INO) +fi + +# Check for getdents64 call +# +AC_MSG_CHECKING(for getdents64 system call) +AC_TRY_COMPILE([ +#include <syscall.h>], +[ + syscall(SYS_getdents64, 0, (char *)0, 0);], + syscall_getdents64_exists=yes, + syscall_getdents64_exists=no) +AC_MSG_RESULT($syscall_getdents64_exists) +if test x$syscall_getdents64_exists = xno; then + AC_DEFINE(USE_NATURAL_GETDENTS) fi AC_MSG_CHECKING(whether .text pseudo-op must be used) |
From: Lee W. <lw...@us...> - 2003-05-10 14:44:01
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1:/tmp/cvs-serv11508 Modified Files: Makefile.am Log Message: Mod, from Brad Hull @ Cray Inc., to support building in alternate directories. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- Makefile.am 24 Mar 2003 22:09:49 -0000 1.8 +++ Makefile.am 10 May 2003 14:43:58 -0000 1.9 @@ -84,8 +84,8 @@ test_stdfd_DEPENDENCIES=$(LIBS) EXTRA_DIST=gendrvdata.sh test.h -drv_data.c: $(CONFIG_DEPENDENCIES) gendrvdata.sh +drv_data.c: $(CONFIG_DEPENDENCIES) $(top_srcdir)/tests/gendrvdata.sh test -z "drv_data.c" && rm -f drv_data.c; \ - $(SHELL) gendrvdata.sh $(DRIVERS) > drv_data.c + $(SHELL) $(top_srcdir)/tests/gendrvdata.sh $(DRIVERS) > drv_data.c include $(top_srcdir)/Rules.make |
From: Ruth K. <rk...@us...> - 2003-05-01 22:53:56
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1:/tmp/cvs-serv29892 Added Files: Tag: cplant cplant-yod.h Log Message: add cplant yod function definitions --- 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... */ /* * cplant yod I/O functions */ int chmod_yod(const char* path, mode_t); int chown_yod(const char* path, uid_t, gid_t); int stat_yod(const char *path, struct stat *sbuf); int fstat_yod(int fd, struct stat *buf); int statfs_yod(const char *path, struct statfs *sbuf); int fstatfs_yod(int fd, struct statfs *buf); int mkdir_yod(const char *path, mode_t mode); int rmdir_yod(const char *path); int getdirentries_yod(int fd, char *buf, size_t nbytes, loff_t *basep); int link_yod(const char *path1, const char *path2); int unlink_yod(const char *path); int symlink_yod(const char *path1, const char *path2 ); int open_yod(const char *fname, int flags, mode_t mode); int close_yod(int); ssize_t write_yod(int fd, const void *buff, size_t nbytes); ssize_t read_yod(int fd, void *buff, size_t nbytes); int fsync_yod(int fd); int truncate_yod(const char *path, off_t length); int ftruncate_yod(int fd, long length); off_t lseek_yod(int fd, off_t offset, int whence); |
From: Ruth K. <rk...@us...> - 2003-05-01 22:52:51
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1:/tmp/cvs-serv29533 Modified Files: Tag: cplant fs_yod.c Log Message: Remove dependency on cplant include file, fix warnings Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/Attic/fs_yod.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -w -b -B -p -r1.1.2.3 -r1.1.2.4 --- fs_yod.c 1 May 2003 15:44:42 -0000 1.1.2.3 +++ fs_yod.c 1 May 2003 22:52:46 -0000 1.1.2.4 @@ -74,11 +74,13 @@ * Remote file system driver * calls are re-directed to the initiating yod */ +#include "cplant-yod.h" /* stat struct used by yod, which * is not compiled with __USE_FILE_OFFSET64 */ #define __yod_stat stat +#ifdef ALPHA_LINUX #define COPY_STAT(src, dest) \ do { \ memset((dest), 0, sizeof((*dest))); \ @@ -98,6 +100,25 @@ do { (dest)->st_flags = (src)->st_flags; \ (dest)->st_gen = (src)->st_gen; \ } while (0); +#else +#define COPY_STAT(src, dest) \ +do { \ + memset((dest), 0, sizeof((*dest))); \ + (dest)->st_dev = (src)->st_dev; \ + (dest)->st_ino = (src)->st_ino; \ + (dest)->st_mode = (src)->st_mode; \ + (dest)->st_nlink = (src)->st_nlink; \ + (dest)->st_uid = (src)->st_uid; \ + (dest)->st_gid = (src)->st_gid; \ + (dest)->st_rdev = (src)->st_rdev; \ + (dest)->st_size = (src)->st_size; \ + (dest)->st_atime = (src)->st_atime; \ + (dest)->st_mtime = (src)->st_mtime; \ + (dest)->st_ctime = (src)->st_ctime; \ + (dest)->st_blksize = (src)->st_blksize; \ + (dest)->st_blocks = (src)->st_blocks; \ +} while (0); +#endif /* * Yod file identifiers format. @@ -238,10 +259,12 @@ static int yod_fstat(int fd, struct intnl_stat *buf) { int err; + struct __yod_stat stbuf; - err = fstat_yod(fd, buf); + err = fstat_yod(fd, &stbuf); if (err) err = -errno; + COPY_STAT(&stbuf, buf); return err; } @@ -715,14 +738,12 @@ yod_getdirentries(struct inode *ino, result = *basep; if (*basep != nino->ni_fpos && - lseek_yod( - nino->ni_fd, + (result = lseek_yod(nino->ni_fd, *basep, - &result, - SEEK_SET) == -1) + SEEK_SET) == -1)) return -errno; nino->ni_fpos = result; - cc = getdirentries_yod(nino->ni_fd, buf, nbytes); + cc = getdirentries_yod(nino->ni_fd, buf, nbytes, &result); if (cc < 0) return -errno; nino->ni_fpos += cc; @@ -952,11 +973,9 @@ doio(ssize_t (*f)(int, const struct iove !(S_ISCHR(ino->i_mode) || S_ISSOCK(ino->i_mode) || S_ISFIFO(ino->i_mode)) && - lseek_yod( - nino->ni_fd, + (result = lseek_yod(nino->ni_fd, ioctx->ioctx_offset, - &result, - SEEK_SET) == -1) { + SEEK_SET) == -1)) { ioctx->ioctx_cc = -1; ioctx->ioctx_errno = errno; } else { @@ -983,8 +1002,14 @@ doio(ssize_t (*f)(int, const struct iove static ssize_t _readv(int fd, const struct iovec *vector, int count) { + int i; + ssize_t total; - return read_yod(fd, vector, count); + for (i = 0; i < count; i++) + total += read_yod(fd, + vector[i].iov_base, + vector[i].iov_len); + return total; } static int @@ -1032,7 +1057,7 @@ yod_inop_iodone(struct ioctx *ioctxp __I } static int -yod_inop_fcntl(struct inode *ino, int cmd, va_list ap) +yod_inop_fcntl(struct inode *ino __IS_UNUSED, int cmd, va_list ap __IS_UNUSED) { switch (cmd) { |
From: Ruth K. <rk...@us...> - 2003-05-01 22:47:13
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1:/tmp/cvs-serv27639 Modified Files: Tag: cplant stdfd.c Log Message: Fix implicit declaration warnings Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -u -w -b -B -p -r1.2.2.2 -r1.2.2.3 --- stdfd.c 1 May 2003 15:41:50 -0000 1.2.2.2 +++ stdfd.c 1 May 2003 22:47:09 -0000 1.2.2.3 @@ -59,6 +59,8 @@ #include "stdfd.h" #ifdef CPLANT_YOD +#include <sys/statfs.h> +#include "cplant-yod.h" #define dowrite(f, b, n) write_yod(f, b, n) #define doread(f, b, n) read_yod(f, b, n) #else |
From: Ruth K. <rk...@us...> - 2003-05-01 22:46:14
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv26814 Modified Files: Tag: cplant configure.in Log Message: Remove dependency on cplant include file Also, with CFLAGS=-Werror set some of the configure checks were failing erroneously. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -u -w -b -B -p -r1.5.2.2 -r1.5.2.3 --- configure.in 29 Apr 2003 19:08:39 -0000 1.5.2.2 +++ configure.in 1 May 2003 22:46:09 -0000 1.5.2.3 @@ -67,27 +67,17 @@ AC_ARG_WITH(stdfd-dev, AM_CONDITIONAL(WITH_STDFD_DEV, test x$with_stdfd_dev = xyes) AC_ARG_WITH(cplant_yod, - [ --with-cplant-yod=[portals-include-path] build cplant yod I/O driver], + [ --with-cplant-yod build cplant yod I/O driver], [ case "${withval}" in - yes) - AC_MSG_ERROR(missing include dir argument for --with-cplant-yod);; - no);; - *) - if test -d ${withval}; then - PORTALS_INCLUDE="-I${withval} -I${withval}/sys" - YOD_DRIVER_INCLUDE="-I../../drivers/yod" - if test x${with_stdfd_dev} != xyes; then + 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 - else - AC_MSG_ERROR(include dir ${withval} not found for --with-cplant-yod) 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 != xno) -AC_SUBST(PORTALS_INCLUDE) -AC_SUBST(YOD_DRIVER_INCLUDE) +AM_CONDITIONAL(WITH_CPLANT_YOD, test x$with_cplant_yod = xyes) # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses @@ -170,7 +160,8 @@ AC_MSG_RESULT($alpha_linux_env) 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; @@ -190,7 +181,8 @@ fi # AC_MSG_CHECKING(for fdatasync system call) AC_TRY_COMPILE([ -#include <syscall.h>], +#include <syscall.h> +extern int syscall();], [int fd = 0; syscall(SYS_fdatasync, fd);], syscall_fdatasync_exists=yes, @@ -204,7 +196,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) @@ -212,7 +205,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: Ruth K. <rk...@us...> - 2003-05-01 15:44:50
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1:/tmp/cvs-serv19380 Modified Files: Tag: cplant Makefile.am fs_yod.c fs_yod.h Removed Files: Tag: cplant portals_io.c portals_io.h Log Message: make calls to cplant libs existing functions Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/Attic/Makefile.am,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 --- Makefile.am 28 Apr 2003 20:21:39 -0000 1.1.2.1 +++ Makefile.am 1 May 2003 15:44:42 -0000 1.1.2.2 @@ -2,8 +2,7 @@ lib_LIBRARIES = libsysio_yod.a EXTRA_DIST = fs_yod.h -libsysio_yod_a_SOURCES = fs_yod.c portals_io.c +libsysio_yod_a_SOURCES = fs_yod.c include $(top_srcdir)/Rules.make -AM_CPPFLAGS += $(PORTALS_INCLUDE) Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/Attic/fs_yod.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 --- fs_yod.c 29 Apr 2003 17:13:07 -0000 1.1.2.2 +++ fs_yod.c 1 May 2003 15:44:42 -0000 1.1.2.3 @@ -61,6 +61,7 @@ #include <sys/statvfs.h> #include <utime.h> #include <sys/queue.h> +#include <sys/uio.h> #include "sysio.h" #include "fs.h" @@ -68,52 +69,16 @@ #include "inode.h" #include "fs_yod.h" -#include "portals_io.h" /* - * Remote file system driver. Assumes that file ops are - * redirected via portals to another host. - * - * The unique remote server is identified by nid, pid, ptl. - */ -server_t _yod_server; - -/* - * store the actual file handle pointers given by yod - * via remote open. std{in, out, err} are retrieved in - * startup.c and passed into this lib via _sysio_yod_init - */ -off_t _yodfd_handles[FOPEN_MAX]; - -/* - * remote calls require ids + * Remote file system driver + * calls are re-directed to the initiating yod */ -uid_t _yod_uid, _yod_euid; -gid_t _yod_gid, _yod_egid; -#if defined(ALPHA_LINUX) - -/* stat struct from asm/stat.h, as returned - * by alpha linux kernel +/* stat struct used by yod, which + * is not compiled with __USE_FILE_OFFSET64 */ -struct __native_stat { - unsigned int st_dev; - unsigned int st_ino; - unsigned int st_mode; - unsigned int st_nlink; - unsigned int st_uid; - unsigned int st_gid; - unsigned int st_rdev; - long st_size; - unsigned long st_atime; - unsigned long st_mtime; - unsigned long st_ctime; - unsigned int st_blksize; - int st_blocks; - unsigned int st_flags; - unsigned int st_gen; -}; - +#define __yod_stat stat #define COPY_STAT(src, dest) \ do { \ memset((dest), 0, sizeof((*dest))); \ @@ -134,11 +99,6 @@ do { (dest)->st_gen = (src)->st_gen; \ } while (0); -#else -#define __native_stat intnl_stat -#define COPY_STAT(src, dest) *(dest) = *(src) -#endif - /* * Yod file identifiers format. */ @@ -243,8 +203,10 @@ static struct filesys_ops yod_inodesys_o yod_fsop_gone }; -static ino_t yod_inum = 1; -static struct qstr noname = { NULL, 0, 0 }; +/* + * Placeholder internal mount as in native driver + */ +static struct mount *yod_internal_mount = NULL; /* * Given i-node, return driver private part. @@ -259,9 +221,9 @@ static int yod_stat(const char *path, struct intnl_stat *buf) { int err; - struct __native_stat stbuf; + struct __yod_stat stbuf; - err = rpc_stat(path, buf); + err = stat_yod(path, &stbuf); if (err) err = -errno; COPY_STAT(&stbuf, buf); @@ -277,7 +239,7 @@ yod_fstat(int fd, struct intnl_stat *buf { int err; - err = rpc_fstat(fd, buf); + err = fstat_yod(fd, buf); if (err) err = -errno; @@ -327,25 +289,9 @@ yod_i_new(struct filesys *fs, struct int /* * Initialize this driver. */ -server_t _yod_server; int -_sysio_yod_init(int nid, int pid, int ptl, - off_t yod_stdin, - off_t yod_stdout, - off_t yod_stderr) -{ - _yod_server.nid = nid; - _yod_server.pid = pid; - _yod_server.ptl = ptl; - - _yodfd_handles[0] = yod_stdin; - _yodfd_handles[1] = yod_stdout; - _yodfd_handles[2] = yod_stderr; - - _yod_uid = getuid(); - _yod_gid = getgid(); - _yod_euid = geteuid(); - _yod_egid = getegid(); +_sysio_yod_init() +{ /* * Capture current process umask and reset our process umask to @@ -357,69 +303,147 @@ _sysio_yod_init(int nid, int pid, int pt return _sysio_fssw_register("yod", &yod_fssw_ops); } +/* + * Create private, internal, view of the hosts name space. + */ static int -yod_fsswop_mount(const char *source, - unsigned flags, - const void *data, - struct pnode *tocover, - struct mount **mntp) +create_internal_namespace() { int err; - struct filesys *fs = NULL; - struct inode *rooti = NULL; + struct mount *mnt; + struct inode *rootino; + struct pnode_base *rootpb; + static struct qstr noname = { NULL, 0, 0 }; + struct filesys *fs; struct intnl_stat stbuf; - struct pnode_base *rootpb = NULL; - struct mount *mnt = NULL; - + if (yod_internal_mount) { /* - * Create new fs - * private data, the portals target, was imported - * at init time + * Reentered! */ - fs = _sysio_fs_new(&yod_inodesys_ops, flags, &_yod_server); + abort(); + } + + /* + * We maintain an artificial, internal, name space in order to + * have access to fully qualified path names in the various routines. + * Initialize that name space now. + */ + mnt = NULL; + rootino = NULL; + rootpb = NULL; + fs = _sysio_fs_new(&yod_inodesys_ops, 0, NULL); if (!fs) { err = -ENOMEM; goto error; } /* - * Create root inode + * Get root i-node. */ - err = yod_stat(source, &stbuf); - if (err) { - err = -errno; + err = yod_stat("/", &stbuf); + if (err) goto error; - } - rooti = yod_i_new(fs, &stbuf); - if (!rooti) { + rootino = yod_i_new(fs, &stbuf); + if (!rootino) { err = -ENOMEM; goto error; } - rootpb = _sysio_pb_new(&noname, NULL, rooti); + + /* + * Generate base path-node for root. + */ + rootpb = _sysio_pb_new(&noname, NULL, rootino); if (!rootpb) { err = -ENOMEM; goto error; } - FS_REF(fs); - return err; + /* + * Mount it. This name space is disconnected from the + * rest of the system -- Only available within this driver. + */ + err = _sysio_do_mount(fs, rootpb, 0, NULL, &mnt); + if (err) + goto error; + yod_internal_mount = mnt; + return 0; error: + if (mnt) { + if (_sysio_do_unmount(mnt) != 0) + abort(); + fs = NULL; + rootpb = NULL; + rootino = NULL; + } if (rootpb) _sysio_pb_gone(rootpb); - if (rooti->i_private) - free(rooti->i_private); - if (rooti) { - I_RELE(rooti); - free(rooti); - } - if (fs) + if (fs) { FS_RELE(fs); + _sysio_fs_gone(fs); + } return err; } +static int +yod_fsswop_mount(const char *source, + unsigned flags, + const void *data __IS_UNUSED, + struct pnode *tocover, + struct mount **mntp) +{ + int err; + struct nameidata nameidata; + struct mount *mnt; + + /* + * Caller must use fully qualified path names when specifying + * the source. + */ + if (*source != '/') + return -ENOENT; + + if (!yod_internal_mount) { + err = create_internal_namespace(); + if (err) + return err; + } + + /* + * Lookup the source in the internally maintained name space. + */ + ND_INIT(&nameidata, 0, source, yod_internal_mount->mnt_root, NULL); + err = _sysio_path_walk(yod_internal_mount->mnt_root, &nameidata); + if (err) + return err; + + /* + * Have path-node specified by the given source argument. Let the + * system finish the job, now. + */ + err = + _sysio_do_mount(yod_internal_mount->mnt_fs, + nameidata.nd_pno->p_base, + flags, + tocover, + &mnt); + /* + * Release the internal name space pnode and clean up any + * aliases we might have generated. We really don't need to cache them + * as they are only used at mount time.. + */ + P_RELE(nameidata.nd_pno); + (void )_sysio_p_prune(yod_internal_mount->mnt_root); + + if (!err) { + FS_REF(yod_internal_mount->mnt_fs); + *mntp = mnt; + } + return err; +} + /* * Find, and validate, or create i-node by host-relative path. Returned i-node * is referenced. @@ -599,16 +623,13 @@ yod_inop_setattr(struct pnode *pno, * Alter permissions attribute. */ mode = stbuf->st_mode & 0777; - err = - fd < 0 - ? rpc_chmod(path, mode) - : rpc_fchmod(fd, mode); + err = chmod_yod(path, mode); } if (err) mask &= ~SETATTR_MODE; +#if 0 else if (mask & (SETATTR_MTIME|SETATTR_ATIME)) { struct utimbuf ut; - /* * Alter access and/or modify time attributes. */ @@ -618,27 +639,18 @@ yod_inop_setattr(struct pnode *pno, ut.modtime = stbuf->st_mtime; if (mask & SETATTR_ATIME) ut.actime = stbuf->st_atime; - err = rpc_utime(path, &ut); + err = utime_yod(path, &ut); } if (err) mask &= ~(SETATTR_MTIME|SETATTR_ATIME); - else if (mask & (SETATTR_UID|SETATTR_GID)) { + else +#endif + if (mask & (SETATTR_UID|SETATTR_GID)) { /* * Alter owner and/or group identifiers. */ - err = - fd < 0 - ? rpc_chown( - path, - mask & SETATTR_UID - ? stbuf->st_uid - : (uid_t )-1, - mask & SETATTR_GID - ? stbuf->st_gid - : (gid_t )-1) - : rpc_fchown( - fd, + err = chown_yod(path, mask & SETATTR_UID ? stbuf->st_uid : (uid_t )-1, @@ -653,8 +665,8 @@ yod_inop_setattr(struct pnode *pno, * Do the truncate last. It can't be undone. */ (void )(fd < 0 - ? rpc_truncate(path, stbuf->st_size) - : rpc_ftruncate(fd, stbuf->st_size)); + ? truncate_yod(path, stbuf->st_size) + : ftruncate_yod(fd, stbuf->st_size)); } if (!err) goto out; @@ -663,35 +675,25 @@ yod_inop_setattr(struct pnode *pno, * can but try. */ if (mask & (SETATTR_UID|SETATTR_GID)) { - (void )(fd < 0 - ? rpc_chown( - path, - mask & SETATTR_UID - ? st.st_uid - : (uid_t )-1, - mask & SETATTR_GID - ? st.st_gid - : (gid_t )-1) - : rpc_fchown( - fd, + (void )chown_yod(path, mask & SETATTR_UID ? st.st_uid : (uid_t )-1, mask & SETATTR_GID ? st.st_gid - : (gid_t )-1)); + : (gid_t )-1); } +#if 0 if (mask & (SETATTR_MTIME|SETATTR_ATIME)) { struct utimbuf ut; ut.actime = st.st_atime; ut.modtime = st.st_mtime; - (void )rpc_utime(path, &ut); + (void )utime_yod(path, &ut); } +#endif if (mask & SETATTR_MODE) { - fd < 0 - ? rpc_chmod(path, st.st_mode & 0777) - : rpc_fchmod(fd, st.st_mode & 0777); + chmod_yod(path, st.st_mode & 0777); } out: if (path) @@ -713,14 +715,14 @@ yod_getdirentries(struct inode *ino, result = *basep; if (*basep != nino->ni_fpos && - rpc_lseek( + lseek_yod( nino->ni_fd, *basep, &result, SEEK_SET) == -1) return -errno; nino->ni_fpos = result; - cc = rpc_getdents64(nino->ni_fd, buf, nbytes); + cc = getdirentries_yod(nino->ni_fd, buf, nbytes); if (cc < 0) return -errno; nino->ni_fpos += cc; @@ -737,7 +739,7 @@ yod_inop_mkdir(struct pnode *pno, mode_t if (!path) return -ENOMEM; - err = rpc_mkdir(path, mode); + err = mkdir_yod(path, mode); free(path); return err; } @@ -752,7 +754,7 @@ yod_inop_rmdir(struct pnode *pno) if (!path) return -ENOMEM; - err = rpc_rmdir(path); + err = rmdir_yod(path); free(path); return err; } @@ -767,25 +769,18 @@ yod_inop_symlink(struct pnode *pno, cons if (!path) return -ENOMEM; - err = rpc_symlink(path, data); + err = symlink_yod(path, data); free(path); return err; } static int -yod_inop_readlink(struct pnode *pno, char *buf, size_t bufsiz) +yod_inop_readlink(struct pnode *pno __IS_UNUSED, + char *buf __IS_UNUSED, + size_t bufsiz __IS_UNUSED) { - char *path; - int i; - path = _sysio_pb_path(pno->p_base, '/'); - if (!path) - return -ENOMEM; - i = rpc_readlink(path, buf, bufsiz); - if (i < 0) - i = -errno; - free(path); - return i; + return -ENOSYS; } static int @@ -811,7 +806,7 @@ yod_inop_open(struct pnode *pno, int fla flags &= ~O_WRONLY; flags |= O_RDWR; } - fd = rpc_open(path, flags, mode); + fd = open_yod(path, flags, mode); if (!pno->p_base->pb_ino && fd >= 0) { int err; @@ -824,7 +819,7 @@ yod_inop_open(struct pnode *pno, int fla &pno->p_base->pb_ino, 1); if (err) { - (void )rpc_close(fd); + (void )close_yod(fd); if (err == -EEXIST) abort(); fd = err; @@ -849,10 +844,10 @@ yod_inop_open(struct pnode *pno, int fla /* * Keep existing. */ - (void )rpc_close(fd); + (void )close_yod(fd); return 0; } - (void )rpc_close(nino->ni_fd); + (void )close_yod(nino->ni_fd); } /* * Invariant; First open. Must init. @@ -877,7 +872,7 @@ yod_inop_close(struct inode *ino) if (--nino->ni_nopens) return 0; #endif - err = rpc_close(nino->ni_fd); + err = close_yod(nino->ni_fd); if (err) return -errno; nino->ni_fd = -1; @@ -907,7 +902,7 @@ yod_inop_unlink(struct pnode *pno) * (usually .NFSXXXXXX, where the X's are replaced by the PID and some * unique characters) in order to simulate the proper semantic. */ - err = rpc_unlink(path); + err = unlink_yod(path); free(path); return err; } @@ -957,7 +952,7 @@ doio(ssize_t (*f)(int, const struct iove !(S_ISCHR(ino->i_mode) || S_ISSOCK(ino->i_mode) || S_ISFIFO(ino->i_mode)) && - rpc_lseek( + lseek_yod( nino->ni_fd, ioctx->ioctx_offset, &result, @@ -989,7 +984,7 @@ static ssize_t _readv(int fd, const struct iovec *vector, int count) { - return rpc_read(fd, vector, count); + return read_yod(fd, vector, count); } static int @@ -1007,8 +1002,14 @@ yod_inop_ipreadv(struct inode *ino, static ssize_t _writev(int fd, const struct iovec *vector, int count) { + int i; + ssize_t total; - return rpc_write(fd, vector, count); + for (i = 0; i < count; i++) + total += write_yod(fd, + vector[i].iov_base, + vector[i].iov_len); + return total; } static int @@ -1079,8 +1080,8 @@ yod_inop_statvfs(struct pnode *pno, */ rc = path - ? rpc_statfs(path, &fs) - : rpc_fstatfs(I2NI(ino)->ni_fd, &fs); + ? statfs_yod(path, &fs) + : fstatfs_yod(I2NI(ino)->ni_fd, &fs); if (path) free(path); if (rc < 0) @@ -1106,7 +1107,7 @@ yod_inop_sync(struct inode *ino) assert(I2NI(ino)->ni_fd >= 0); - return rpc_fsync(I2NI(ino)->ni_fd); + return fsync_yod(I2NI(ino)->ni_fd); } static int @@ -1115,7 +1116,7 @@ yod_inop_datasync(struct inode *ino) assert(I2NI(ino)->ni_fd >= 0); - return rpc_fdatasync(I2NI(ino)->ni_fd); + return fsync_yod(I2NI(ino)->ni_fd); } static int Index: fs_yod.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/Attic/fs_yod.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 --- fs_yod.h 28 Apr 2003 20:21:40 -0000 1.1.2.1 +++ fs_yod.h 1 May 2003 15:44:42 -0000 1.1.2.2 @@ -42,8 +42,7 @@ */ /* - * Native file system driver support. + * Remote file system driver support. */ -extern int _sysio_yod_init(int, int, int, - off_t, off_t, off_t); +extern int _sysio_yod_init(); --- portals_io.c DELETED --- --- portals_io.h DELETED --- |
From: Ruth K. <rk...@us...> - 2003-05-01 15:41:55
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1:/tmp/cvs-serv17845 Modified Files: Tag: cplant stdfd.c Log Message: make calls to cplant libs existing functions Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -u -w -b -B -p -r1.2.2.1 -r1.2.2.2 --- stdfd.c 28 Apr 2003 20:18:54 -0000 1.2.2.1 +++ stdfd.c 1 May 2003 15:41:50 -0000 1.2.2.2 @@ -59,8 +59,8 @@ #include "stdfd.h" #ifdef CPLANT_YOD -#define dowrite(f, b, n) rpc_write(f, b, n) -#define doread(f, b, n) rpc_read(f, b, n) +#define dowrite(f, b, n) write_yod(f, b, n) +#define doread(f, b, n) read_yod(f, b, n) #else #define dowrite(f, b, n) syscall(SYS_write, f, b, n) #define doread(f, b, n) syscall(SYS_read, f, b, n) |
From: Mei <me...@us...> - 2003-04-30 14:38:18
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1:/tmp/cvs-serv15360/src Modified Files: Tag: b_lustre fcntl.c Log Message: temporarily solution in order to run IOR2: in fcntl() when failed find valid file, just call the syscall instread of simply return error. Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -w -b -B -p -r1.3 -r1.3.2.1 --- fcntl.c 4 Apr 2003 20:09:47 -0000 1.3 +++ fcntl.c 30 Apr 2003 14:38:11 -0000 1.3.2.1 @@ -46,6 +46,7 @@ #include <sys/types.h> #include <fcntl.h> #include <sys/queue.h> +#include <syscall.h> #include "sysio.h" #include "inode.h" @@ -61,8 +62,16 @@ fcntl(int fd, int cmd, ...) err = 0; fil = _sysio_fd_find(fd); if (!fil) { + /* FIXME temorary solution to get IOR2 run. cleanup this + * later */ + va_start(ap, cmd); + err = syscall(SYS_fcntl, fd, cmd, ap); + va_end(ap); + return err; +#if 0 err = -EBADF; goto out; +#endif } switch (cmd) { |
From: Mei <me...@us...> - 2003-04-30 14:32:20
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1:/tmp/cvs-serv12799/drivers/native Modified Files: Tag: b_lustre fs_native.c Log Message: add code to fcntl in native driver Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- fs_native.c 23 Apr 2003 18:18:38 -0000 1.11 +++ fs_native.c 30 Apr 2003 14:32:16 -0000 1.11.2.1 @@ -1107,16 +1107,16 @@ native_inop_iodone(struct ioctx *ioctxp } static int -native_inop_fcntl(struct inode *ino __IS_UNUSED, - int cmd __IS_UNUSED, - va_list ap __IS_UNUSED) +native_inop_fcntl(struct inode *ino, + int cmd, + va_list ap) { + struct native_inode *nino = I2NI(ino); - /* - * I'm lazy. Maybe implemented later. - */ - errno = ENOTTY; - return -1; + if (nino->ni_fd < 0) + abort(); + + return syscall(SYS_fcntl, nino->ni_fd, cmd, ap); } static int |
From: Mei <me...@us...> - 2003-04-30 11:42:19
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1:/tmp/cvs-serv3832 Modified Files: COPYING Log Message: testing..., try to replace the syncmail script Index: COPYING =================================================================== RCS file: /cvsroot/libsysio/libsysio/COPYING,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 |
From: <me...@us...> - 2003-04-30 11:29:29
|
Update of /cvsroot/libsysio/CVSROOT In directory sc8-pr-cvs1:/tmp/cvs-serv32318 Modified Files: loginfo checkoutlist Log Message: test... Index: loginfo =================================================================== RCS file: /cvsroot/libsysio/CVSROOT/loginfo,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** loginfo 24 Apr 2003 02:14:16 -0000 1.6 --- loginfo 30 Apr 2003 11:29:25 -0000 1.7 *************** *** 25,28 **** # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ! #^libsysio/ $CVSROOT/CVSROOT/syncmail %{sVv} lib...@li... ! DEFAULT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail %{sVv} lib...@li... --- 25,28 ---- # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog ! #DEFAULT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail %{sVv} lib...@li... ! ^libsysio/ $CVSROOT/CVSROOT/syncmail %{sVv} lib...@li... Index: checkoutlist =================================================================== RCS file: /cvsroot/libsysio/CVSROOT/checkoutlist,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** checkoutlist 21 Feb 2003 23:12:28 -0000 1.1 --- checkoutlist 30 Apr 2003 11:29:26 -0000 1.2 *************** *** 12,13 **** --- 12,14 ---- # # comment lines begin with '#' + syncmail |