libsysio-commit Mailing List for libsysio (Page 17)
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...> - 2005-09-15 14:51:10
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21780 Modified Files: namei.c Log Message: When processing a symbolic link, the intent was passed always. This was incorrect because the symlink could be an intermediate, and *not* contain the final target. Fixed. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- namei.c 14 Oct 2004 14:59:29 -0000 1.16 +++ namei.c 15 Sep 2005 14:50:57 -0000 1.17 @@ -262,7 +262,7 @@ _sysio_path_walk(struct pnode *parent, s (nd->nd_flags | ND_NEGOK), lpath, nd->nd_root, - nd->nd_intent); + !next.len ? nd_intent : NULL); nameidata.nd_slicnt = nd->nd_slicnt + 1; err = _sysio_path_walk(nd->nd_pno->p_parent, &nameidata); |
From: Lee W. <lw...@us...> - 2005-09-09 17:10:21
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9869/src Modified Files: Tag: LLNL_HPSS getdirentries.c Log Message: Account for d_name terminated with NUL or not. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.20.2.2 retrieving revision 1.20.2.3 diff -u -w -b -B -p -r1.20.2.2 -r1.20.2.3 --- getdirentries.c 9 Sep 2005 14:58:20 -0000 1.20.2.2 +++ getdirentries.c 9 Sep 2005 17:10:09 -0000 1.20.2.3 @@ -141,10 +141,17 @@ sysio_sym_strong_alias(PREPEND(_, SYSIO_ #define EOVERFLOW ERANGE #endif +#define _dbaselen(__d) (sizeof(struct __d) - sizeof(((struct __d *)0)->d_name)) + #ifdef _DIRENT_HAVE_D_NAMLEN -#define _namlen(dp) ((dp)->d_namlen) +#define _namlen(dp, __d) \ + ((dp)->d_namlen) +#elif defined(_DIRENT_HAVE_D_RECLEN) +#define _namlen(dp, __d) \ + ((dp)->d_reclen - _dbaselen(__d)) #else -#define _namlen(dp) (strlen((dp)->d_name)) +#define _namlen(dp, __d) \ + (strlen((dp)->d_name) + 1) #endif #ifndef _rndup @@ -152,15 +159,20 @@ sysio_sym_strong_alias(PREPEND(_, SYSIO_ ((((n) + (boundary) - 1 ) / (boundary)) * (boundary)) #endif -#define _dbaselen ((size_t )&((struct dirent *)0)->d_name[0]) +#ifdef GCC_VERSION +#define _dalign(d) (__alignof__ (struct d)) +#endif -#ifdef __GLIBC__ +#ifdef GCC_VERSION #define _dreclen(namlen) \ - ((_dbaselen + (namlen) + __alignof__ (struct dirent)) & \ - ~(__alignof__ (struct dirent) - 1)) -#else /* !defined(__GLIBC__) */ + _rndup(_dbaselen(dirent) + (namlen), (__alignof (struct dirent))) +#define _dreclen64(namlen) \ + _rndup(_dbaselen(dirent64) + (namlen), (__alignof (struct dirent64))) +#else #define _dreclen(namlen) \ - _rndup(_dbaselen + (namlen) + 1, sizeof(int)) + _rndup(_dbaselen(dirent) + (namlen), sizeof(long)) +#define _dreclen64(namlen) \ + _rndup(_dbaselen(dirent64) + (namlen), sizeof(long long)) #endif #ifndef BSD @@ -198,8 +210,10 @@ SYSIO_INTERFACE_NAME(getdirentries)(int dp = (void *)buf; reclen = 0; while (cc > 0) { - n = _namlen(d64p); - reclen = _dreclen(n); + n = _namlen(d64p, dirent64); + reclen = _dreclen64(n); +if (reclen != d64p->d_reclen) +abort(); d64.d_ino = d64p->d_ino; #ifdef _DIRENT_HAVE_D_OFF d64.d_off = d64p->d_off; @@ -254,12 +268,12 @@ SYSIO_INTERFACE_NAME(getdirentries)(int dp->d_type = d64.d_type; #endif #ifdef _DIRENT_HAVE_D_RECLEN - dp->d_reclen = reclen; + dp->d_reclen = _dreclen(n); #endif /* * Fill the remainder with zeros. */ - p = (char *)dp + reclen; + p = (char *)dp + _dreclen(n); #ifdef HAVE_D_NAMLEN dp->d_namlen = n; #endif |
From: Lee W. <lw...@us...> - 2005-09-09 15:36:22
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17966/tests Modified Files: Tag: LLNL_HPSS test_copy.c test_getcwd.c test_link.c test_list.c test_path.c test_regions.c test_rename.c test_stats.c test_stddir.c test_unlink.c Log Message: The label names changes caused all the tests to be built without label names in all, usable, cases. Fixed. Index: test_copy.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.c,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -w -b -B -p -r1.12 -r1.12.2.1 --- test_copy.c 9 Feb 2005 14:00:27 -0000 1.12 +++ test_copy.c 9 Sep 2005 15:36:12 -0000 1.12.2.1 @@ -53,9 +53,7 @@ #include <sys/uio.h> #include <sys/queue.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_getcwd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_getcwd.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- test_getcwd.c 4 Feb 2005 00:29:26 -0000 1.6 +++ test_getcwd.c 9 Sep 2005 15:36:13 -0000 1.6.2.1 @@ -53,9 +53,7 @@ #include <sys/queue.h> #include <dirent.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "mount.h" Index: test_link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_link.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -w -b -B -p -r1.4 -r1.4.2.1 --- test_link.c 4 Feb 2005 00:29:26 -0000 1.4 +++ test_link.c 9 Sep 2005 15:36:13 -0000 1.4.2.1 @@ -54,9 +54,7 @@ #include <sys/uio.h> #include <sys/queue.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_list.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_list.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- test_list.c 4 Aug 2005 19:48:49 -0000 1.11 +++ test_list.c 9 Sep 2005 15:36:13 -0000 1.11.2.1 @@ -55,9 +55,7 @@ #include <sys/uio.h> #include <sys/queue.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_path.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_path.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -w -b -B -p -r1.11 -r1.11.2.1 --- test_path.c 4 Feb 2005 00:29:26 -0000 1.11 +++ test_path.c 9 Sep 2005 15:36:13 -0000 1.11.2.1 @@ -52,9 +52,7 @@ #include <unistd.h> #include <sys/uio.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_regions.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_regions.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- test_regions.c 4 Feb 2005 00:29:26 -0000 1.6 +++ test_regions.c 9 Sep 2005 15:36:13 -0000 1.6.2.1 @@ -65,9 +65,7 @@ #include <fcntl.h> #include <sys/uio.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_rename.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -w -b -B -p -r1.6 -r1.6.2.1 --- test_rename.c 4 Feb 2005 00:29:26 -0000 1.6 +++ test_rename.c 9 Sep 2005 15:36:13 -0000 1.6.2.1 @@ -52,9 +52,7 @@ #include <fcntl.h> #include <sys/uio.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_stats.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -w -b -B -p -r1.8 -r1.8.2.1 --- test_stats.c 4 Feb 2005 00:29:26 -0000 1.8 +++ test_stats.c 9 Sep 2005 15:36:13 -0000 1.8.2.1 @@ -55,9 +55,7 @@ #endif #include <sys/uio.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_stddir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stddir.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 --- test_stddir.c 9 Sep 2005 14:58:20 -0000 1.2.2.1 +++ test_stddir.c 9 Sep 2005 15:36:13 -0000 1.2.2.2 @@ -49,9 +49,7 @@ #include <dirent.h> #include <sys/types.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" Index: test_unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_unlink.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- test_unlink.c 4 Feb 2005 00:29:26 -0000 1.5 +++ test_unlink.c 9 Sep 2005 15:36:13 -0000 1.5.2.1 @@ -52,9 +52,7 @@ #endif #include <sys/uio.h> -#if defined(SYSIO_LABEL_NAMES) && SYSIO_LABEL_NAMES == 1 #include "sysio.h" -#endif #include "xtio.h" #include "test.h" |
From: Lee W. <lw...@us...> - 2005-09-09 14:58:37
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9447/drivers/incore Modified Files: Tag: LLNL_HPSS fs_incore.c Log Message: Deal with directory record variants that include or don't d_off, d_offset, d_reclen, and d_namlen. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.24.2.2 retrieving revision 1.24.2.3 diff -u -w -b -B -p -r1.24.2.2 -r1.24.2.3 --- fs_incore.c 6 Sep 2005 14:35:32 -0000 1.24.2.2 +++ fs_incore.c 9 Sep 2005 14:58:20 -0000 1.24.2.3 @@ -376,6 +376,8 @@ _sysio_incore_init() de = (struct intnl_dirent *)incore_dir_template; #ifdef _DIRENT_HAVE_D_OFF de->d_off = +#elif defined(_DIRENT_HAVE_D_OFFSET) + de->d_offset = #endif off = de->d_reclen = INCORE_D_RECLEN(1); #ifdef _DIRENT_HAVE_D_TYPE @@ -395,6 +397,8 @@ _sysio_incore_init() #endif #ifdef _DIRENT_HAVE_D_OFF de->d_off = +#elif defined(_DIRENT_HAVE_D_OFFSET) + de->d_offset = #endif off += de->d_reclen; #ifdef _DIRENT_HAVE_D_TYPE @@ -511,6 +515,8 @@ incore_directory_new(struct incore_files (struct intnl_dirent *)((char *)de + #ifdef _DIRENT_HAVE_D_OFF de->d_off +#elif defined(_DIRENT_HAVE_D_OFFSET) + de->d_offset #else de->d_reclen #endif @@ -733,7 +739,7 @@ static void * incore_directory_probe(void *data, size_t siz, _SYSIO_OFF_T origin -#ifndef _DIRENT_HAVE_D_OFF +#if !(defined(_DIRENT_HAVE_D_OFF) || defined(_DIRENT_HAVE_D_OFF)) __IS_UNUSED #endif , @@ -749,6 +755,8 @@ incore_directory_probe(void *data, for (;;) { #ifdef _DIRENT_HAVE_D_OFF assert(de->d_off); +#elif defined(_DIRENT_HAVE_D_OFFSET) + assert(de->d_offset); #else assert(de->d_reclen); #endif @@ -757,6 +765,8 @@ incore_directory_probe(void *data, n = #ifdef _DIRENT_HAVE_D_OFF de->d_off - origin; +#elif defined(_DIRENT_HAVE_D_OFFSET) + de->d_offset - origin; #else ((void *)de - data) + de->d_reclen; #endif @@ -1025,7 +1035,7 @@ incore_directory_insert(struct incore_in struct qstr *name, ino_t inum, unsigned char type -#ifndef _DIRENT_HAVE_D_TYPE +#ifdef _DIRENT_HAVE_D_TYPE __IS_UNUSED #endif @@ -1054,11 +1064,13 @@ incore_directory_insert(struct incore_in n = #ifdef _DIRENT_HAVE_D_OFF de->d_off; +#elif defined(_DIRENT_HAVE_D_OFFSET) + de->d_offset; #else xt + de->d_reclen; #endif r = -#ifdef _DIRENT_HAVE_D_OFF +#ifdef _DIRENT_HAVE_D_RECLEN de->d_reclen; #else INCORE_D_RECLEN(de->d_namlen); @@ -1074,15 +1086,20 @@ incore_directory_insert(struct incore_in n = parent->ici_st.st_size; } + /* + * Trim. + */ #ifdef _DIRENT_HAVE_D_OFF - de->d_off = xt + r; /* trim */ + de->d_off = xt + r; +#elif defined(_DIRENT_HAVE_D_OFFSET) + de->d_offset = xt + r; #else de->d_reclen = r; #endif de = (struct intnl_dirent *)((char *)de + r); /* reposition */ xt += r; -#ifndef _DIRENT_HAVE_D_OFF +#if !(defined(_DIRENT_HAVE_D_OFF) || defined(_DIRENT_HAVE_D_OFF)) /* * Will we split this hole or use all of it? */ @@ -1097,8 +1114,12 @@ incore_directory_insert(struct incore_in de->d_ino = inum; #ifdef _DIRENT_HAVE_D_OFF de->d_off = n; +#elif defined(_DIRENT_HAVE_D_OFFSET) + de->d_offset = n; #endif +#ifdef _DIRENT_HAVE_D_RECLEN de->d_reclen = reclen; +#endif #ifdef _DIRENT_HAVE_D_TYPE de->d_type = type; #endif @@ -1107,7 +1128,7 @@ incore_directory_insert(struct incore_in de->d_namlen = name->len; #endif -#ifndef _DIRENT_HAVE_D_OFF +#if !(defined(_DIRENT_HAVE_D_OFF) || defined(_DIRENT_HAVE_D_OFFSET)) xt += reclen; if (n - xt) { /* @@ -1116,7 +1137,7 @@ incore_directory_insert(struct incore_in (void *)de += reclen; de->d_ino = 0; de->d_reclen = n - xt; -#ifdef _DIRENT_HAVE_D_TYPE +#if defined(_DIRENT_HAVE_D_TYPE) de->d_type = DT_WHT; #endif de->d_namlen = 0; @@ -1212,7 +1233,7 @@ incore_unlink_entry(struct incore_inode struct lookup_data lookup_data; struct intnl_dirent *de; size_t reclen; -#ifdef _DIRENT_HAVE_D_OFF +#if defined(_DIRENT_HAVE_D_OFF) || defined(_DIRENT_HAVE_D_OFFSET) size_t off; #endif @@ -1231,20 +1252,22 @@ incore_unlink_entry(struct incore_inode return -ENOENT; assert((size_t )((char *)de - (char *)icino->ici_data) >= sizeof(incore_dir_template)); -#ifndef _DIRENT_HAVE_D_OFF +#if !(defined(_DIRENT_HAVE_D_OFF) || defined(_DIRENT_HAVE_D_OFFSET)) reclen = de->d_reclen; #else off = de->d_off; reclen = off - ((char *)de - (char *)icino->ici_data); #endif (void )memset(de, 0, reclen); -#ifndef _DIRENT_HAVE_D_OFF +#ifdef _DIRENT_HAVE_D_OFF + lookup_data.de->d_off = off; +#elif defined(_DIRENT_HAVE_D_OFFSET) + lookup_data.de->d_offset = off; +#else #ifdef _DIRENT_HAVE_D_TYPE de->d_type = (__uint8_t )DTTOIF(DT_WHT); #endif de->d_reclen = reclen; -#else - lookup_data.de->d_off = off; #endif /* |
From: Lee W. <lw...@us...> - 2005-09-09 14:58:37
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9447/drivers/native Modified Files: Tag: LLNL_HPSS fs_native.c Log Message: Deal with directory record variants that include or don't d_off, d_offset, d_reclen, and d_namlen. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.56.2.1 retrieving revision 1.56.2.2 diff -u -w -b -B -p -r1.56.2.1 -r1.56.2.2 --- fs_native.c 6 Sep 2005 14:35:32 -0000 1.56.2.1 +++ fs_native.c 9 Sep 2005 14:58:20 -0000 1.56.2.2 @@ -1021,7 +1021,7 @@ native_filldirentries(struct inode *ino, struct linux_dirent *ldp; struct dirent64 *d64p; size_t namlen; - size_t reclen; + size_t reclen, areclen; #else #define bp buf #define count nbytes @@ -1054,24 +1054,38 @@ native_filldirentries(struct inode *ino, if (nbytes <= reclen) break; d64p->d_ino = ldp->ld_ino; - d64p->d_off = nino->ni_fpos = ldp->ld_off; +#ifdef _DIRENT_HAVE_D_OFF + d64p->d_off = +#else + d64p->d_offset = +#endif + nino->ni_fpos = ldp->ld_off; +#ifdef _DIRENT_HAVE_D_RECLEN d64p->d_reclen = +#endif + areclen = (((reclen + sizeof(long))) / sizeof(long)) * sizeof(long); - if (nbytes < d64p->d_reclen) - d64p->d_reclen = reclen + 1; + if (nbytes < areclen) { +#ifdef _DIRENT_HAVE_D_RECLEN + d64p->d_reclen = +#endif + areclen = reclen + 1; + } +#ifdef _DIRENT_HAVE_D_TYPE d64p->d_type = DT_UNKNOWN; /* you lose -- sorry. */ +#endif (void )memcpy(d64p->d_name, ldp->ld_name, namlen); /* * Zero pad the rest. */ - for (cp = d64p->d_name + namlen, n = d64p->d_reclen - reclen; + for (cp = d64p->d_name + namlen, n = areclen - reclen; n; n--) *cp++ = 0; cc -= ldp->ld_reclen; ldp = (struct linux_dirent *)((char *)ldp + ldp->ld_reclen); - nbytes -= d64p->d_reclen; - d64p = (struct dirent64 *)((char *)d64p + d64p->d_reclen); + nbytes -= areclen; + d64p = (struct dirent64 *)((char *)d64p + areclen); } free(bp); cc = |
From: Lee W. <lw...@us...> - 2005-09-09 14:58:37
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9447/tests Modified Files: Tag: LLNL_HPSS test_stddir.c Log Message: Deal with directory record variants that include or don't d_off, d_offset, d_reclen, and d_namlen. Index: test_stddir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stddir.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -w -b -B -p -r1.2 -r1.2.2.1 --- test_stddir.c 4 Feb 2005 00:29:26 -0000 1.2 +++ test_stddir.c 9 Sep 2005 14:58:20 -0000 1.2.2.1 @@ -139,6 +139,7 @@ testit(const char *path) { DIR *d; struct dirent *de; + char *fmt; printf("testing directory functions on %s\n", path); @@ -147,10 +148,30 @@ testit(const char *path) return errno; } + fmt = + "\t %s: ino %lu" +#if defined(_DIRENT_HAVE_D_OFF) + " off %lu" +#elif defined(_DIRENT_HAVE_D_OFFSET) + " offset %lu" +#endif +#ifdef _DIRENT_HAVE_D_TYPE + " type %u" +#endif + "\n"; while ((de = SYSIO_INTERFACE_NAME(readdir)(d)) != NULL) - printf("\t %s: ino %lu off %lu type %u\n", - de->d_name, (unsigned long )de->d_ino, - (unsigned long )de->d_off, (int )de->d_type); + printf(fmt, + de->d_name, + (unsigned long )de->d_ino, +#if defined(_DIRENT_HAVE_D_OFF) + (unsigned long )de->d_off, +#elif defined(_DIRENT_HAVE_D_OFFSET) + (unsigned long )de->d_offset, +#endif +#ifdef _DIRENT_HAVE_D_TYPE + (int )de->d_type +#endif + ); if (SYSIO_INTERFACE_NAME(closedir)(d)) { perror("closedir"); |
From: Lee W. <lw...@us...> - 2005-09-09 14:58:35
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9447/src Modified Files: Tag: LLNL_HPSS getdirentries.c readdir.c Log Message: Deal with directory record variants that include or don't d_off, d_offset, d_reclen, and d_namlen. Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.20.2.1 retrieving revision 1.20.2.2 diff -u -w -b -B -p -r1.20.2.1 -r1.20.2.2 --- getdirentries.c 26 Aug 2005 17:07:27 -0000 1.20.2.1 +++ getdirentries.c 9 Sep 2005 14:58:20 -0000 1.20.2.2 @@ -201,11 +201,17 @@ SYSIO_INTERFACE_NAME(getdirentries)(int n = _namlen(d64p); reclen = _dreclen(n); d64.d_ino = d64p->d_ino; +#ifdef _DIRENT_HAVE_D_OFF d64.d_off = d64p->d_off; +#else + d64.d_offset = d64p->d_offset; +#endif #ifdef _DIRENT_HAVE_D_TYPE d64.d_type = d64p->d_type; #endif +#ifdef _DIRENT_HAVE_D_RECLEN d64.d_reclen = d64p->d_reclen; +#endif /* * Copy name first. */ @@ -214,9 +220,18 @@ SYSIO_INTERFACE_NAME(getdirentries)(int * Then, the rest. */ dp->d_ino = d64.d_ino; +#ifdef _DIRENT_HAVE_D_OFF dp->d_off = d64.d_off; - if (dp->d_ino != d64.d_ino || - dp->d_off != d64.d_off) { +#else + dp->d_offset = d64.d_offset; +#endif + if (dp->d_ino != d64.d_ino +#ifdef _DIRENT_HAVE_D_OFF + || dp->d_off != d64.d_off +#else + || dp->d_offset != d64.d_offset +#endif + ) { /* * If conversion failure then we are done. */ @@ -229,15 +244,22 @@ SYSIO_INTERFACE_NAME(getdirentries)(int } break; } - fil->f_pos = dp->d_off; + fil->f_pos = +#ifdef _DIRENT_HAVE_D_OFF + dp->d_off; +#else + dp->d_offset; +#endif #ifdef _DIRENT_HAVE_D_TYPE dp->d_type = d64.d_type; #endif +#ifdef _DIRENT_HAVE_D_RECLEN dp->d_reclen = reclen; +#endif /* * Fill the remainder with zeros. */ - p = (char *)dp + dp->d_reclen; + p = (char *)dp + reclen; #ifdef HAVE_D_NAMLEN dp->d_namlen = n; #endif @@ -249,8 +271,8 @@ SYSIO_INTERFACE_NAME(getdirentries)(int * Advance. */ dp = p; - cc -= d64.d_reclen; - d64p = (struct dirent64 *)((char *)d64p + d64.d_reclen); + cc -= reclen; + d64p = (struct dirent64 *)((char *)d64p + reclen); } if (cc < 0) Index: readdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/readdir.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -w -b -B -p -r1.2 -r1.2.2.1 --- readdir.c 25 Jan 2005 00:37:14 -0000 1.2 +++ readdir.c 9 Sep 2005 14:58:20 -0000 1.2.2.1 @@ -92,6 +92,8 @@ _READDIR(DIR *dir) #endif #ifdef _DIRENT_HAVE_D_OFF dir->filepos = dp->d_off; +#elif defined(_DIRENT_HAVE_D_OFFSET) + dir->filepos = dp->d_offset; #else dir->filepos = dir->cur; #endif |
From: Lee W. <lw...@us...> - 2005-09-09 14:58:35
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9447 Modified Files: Tag: LLNL_HPSS configure.in Log Message: Deal with directory record variants that include or don't d_off, d_offset, d_reclen, and d_namlen. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.20.2.3 retrieving revision 1.20.2.4 diff -u -w -b -B -p -r1.20.2.3 -r1.20.2.4 --- configure.in 6 Sep 2005 14:35:32 -0000 1.20.2.3 +++ configure.in 9 Sep 2005 14:58:19 -0000 1.20.2.4 @@ -327,6 +327,100 @@ if test x$have_st_gen = xyes; then AC_DEFINE(HAVE_GENERATION) fi +AC_MSG_CHECKING(whether to define directory offset myself) + +# Check for d_off +# +AC_TRY_COMPILE([ +#include <sys/dirent.h>], +[struct dirent d; +#ifdef _DIRENT_HAVE_D_OFF +#error Already present +#endif +#ifdef _DIRENT_HAVE_D_OFF +d.d_off = 0; +#endif ], + have_d_off=yes, + have_d_off=no) + +# Check for d_offset +# +AC_TRY_COMPILE([ +#include <sys/dirent.h>], +[struct dirent d; +#if defined(_DIRENT_HAVE_D_OFF) +#error Not this one +#endif +#ifndef _DIRENT_HAVE_D_OFFSET +d.d_offset = 0; +#endif ], + have_d_offset=yes, + have_d_offset=no) + +have_d=no +if test x$have_d_off = xyes; then + have_d=d_off + AC_DEFINE(_DIRENT_HAVE_D_OFF) +elif test x$have_d_offset = xyes; then + have_d=d_offset + AC_DEFINE(_DIRENT_HAVE_D_OFFSET) +fi +AC_MSG_RESULT($have_d) + +# Check for d_reclen +# +AC_MSG_CHECKING(whether to define directory record length existence) +AC_TRY_COMPILE([ +#include <sys/dirent.h>], +[struct dirent d; +#if defined(_DIRENT_HAVE_D_RECLEN) +#error Not needed +#endif +d.d_reclen = 0; +#endif ], + have_d_reclen=yes, + have_d_reclen=no) +AC_MSG_RESULT($have_d_reclen) +if test x$have_d_reclen = xyes; then + AC_DEFINE(_DIRENT_HAVE_D_RECLEN) +fi + +# Check for d_type +# +AC_MSG_CHECKING(whether to define directory types existence) +AC_TRY_COMPILE([ +#include <sys/dirent.h>], +[struct dirent d; +#if defined(_DIRENT_HAVE_D_TYPE) +#error Not needed +#endif +d.d_type = 0; +#endif ], + have_d_type=yes, + have_d_type=no) +AC_MSG_RESULT($have_d_type) +if test x$have_d_type = xyes; then + AC_DEFINE(_DIRENT_HAVE_D_TYPE) +fi + +# Check for d_namlen +# +AC_MSG_CHECKING(whether to define directory names length existence) +AC_TRY_COMPILE([ +#include <sys/dirent.h>], +[struct dirent d; +#if defined(_DIRENT_HAVE_D_NAMLEN) +#error Not needed +#endif +d.d_namlen = 0; +#endif ], + have_d_namlen=yes, + have_d_namlen=no) +AC_MSG_RESULT($have_d_namlen) +if test x$have_d_namlen = xyes; then + AC_DEFINE(_DIRENT_HAVE_D_NAMLEN) +fi + AC_MSG_CHECKING(whether .text pseudo-op must be used) AC_CACHE_VAL(sysio_asm_dot_text, [dnl cat > conftest.s <<EOF |
From: Lee W. <lw...@us...> - 2005-09-06 14:35:43
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186 Modified Files: Tag: LLNL_HPSS configure.in Log Message: POSIX defines the ioctl request to be of type `int' and not `unsigned long int' as we had it. Fixed. Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.20.2.2 retrieving revision 1.20.2.3 diff -u -w -b -B -p -r1.20.2.2 -r1.20.2.3 --- configure.in 29 Aug 2005 21:57:25 -0000 1.20.2.2 +++ configure.in 6 Sep 2005 14:35:32 -0000 1.20.2.3 @@ -274,6 +274,19 @@ if test x$sysio_largefile64_source_requi AC_DEFINE(_LARGEFILE64_SOURCE) fi +# POSIX defines the arguments to ioctl, now. Discover which way it's done +# for this host. Old, BSD, way or the new, POSIX, way. +AC_MSG_CHECKING(which ioctl prototype to use) +AC_TRY_COMPILE([ +#include <sys/ioctl.h>], [ +], +sysio_use_bsd_ioctl=bsd, +sysio_use_bsd_ioctl=posix) +AC_MSG_RESULT($sysio_use_bsd_ioctl) +if test x$sysio_use_bsd_ioctl = xbsd; then + AC_DEFINE(SYSIO_USE_BSD_IOCTL) +fi + # Alpha linux defines # AC_MSG_CHECKING(for alpha linux) |
From: Lee W. <lw...@us...> - 2005-09-06 14:35:42
|
Update of /cvsroot/libsysio/libsysio/drivers/sockets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186/drivers/sockets Modified Files: Tag: LLNL_HPSS sockets.c Log Message: POSIX defines the ioctl request to be of type `int' and not `unsigned long int' as we had it. Fixed. Index: sockets.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/sockets/sockets.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -w -b -B -p -r1.14 -r1.14.2.1 --- sockets.c 25 Jan 2005 18:16:01 -0000 1.14 +++ sockets.c 6 Sep 2005 14:35:32 -0000 1.14.2.1 @@ -105,7 +105,7 @@ static int sockets_inop_sync(struct inod static int sockets_inop_datasync(struct inode *ino); static int sockets_inop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn); static int sockets_inop_ioctl(struct inode *ino, - unsigned long int request, + int request, va_list ap); static void sockets_inop_gone(struct inode *ino); static void sockets_illop(void); @@ -314,7 +314,7 @@ sockets_inop_datasync(struct inode *ino) */ static int sockets_inop_ioctl(struct inode *ino, - unsigned long int request, + int request, va_list ap) { long arg1, arg2, arg3, arg4; @@ -332,7 +332,7 @@ sockets_inop_ioctl(struct inode *ino, #else static int sockets_inop_ioctl(struct inode *ino __IS_UNUSED, - unsigned long int request __IS_UNUSED, + int request __IS_UNUSED, va_list ap __IS_UNUSED) { /* |
From: Lee W. <lw...@us...> - 2005-09-06 14:35:42
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186/include Modified Files: Tag: LLNL_HPSS dev.h inode.h sysio.h Log Message: POSIX defines the ioctl request to be of type `int' and not `unsigned long int' as we had it. Fixed. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -u -w -b -B -p -r1.10 -r1.10.2.1 --- dev.h 4 Aug 2005 20:17:10 -0000 1.10 +++ dev.h 6 Sep 2005 14:35:32 -0000 1.10.2.1 @@ -130,7 +130,7 @@ extern const struct inode_ops _sysio_nod (int (*)(struct inode *))_sysio_do_ebadf #define _sysio_nodev_inop_ioctl \ (int (*)(struct inode *, \ - unsigned long int, \ + int, \ va_list))_sysio_do_ebadf #define _sysio_nodev_inop_mknod \ (int (*)(struct pnode *, \ Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -u -w -b -B -p -r1.25 -r1.25.2.1 --- inode.h 4 Aug 2005 20:17:10 -0000 1.25 +++ inode.h 6 Sep 2005 14:35:32 -0000 1.25.2.1 @@ -106,7 +106,7 @@ struct inode_ops { int (*inop_fcntl)(struct inode *ino, int cmd, va_list ap, int *rtn); int (*inop_sync)(struct inode *ino); int (*inop_datasync)(struct inode *ino); - int (*inop_ioctl)(struct inode *ino, unsigned long int request, va_list ap); + int (*inop_ioctl)(struct inode *ino, 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, Index: sysio.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio.h,v retrieving revision 1.34 retrieving revision 1.34.2.1 diff -u -w -b -B -p -r1.34 -r1.34.2.1 --- sysio.h 23 Feb 2005 01:43:08 -0000 1.34 +++ sysio.h 6 Sep 2005 14:35:32 -0000 1.34.2.1 @@ -254,7 +254,7 @@ extern int SYSIO_INTERFACE_NAME(unlink)( extern int SYSIO_INTERFACE_NAME(rename)(const char *oldpath, const char *newpath); extern int SYSIO_INTERFACE_NAME(fdatasync)(int fd); -extern int SYSIO_INTERFACE_NAME(ioctl)(int fd, unsigned long request, ...); +extern int SYSIO_INTERFACE_NAME(ioctl)(int fd, int request, ...); extern mode_t SYSIO_INTERFACE_NAME(umask)(mode_t mask); extern int SYSIO_INTERFACE_NAME(mknod)(const char *path, mode_t mode, dev_t dev); |
From: Lee W. <lw...@us...> - 2005-09-06 14:35:41
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186/drivers/native Modified Files: Tag: LLNL_HPSS fs_native.c Log Message: POSIX defines the ioctl request to be of type `int' and not `unsigned long int' as we had it. Fixed. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.56 retrieving revision 1.56.2.1 diff -u -w -b -B -p -r1.56 -r1.56.2.1 --- fs_native.c 4 Aug 2005 20:17:09 -0000 1.56 +++ fs_native.c 6 Sep 2005 14:35:32 -0000 1.56.2.1 @@ -197,7 +197,7 @@ static int native_inop_fcntl(struct inod static int native_inop_sync(struct inode *ino); static int native_inop_datasync(struct inode *ino); static int native_inop_ioctl(struct inode *ino, - unsigned long int request, + int request, va_list ap); static int native_inop_mknod(struct pnode *pno, mode_t mode, dev_t dev); #ifdef _HAVE_STATVFS @@ -1742,12 +1742,11 @@ native_inop_datasync(struct inode *ino) #ifdef HAVE_LUSTRE_HACK static int -native_inop_ioctl(struct inode *ino, - unsigned long int request, - va_list ap) +native_inop_ioctl(struct inode *ino, int request, va_list ap) { struct native_inode *nino; long arg1, arg2, arg3, arg4; + int err; nino = I2NI(ino); assert(nino->ni_fd >= 0); @@ -1756,21 +1755,29 @@ native_inop_ioctl(struct inode *ino, arg3 = va_arg(ap, long); arg4 = va_arg(ap, long); - return syscall(SYSIO_SYS_ioctl, I2NI(ino)->ni_fd, request, + err = + syscall(SYSIO_SYS_ioctl, + I2NI(ino)->ni_fd, +#if SYSIO_USE_BSD_IOCTL + (unsigned long int) +#endif + request, arg1, arg2, arg3, arg4); + if (err < 0) + err = -errno; + return err; } #else static int native_inop_ioctl(struct inode *ino __IS_UNUSED, - unsigned long int request __IS_UNUSED, + int request __IS_UNUSED, va_list ap __IS_UNUSED) { /* * I'm lazy. Maybe implemented later. */ - errno = ENOTTY; - return -1; + return -ENOTTY; } #endif |
From: Lee W. <lw...@us...> - 2005-09-06 14:35:40
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186/src Modified Files: Tag: LLNL_HPSS ioctl.c Log Message: POSIX defines the ioctl request to be of type `int' and not `unsigned long int' as we had it. Fixed. Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.12 retrieving revision 1.12.6.1 diff -u -w -b -B -p -r1.12 -r1.12.6.1 --- ioctl.c 21 Sep 2004 16:18:31 -0000 1.12 +++ ioctl.c 6 Sep 2005 14:35:32 -0000 1.12.6.1 @@ -54,7 +54,7 @@ #include "sysio-symbols.h" int -SYSIO_INTERFACE_NAME(ioctl)(int fd, unsigned long request, ...) +SYSIO_INTERFACE_NAME(ioctl)(int fd, int request, ...) { int err; struct file *fil; |
From: Lee W. <lw...@us...> - 2005-09-06 14:35:40
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186/drivers/incore Modified Files: Tag: LLNL_HPSS fs_incore.c Log Message: POSIX defines the ioctl request to be of type `int' and not `unsigned long int' as we had it. Fixed. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.24.2.1 retrieving revision 1.24.2.2 diff -u -w -b -B -p -r1.24.2.1 -r1.24.2.2 --- fs_incore.c 26 Aug 2005 17:07:27 -0000 1.24.2.1 +++ fs_incore.c 6 Sep 2005 14:35:32 -0000 1.24.2.2 @@ -151,7 +151,7 @@ static int _sysio_incore_filop_fcntl(str int cmd, va_list ap, int *rtn); static int _sysio_incore_inop_sync(struct inode *ino); static int _sysio_incore_filop_ioctl(struct inode *ino, - unsigned long int request, + int request, va_list ap); static int _sysio_incore_dirop_mknod(struct pnode *pno, mode_t mode, dev_t dev); #ifdef _HAVE_STATVFS @@ -180,7 +180,7 @@ static void _sysio_incore_inop_gone(stru (int (*)(struct inode *, int, va_list, int *))_sysio_do_eisdir #define _sysio_incore_dirop_ioctl \ (int (*)(struct inode *, \ - unsigned long int, \ + int, \ va_list))_sysio_do_eisdir static struct inode_ops _sysio_incore_dir_ops = { @@ -1607,7 +1607,7 @@ _sysio_incore_inop_sync(struct inode *in static int _sysio_incore_filop_ioctl(struct inode *ino __IS_UNUSED, - unsigned long int request __IS_UNUSED, + int request __IS_UNUSED, va_list ap __IS_UNUSED) { |
From: Lee W. <lw...@us...> - 2005-09-06 14:35:40
|
Update of /cvsroot/libsysio/libsysio/dev/stdfd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4186/dev/stdfd Modified Files: Tag: LLNL_HPSS stdfd.c Log Message: POSIX defines the ioctl request to be of type `int' and not `unsigned long int' as we had it. Fixed. Index: stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/dev/stdfd/stdfd.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -w -b -B -p -r1.14 -r1.14.2.1 --- stdfd.c 25 Jan 2005 00:36:46 -0000 1.14 +++ stdfd.c 6 Sep 2005 14:35:32 -0000 1.14.2.1 @@ -84,7 +84,7 @@ static int stdfd_iodone(struct ioctx *io static int stdfd_datasync(struct inode *ino); static int stdfd_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn); static int stdfd_ioctl(struct inode *ino, - unsigned long int request, + int request, va_list ap); int @@ -250,7 +250,7 @@ stdfd_datasync(struct inode *ino __IS_UN static int stdfd_ioctl(struct inode *ino __IS_UNUSED, - unsigned long int request __IS_UNUSED, + int request __IS_UNUSED, va_list ap __IS_UNUSED) { |
From: Lee W. <lw...@us...> - 2005-08-29 21:57:34
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19672 Modified Files: Tag: LLNL_HPSS configure.in Log Message: Fix the help message for --with-alternate-symbols to clue the user in about setting the qualifier to something other than the default "sysio_". Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.20.2.1 retrieving revision 1.20.2.2 diff -u -w -b -B -p -r1.20.2.1 -r1.20.2.2 --- configure.in 26 Aug 2005 17:07:27 -0000 1.20.2.1 +++ configure.in 29 Aug 2005 21:57:25 -0000 1.20.2.2 @@ -194,7 +194,7 @@ AC_ARG_WITH(tracing, AC_SUBST(TRACING) AC_ARG_WITH(alternate-symbols, - AC_HELP_STRING([--with-alternate-symbols], + AC_HELP_STRING([--with-alternate-symbols@<:@=<qualifier>@:>@], [Prepend standard, public, symbols with a unique qualifer]), [ case "${withval}" in yes) SYSIO_LABEL_NAMES=-DSYSIO_LABEL_NAMES=sysio_ ;; |
From: Lee W. <lw...@us...> - 2005-08-26 17:07:36
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26711/drivers/incore Modified Files: Tag: LLNL_HPSS fs_incore.c Log Message: Beginning updates for AIX. +Autoconf changes +Directory type changes Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -u -w -b -B -p -r1.24 -r1.24.2.1 --- fs_incore.c 4 Aug 2005 20:17:09 -0000 1.24 +++ fs_incore.c 26 Aug 2005 17:07:27 -0000 1.24.2.1 @@ -332,10 +332,14 @@ struct lookup_data { (namlen) + 1 + sizeof(void *)) & \ ~(sizeof(void *) - 1)) +#ifdef _DIRENT_HAVE_D_TYPE /* * Given mode bits, return directory entry type code. */ #define INCORE_D_TYPEOF(m) (((m) & S_IFMT) >> 12) +#else +#define INCORE_D_TYPEOF(m) (0) +#endif static char incore_dir_template[INCORE_D_RECLEN(1) + INCORE_D_RECLEN(2)]; #if 0 @@ -374,7 +378,9 @@ _sysio_incore_init() de->d_off = #endif off = de->d_reclen = INCORE_D_RECLEN(1); +#ifdef _DIRENT_HAVE_D_TYPE de->d_type = INCORE_D_TYPEOF(S_IFDIR); +#endif de->d_name[0] = '.'; #ifdef _DIRENT_HAVE_D_NAMLEN de->d_namlen = 1; @@ -391,7 +397,9 @@ _sysio_incore_init() de->d_off = #endif off += de->d_reclen; +#ifdef _DIRENT_HAVE_D_TYPE de->d_type = INCORE_D_TYPEOF(S_IFDIR); +#endif de->d_name[0] = de->d_name[1] = '.'; de->d_name[2] = ' '; @@ -771,7 +779,7 @@ incore_directory_match(struct intnl_dire struct lookup_data *ld) { -#if defined(BSD) || defined(REDSTORM) +#ifdef _DIRENT_HAVE_D_TYPE if (IFTODT(de->d_type) == DT_WHT) return NULL; #endif @@ -1016,7 +1024,12 @@ static int incore_directory_insert(struct incore_inode *parent, struct qstr *name, ino_t inum, - unsigned char type) + unsigned char type +#ifndef _DIRENT_HAVE_D_TYPE + __IS_UNUSED +#endif + + ) { size_t reclen; struct lookup_data lookup_data; @@ -1086,7 +1099,9 @@ incore_directory_insert(struct incore_in de->d_off = n; #endif de->d_reclen = reclen; +#ifdef _DIRENT_HAVE_D_TYPE de->d_type = type; +#endif (void )memcpy(de->d_name, name->name, name->len); #ifdef _DIRENT_HAVE_D_NAMLEN de->d_namlen = name->len; @@ -1101,7 +1116,9 @@ incore_directory_insert(struct incore_in (void *)de += reclen; de->d_ino = 0; de->d_reclen = n - xt; +#ifdef _DIRENT_HAVE_D_TYPE de->d_type = DT_WHT; +#endif de->d_namlen = 0; } #endif @@ -1222,7 +1239,9 @@ incore_unlink_entry(struct incore_inode #endif (void )memset(de, 0, reclen); #ifndef _DIRENT_HAVE_D_OFF +#ifdef _DIRENT_HAVE_D_TYPE de->d_type = (__uint8_t )DTTOIF(DT_WHT); +#endif de->d_reclen = reclen; #else lookup_data.de->d_off = off; |
From: Lee W. <lw...@us...> - 2005-08-26 17:07:36
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26711 Modified Files: Tag: LLNL_HPSS Rules.make configure.in Log Message: Beginning updates for AIX. +Autoconf changes +Directory type changes Index: Rules.make =================================================================== RCS file: /cvsroot/libsysio/libsysio/Rules.make,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -u -w -b -B -p -r1.10 -r1.10.4.1 --- Rules.make 18 Nov 2004 13:00:44 -0000 1.10 +++ Rules.make 26 Aug 2005 17:07:27 -0000 1.10.4.1 @@ -16,4 +16,4 @@ AM_CPPFLAGS = \ -D_POSIX_C_SOURCE=199506L -D_XOPEN_SOURCE=600 \ $(TRACING) \ $(AUTOMOUNT) $(ZERO_SUM_MEMORY) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \ - $(DEFER_INIT_CWD) -I$(top_srcdir)/include + $(DEFER_INIT_CWD) $(SYSIO_LABEL_NAMES) -I$(top_srcdir)/include Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -w -b -B -p -r1.20 -r1.20.2.1 --- configure.in 21 May 2005 03:24:27 -0000 1.20 +++ configure.in 26 Aug 2005 17:07:27 -0000 1.20.2.1 @@ -1,8 +1,10 @@ -AC_INIT(libsysio, 1.0) +AC_INIT(libsysio, 1.1) AC_CANONICAL_HOST case "$host_os" in + aix*) + ;; linux*) ;; *) @@ -180,6 +182,27 @@ if test x$with_lustre_hack = xyes; then AC_DEFINE(HAVE_LUSTRE_HACK) fi +AC_ARG_WITH(tracing, + AC_HELP_STRING([--with-tracing], + [enable tracing support]), + [ case "${withval}" in + yes) TRACING=-DSYSIO_TRACING=${withval} ;; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-tracing) ;; + esac], + [TRACING=-DSYSIO_TRACING=1]) +AC_SUBST(TRACING) + +AC_ARG_WITH(alternate-symbols, + AC_HELP_STRING([--with-alternate-symbols], + [Prepend standard, public, symbols with a unique qualifer]), + [ case "${withval}" in + yes) SYSIO_LABEL_NAMES=-DSYSIO_LABEL_NAMES=sysio_ ;; + no) ;; + *) SYSIO_LABEL_NAMES=-DSYSIO_LABEL_NAMES="${withval}" ;; + esac]) +AC_SUBST(SYSIO_LABEL_NAMES) + # 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. @@ -207,6 +230,12 @@ case "$host_os" in # These systems are always xcoff xcoff=yes elf=no + # ... and always needed... + AC_DEFINE(__USE_LARGEFILE64) + AC_DEFINE(_LARGE_FILES) + AC_DEFINE(_LARGE_FILE_API) + AC_DEFINE(_ALL_SOURCE) + AC_DEFINE(_XOPEN_SOURCE_EXTENDED) ;; esac |
From: Lee W. <lw...@us...> - 2005-08-26 17:07:36
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26711/include Modified Files: Tag: LLNL_HPSS sysio-cmn.h Log Message: Beginning updates for AIX. +Autoconf changes +Directory type changes Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -u -w -b -B -p -r1.5 -r1.5.2.1 --- sysio-cmn.h 25 Jan 2005 00:37:07 -0000 1.5 +++ sysio-cmn.h 26 Aug 2005 17:07:27 -0000 1.5.2.1 @@ -92,13 +92,13 @@ struct iovec; /* * SYSIO name label macros */ -#define XPREPEND(p,x) p ## x -#define PREPEND(p,x) XPREPEND(p,x) -#ifndef SYSIO_LABEL_NAMES -#define SYSIO_LABEL_NAMES 0 -#endif -#if SYSIO_LABEL_NAMES -#define SYSIO_INTERFACE_NAME(x) PREPEND(sysio_, x) +#ifdef SYSIO_LABEL_NAMES +#define _PREPEND_HELPER(p, x) \ + p ## x +#define PREPEND(p, x) \ + _PREPEND_HELPER(p, x) +#define SYSIO_INTERFACE_NAME(x) \ + PREPEND(SYSIO_LABEL_NAMES, x) #else #define SYSIO_INTERFACE_NAME(x) x #endif |
From: Lee W. <lw...@us...> - 2005-08-26 17:07:35
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26711/src Modified Files: Tag: LLNL_HPSS getdirentries.c Log Message: Beginning updates for AIX. +Autoconf changes +Directory type changes Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.20 retrieving revision 1.20.2.1 diff -u -w -b -B -p -r1.20 -r1.20.2.1 --- getdirentries.c 4 Aug 2005 20:17:10 -0000 1.20 +++ getdirentries.c 26 Aug 2005 17:07:27 -0000 1.20.2.1 @@ -202,7 +202,9 @@ SYSIO_INTERFACE_NAME(getdirentries)(int reclen = _dreclen(n); d64.d_ino = d64p->d_ino; d64.d_off = d64p->d_off; +#ifdef _DIRENT_HAVE_D_TYPE d64.d_type = d64p->d_type; +#endif d64.d_reclen = d64p->d_reclen; /* * Copy name first. @@ -228,7 +230,9 @@ SYSIO_INTERFACE_NAME(getdirentries)(int break; } fil->f_pos = dp->d_off; +#ifdef _DIRENT_HAVE_D_TYPE dp->d_type = d64.d_type; +#endif dp->d_reclen = reclen; /* * Fill the remainder with zeros. |
From: Lee W. <lw...@us...> - 2005-08-04 20:17:20
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4518/src Modified Files: dev.c getdirentries.c Log Message: Removed the internal getdirentries inode operation. The getdirentries function does not return the *next* block in it's basep argument. It simply return the cookie for the current block. We needed one that returns the *next*, so a new interface called filldirentries is present with this change. It takes, as it's second argument, a pointer to a value/result pair. The value should be set to the position to be read. The result is the position of the next block. All the included drivers have been updated. External drivers will require similar updates. Index: dev.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dev.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- dev.c 27 Jul 2004 15:00:43 -0000 1.9 +++ dev.c 4 Aug 2005 20:17:10 -0000 1.10 @@ -56,7 +56,7 @@ const struct inode_ops _sysio_nodev_ops _sysio_nodev_inop_lookup, _sysio_nodev_inop_getattr, _sysio_nodev_inop_setattr, - _sysio_nodev_getdirentries, + _sysio_nodev_filldirentries, _sysio_nodev_inop_mkdir, _sysio_nodev_inop_rmdir, _sysio_nodev_inop_symlink, Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- getdirentries.c 2 Aug 2005 20:25:25 -0000 1.19 +++ getdirentries.c 4 Aug 2005 20:17:10 -0000 1.20 @@ -85,20 +85,25 @@ #endif static ssize_t -filldirents(int fd, char *buf, size_t nbytes, _SYSIO_OFF_T * __restrict basep) +filldirents(struct file *fil, + char *buf, size_t nbytes, + _SYSIO_OFF_T *__restrict basep) { - struct file *fil; - - fil = _sysio_fd_find(fd); - if (!(fil && fil->f_ino)) - return -EBADF; + _SYSIO_OFF_T opos; + ssize_t cc; if (!S_ISDIR(fil->f_ino->i_stbuf.st_mode)) return -ENOTDIR; - return (*fil->f_ino->i_ops.inop_getdirentries)(fil->f_ino, - buf, nbytes, - basep); + opos = fil->f_pos; + cc = + (*fil->f_ino->i_ops.inop_filldirentries)(fil->f_ino, + &fil->f_pos, + buf, nbytes); + if (cc < 0) + return cc; + *basep = opos; + return cc; } static ssize_t @@ -108,12 +113,17 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdiren _SYSIO_OFF_T * __restrict basep) { + struct file *fil; ssize_t cc; SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER; - cc = filldirents(fd, buf, nbytes, basep); + fil = _sysio_fd_find(fd); + if (!(fil && fil->f_ino)) + return -EBADF; + + cc = filldirents(fil, buf, nbytes, basep); SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0); } @@ -167,6 +177,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int long * __restrict basep) #endif { + struct file *fil; _SYSIO_OFF_T b; ssize_t cc, count; struct dirent64 *d64p, d64; @@ -178,8 +189,11 @@ SYSIO_INTERFACE_NAME(getdirentries)(int SYSIO_INTERFACE_ENTER; - b = *basep; - count = cc = filldirents(fd, buf, nbytes, &b); + fil = _sysio_fd_find(fd); + if (!(fil && fil->f_ino)) + return -EBADF; + + count = cc = filldirents(fil, buf, nbytes, &b); d64p = (void *)buf; dp = (void *)buf; reclen = 0; @@ -213,7 +227,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int } break; } - *basep = dp->d_off; + fil->f_pos = dp->d_off; dp->d_type = d64.d_type; dp->d_reclen = reclen; /* @@ -238,6 +252,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int if (cc < 0) SYSIO_INTERFACE_RETURN(-1, cc); cc = (char *)dp - buf; + *basep = b; SYSIO_INTERFACE_RETURN(cc, 0); } #else /* !defined(DIRENT64_IS_NATURAL) */ |
From: Lee W. <lw...@us...> - 2005-08-04 20:17:19
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4518/include Modified Files: dev.h inode.h Log Message: Removed the internal getdirentries inode operation. The getdirentries function does not return the *next* block in it's basep argument. It simply return the cookie for the current block. We needed one that returns the *next*, so a new interface called filldirentries is present with this change. It takes, as it's second argument, a pointer to a value/result pair. The value should be set to the position to be read. The result is the position of the next block. All the included drivers have been updated. External drivers will require similar updates. Index: dev.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/dev.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- dev.h 26 Jul 2004 16:38:01 -0000 1.9 +++ dev.h 4 Aug 2005 20:17:10 -0000 1.10 @@ -80,11 +80,11 @@ extern const struct inode_ops _sysio_nod struct inode *, \ unsigned , \ struct intnl_stat *))_sysio_do_ebadf -#define _sysio_nodev_getdirentries \ +#define _sysio_nodev_filldirentries \ (ssize_t (*)(struct inode *, \ + _SYSIO_OFF_T *, \ char *, \ - size_t , \ - _SYSIO_OFF_T *))_sysio_do_illop + size_t))_sysio_do_illop #define _sysio_nodev_inop_mkdir \ (int (*)(struct pnode *, \ mode_t))_sysio_do_illop Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- inode.h 25 Feb 2005 00:01:06 -0000 1.24 +++ inode.h 4 Aug 2005 20:17:10 -0000 1.25 @@ -86,10 +86,10 @@ struct inode_ops { struct inode *ino, unsigned mask, struct intnl_stat *stbuf); - ssize_t (*inop_getdirentries)(struct inode *ino, + ssize_t (*inop_filldirentries)(struct inode *ino, + _SYSIO_OFF_T *posp, char *buf, - size_t nbytes, - _SYSIO_OFF_T *basep); + size_t nbytes); int (*inop_mkdir)(struct pnode *pno, mode_t mode); int (*inop_rmdir)(struct pnode *pno); int (*inop_symlink)(struct pnode *pno, const char *data); |
From: Lee W. <lw...@us...> - 2005-08-04 20:17:19
|
Update of /cvsroot/libsysio/libsysio/drivers/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4518/drivers/native Modified Files: fs_native.c Log Message: Removed the internal getdirentries inode operation. The getdirentries function does not return the *next* block in it's basep argument. It simply return the cookie for the current block. We needed one that returns the *next*, so a new interface called filldirentries is present with this change. It takes, as it's second argument, a pointer to a value/result pair. The value should be set to the position to be read. The result is the position of the next block. All the included drivers have been updated. External drivers will require similar updates. Index: fs_native.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/native/fs_native.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -w -b -B -p -r1.55 -r1.56 --- fs_native.c 4 Feb 2005 00:21:45 -0000 1.55 +++ fs_native.c 4 Aug 2005 20:17:09 -0000 1.56 @@ -86,13 +86,10 @@ #endif #if defined(SYSIO_SYS_getdirentries) -#define DIR_STREAMED 0 #define DIR_CVT_64 0 #elif defined(SYSIO_SYS_getdents64) -#define DIR_STREAMED 1 #define DIR_CVT_64 0 #elif defined(SYSIO_SYS_getdents) -#define DIR_STREAMED 1 #if defined(_LARGEFILE64_SOURCE) #define DIR_CVT_64 1 /* @@ -143,7 +140,8 @@ struct native_inode_identifier { struct native_inode { unsigned ni_seekok : 1, /* can seek? */ - ni_attrvalid : 1; /* cached attrs ok? */ + ni_attrvalid : 1, /* cached attrs ok? */ + ni_resetfpos : 1; /* reset fpos? */ struct native_inode_identifier ni_ident; /* unique identifier */ struct file_identifier ni_fileid; /* ditto */ int ni_fd; /* host fildes */ @@ -178,10 +176,10 @@ static int native_inop_setattr(struct pn struct inode *ino, unsigned mask, struct intnl_stat *stbuf); -static ssize_t native_getdirentries(struct inode *ino, +static ssize_t native_filldirentries(struct inode *ino, + _SYSIO_OFF_T *posp, char *buf, - size_t nbytes, - _SYSIO_OFF_T *basep); + size_t nbytes); 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); @@ -213,7 +211,7 @@ static struct inode_ops native_i_ops = { native_inop_lookup, native_inop_getattr, native_inop_setattr, - native_getdirentries, + native_filldirentries, native_inop_mkdir, native_inop_rmdir, native_inop_symlink, @@ -324,6 +322,8 @@ native_i_new(struct filesys *fs, time_t return NULL; bzero(&nino->ni_ident, sizeof(nino->ni_ident)); nino->ni_seekok = 0; + nino->ni_attrvalid = 0; + nino->ni_resetfpos = 0; nino->ni_ident.dev = buf->st_dev; nino->ni_ident.ino = buf->st_ino; #ifdef HAVE_GENERATION @@ -952,26 +952,31 @@ native_pos(int fd, _SYSIO_OFF_T *offset, } static ssize_t -native_filldirentries(struct native_inode *nino, +native_ifilldirentries(struct native_inode *nino, + _SYSIO_OFF_T *posp, char *buf, - size_t nbytes, - _SYSIO_OFF_T *basep) + size_t nbytes) { int err; ssize_t cc; - if (*basep < 0) + if (*posp < 0) return -EINVAL; -#if DIR_STREAMED /* * Stream-oriented access requires that we reposition prior to the * fill call. */ - if ((err = native_pos(nino->ni_fd, basep, SEEK_SET)) != 0) + assert(nino->ni_seekok); + if (*posp != nino->ni_fpos || nino->ni_resetfpos) { + nino->ni_fpos = *posp; + err = native_pos(nino->ni_fd, &nino->ni_fpos, SEEK_SET); + if (err) { + nino->ni_resetfpos = 1; return err; -#endif - nino->ni_fpos = *basep; + } + nino->ni_resetfpos = 0; + } cc = #if defined(SYSIO_SYS_getdirentries) @@ -979,7 +984,7 @@ native_filldirentries(struct native_inod nino->ni_fd, buf, nbytes, - basep); + &waste); #elif defined(SYSIO_SYS_getdents64) syscall(SYSIO_SYS_getdents64, nino->ni_fd, buf, nbytes); #elif defined(SYSIO_SYS_getdents) @@ -988,24 +993,26 @@ native_filldirentries(struct native_inod if (cc < 0) return -errno; -#if DIR_STREAMED /* * Stream-oriented access requires that we discover where we are * after the call. */ - *basep = 0; - if ((err = native_pos(nino->ni_fd, basep, SEEK_CUR)) != 0) + if ((err = native_pos(nino->ni_fd, &nino->ni_fpos, SEEK_CUR)) != 0) { + /* + * Leave the position at the old I suppose. + */ + nino->ni_resetfpos = 1; return err; -#endif - nino->ni_fpos = *basep; + } + *posp = nino->ni_fpos; return cc; } static ssize_t -native_getdirentries(struct inode *ino, +native_filldirentries(struct inode *ino, + _SYSIO_OFF_T *posp, char *buf, - size_t nbytes, - _SYSIO_OFF_T *basep) + size_t nbytes) { struct native_inode *nino = I2NI(ino); #if DIR_CVT_64 @@ -1015,12 +1022,6 @@ native_getdirentries(struct inode *ino, struct dirent64 *d64p; size_t namlen; size_t reclen; - /* - * Work-around for broken 64 bit basep update - * Get value of basep to return from last directory - * entry d_off value - */ - _SYSIO_OFF_T last_offset = *basep; #else #define bp buf #define count nbytes @@ -1037,7 +1038,7 @@ native_getdirentries(struct inode *ino, return -ENOMEM; } #endif - cc = native_filldirentries(nino, bp, count, basep); + cc = native_ifilldirentries(nino, posp, bp, count); if (cc < 0) { #if DIR_CVT_64 free(bp); @@ -1047,30 +1048,31 @@ native_getdirentries(struct inode *ino, #if DIR_CVT_64 ldp = (struct linux_dirent *)bp; d64p = (struct dirent64 *)buf; - for (;;) { - if (cc < 0 || (size_t )cc <= sizeof(*ldp)) - break; + while (cc) { namlen = strlen(ldp->ld_name); - reclen = sizeof(*d64p) - sizeof(d64p->d_name) + namlen + 1; - if (nbytes < reclen) + reclen = sizeof(*d64p) - sizeof(d64p->d_name) + namlen; + if (nbytes <= reclen) break; d64p->d_ino = ldp->ld_ino; - d64p->d_off = ldp->ld_off; + d64p->d_off = nino->ni_fpos = ldp->ld_off; d64p->d_reclen = - (((reclen + sizeof(long) - 1)) / sizeof(long)) * - sizeof(long); + (((reclen + sizeof(long))) / sizeof(long)) * sizeof(long); if (nbytes < d64p->d_reclen) - d64p->d_reclen = reclen; + d64p->d_reclen = reclen + 1; d64p->d_type = DT_UNKNOWN; /* you lose -- sorry. */ - (void )strncpy(d64p->d_name, ldp->ld_name, namlen); - *(d64p->d_name + namlen) = '\0'; + (void )memcpy(d64p->d_name, ldp->ld_name, namlen); + /* + * Zero pad the rest. + */ + for (cp = d64p->d_name + namlen, n = d64p->d_reclen - reclen; + n; + n--) + *cp++ = 0; cc -= ldp->ld_reclen; ldp = (struct linux_dirent *)((char *)ldp + ldp->ld_reclen); nbytes -= d64p->d_reclen; - last_offset = d64p->d_off; d64p = (struct dirent64 *)((char *)d64p + d64p->d_reclen); } - nino->ni_fpos = *basep = last_offset; free(bp); cc = (d64p == (struct dirent64 *)buf && cc) @@ -1222,6 +1224,7 @@ native_inop_open(struct pnode *pno, int /* * Invariant; First open. Must init. */ + nino->ni_resetfpos = 0; nino->ni_fpos = 0; nino->ni_fd = fd; /* @@ -1259,6 +1262,7 @@ native_inop_close(struct inode *ino) return -errno; nino->ni_fd = -1; + nino->ni_resetfpos = 0; nino->ni_fpos = 0; return 0; } @@ -1348,13 +1352,10 @@ dopio(void *buf, size_t count, _SYSIO_OF { ssize_t cc; - if (!(off == nio->nio_nino->ni_fpos || nio->nio_nino->ni_seekok)) - return -ESPIPE; - if (!nio->nio_nino->ni_seekok) { if (off != nio->nio_nino->ni_fpos) { /* - * They've done a p{read,write} or somesuch. Can't + * They're trying to reposition. Can't * seek on this descriptor so we err out now. */ errno = ESPIPE; @@ -1407,8 +1408,11 @@ doiov(const struct iovec *iov, int err; err = native_pos(nio->nio_nino->ni_fd, &off, SEEK_SET); - if (err) + if (err) { + nio->nio_nino->ni_resetfpos = 1; return err; + } + nio->nio_nino->ni_resetfpos = 0; nio->nio_nino->ni_fpos = off; } |
From: Lee W. <lw...@us...> - 2005-08-04 20:17:19
|
Update of /cvsroot/libsysio/libsysio/drivers/yod In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4518/drivers/yod Modified Files: fs_yod.c Log Message: Removed the internal getdirentries inode operation. The getdirentries function does not return the *next* block in it's basep argument. It simply return the cookie for the current block. We needed one that returns the *next*, so a new interface called filldirentries is present with this change. It takes, as it's second argument, a pointer to a value/result pair. The value should be set to the position to be read. The result is the position of the next block. All the included drivers have been updated. External drivers will require similar updates. Index: fs_yod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/yod/fs_yod.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- fs_yod.c 4 Feb 2005 00:21:45 -0000 1.21 +++ fs_yod.c 4 Aug 2005 20:17:10 -0000 1.22 @@ -160,10 +160,10 @@ static int yod_inop_setattr(struct pnode struct inode *ino, unsigned mask, struct intnl_stat *stbuf); -static ssize_t yod_getdirentries(struct inode *ino, +static ssize_t yod_filldirentries(struct inode *ino, + off64_t *posp, char *buf, - size_t nbytes, - off64_t *basep); + size_t nbytes); static int yod_inop_mkdir(struct pnode *pno, mode_t mode); static int yod_inop_rmdir(struct pnode *pno); static int yod_inop_symlink(struct pnode *pno, const char *data); @@ -195,7 +195,7 @@ static struct inode_ops yod_i_ops = { yod_inop_lookup, yod_inop_getattr, yod_inop_setattr, - yod_getdirentries, + yod_filldirentries, yod_inop_mkdir, yod_inop_rmdir, yod_inop_symlink, @@ -740,10 +740,10 @@ out: } static ssize_t -yod_getdirentries(struct inode *ino, +yod_filldirentries(struct inode *ino, char *buf, - size_t nbytes, - _SYSIO_OFF_T *basep) + _SYSIO_OFF_T *posp, + size_t nbytes) { struct yod_inode *nino = I2NI(ino); _SYSIO_OFF_T result; @@ -754,15 +754,19 @@ yod_getdirentries(struct inode *ino, result = *basep; if (*basep != nino->ni_fpos && (result = lseek_yod(nino->ni_fd, - *basep, + *posp, SEEK_SET) == -1)) return -errno; nino->ni_fpos = result; memset(buf, 0, nbytes); + /* + * This is almost certainly broken. The resulting position parameter + * points to the block just filled, not the next. + */ cc = getdirentries_yod(nino->ni_fd, buf, nbytes, &result); if (cc < 0) return -errno; - nino->ni_fpos = *basep = result; + nino->ni_fpos = *posp = result; return cc; } |
From: Lee W. <lw...@us...> - 2005-08-04 20:17:17
|
Update of /cvsroot/libsysio/libsysio/drivers/incore In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4518/drivers/incore Modified Files: fs_incore.c Log Message: Removed the internal getdirentries inode operation. The getdirentries function does not return the *next* block in it's basep argument. It simply return the cookie for the current block. We needed one that returns the *next*, so a new interface called filldirentries is present with this change. It takes, as it's second argument, a pointer to a value/result pair. The value should be set to the position to be read. The result is the position of the next block. All the included drivers have been updated. External drivers will require similar updates. Index: fs_incore.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/drivers/incore/fs_incore.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- fs_incore.c 25 Jan 2005 00:36:47 -0000 1.23 +++ fs_incore.c 4 Aug 2005 20:17:09 -0000 1.24 @@ -131,10 +131,10 @@ static int _sysio_incore_inop_setattr(st struct inode *ino, unsigned mask, struct intnl_stat *stbuf); -static ssize_t _sysio_incore_dirop_getdirentries(struct inode *ino, +static ssize_t _sysio_incore_dirop_filldirentries(struct inode *ino, + _SYSIO_OFF_T *posp, char *buf, - size_t nbytes, - _SYSIO_OFF_T *basep); + size_t nbytes); 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); @@ -187,7 +187,7 @@ static struct inode_ops _sysio_incore_di _sysio_incore_dirop_lookup, _sysio_incore_inop_getattr, _sysio_incore_inop_setattr, - _sysio_incore_dirop_getdirentries, + _sysio_incore_dirop_filldirentries, _sysio_incore_dirop_mkdir, _sysio_incore_dirop_rmdir, _sysio_incore_dirop_symlink, @@ -217,11 +217,11 @@ static struct inode_ops _sysio_incore_di struct inode **, \ struct intent *, \ const char *))_sysio_do_illop -#define _sysio_incore_filop_getdirentries \ +#define _sysio_incore_filop_filldirentries \ (ssize_t (*)(struct inode *, \ + _SYSIO_OFF_T *, \ char *, \ - size_t, \ - _SYSIO_OFF_T *))_sysio_do_illop + size_t))_sysio_do_illop #define _sysio_incore_filop_mkdir \ (int (*)(struct pnode *, mode_t))_sysio_do_illop #define _sysio_incore_filop_rmdir \ @@ -243,7 +243,7 @@ static struct inode_ops _sysio_incore_fi _sysio_incore_filop_lookup, _sysio_incore_inop_getattr, _sysio_incore_inop_setattr, - _sysio_incore_filop_getdirentries, + _sysio_incore_filop_filldirentries, _sysio_incore_filop_mkdir, _sysio_incore_filop_rmdir, _sysio_incore_filop_symlink, @@ -272,7 +272,7 @@ static struct inode_ops _sysio_incore_de _sysio_incore_filop_lookup, _sysio_incore_inop_getattr, _sysio_incore_inop_setattr, - _sysio_incore_filop_getdirentries, + _sysio_incore_filop_filldirentries, _sysio_incore_filop_mkdir, _sysio_incore_filop_rmdir, _sysio_incore_filop_symlink, @@ -955,31 +955,30 @@ incore_directory_enumerate(struct intnl_ } static ssize_t -_sysio_incore_dirop_getdirentries(struct inode *ino, +_sysio_incore_dirop_filldirentries(struct inode *ino, + _SYSIO_OFF_T *posp, char *buf, - size_t nbytes, - _SYSIO_OFF_T *basep) + size_t nbytes) { struct incore_inode *icino = I2IC(ino); off_t off; struct intnl_dirent *de; struct copy_info copy_info; - if (*basep > icino->ici_st.st_size) + if (*posp >= icino->ici_st.st_size) return 0; de = incore_directory_probe(icino->ici_data, icino->ici_st.st_size, - *basep, + *posp, (probe_ty )incore_directory_position, NULL, - (char *)icino->ici_data + *basep); + (char *)icino->ici_data + *posp); if (!de) { /* * Past EOF. */ - *basep = 0; return 0; } @@ -997,7 +996,7 @@ _sysio_incore_dirop_getdirentries(struct icino->ici_st.st_atime = time(NULL); if (!nbytes) return -EOVERFLOW; - *basep = nbytes; + *posp += nbytes; return (ssize_t )nbytes; } |