Thread: [Libsysio-commit] LLNL_HPSS: libsysio/drivers/incore fs_incore.c
Brought to you by:
lward
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-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-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 /* |