]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vol: consolide afs_xxxx macros in ihandle.h
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 5 Mar 2011 19:25:34 +0000 (14:25 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 8 Mar 2011 14:30:56 +0000 (06:30 -0800)
Various definitions of afs_open, afs_stat, etc. were
scattered across the .c sources within the vol package.
Consolidate them all in ihandle.h which is included in
all of the files and contains the OS_xxxx macros which
will substitute for many afs_xxxx calls in future patchsets.

Change-Id: I72363332fd5f1d330e225df51c68d4c113b59f3b
Reviewed-on: http://gerrit.openafs.org/4147
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
16 files changed:
src/tviced/serialize_state.c
src/tviced/state_analyzer.c
src/venus/afsio.c
src/viced/afsfileprocs.c
src/viced/viced.c
src/vol/ihandle.c
src/vol/ihandle.h
src/vol/listinodes.c
src/vol/namei_ops.c
src/vol/nuke.c
src/vol/partition.c
src/vol/vg_scan.c
src/vol/vol-info.c
src/vol/vol-salvage.c
src/vol/volume.c
src/volser/vol-dump.c

index 6b2dbff2c04d9604a7dc28ca00a5b7c8fca35df6..b2b30117aab3aa40af4d0ed033cd5399cf900dfa 100644 (file)
 #include "../viced/callback.h"
 #include "serialize_state.h"
 
-/*@+fcnmacros +macrofcndecl@*/
-#ifdef O_LARGEFILE
-#ifdef S_SPLINT_S
-extern off64_t afs_lseek(int FD, off64_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)    lseek64(FD, (off64_t)(O), F)
-#define afs_stat               stat64
-#define afs_fstat              fstat64
-#define afs_open               open64
-#define afs_fopen              fopen64
-#define afs_ftruncate           ftruncate64
-#define afs_mmap                mmap64
-#ifdef AFS_AIX_ENV
-extern void * mmap64();  /* ugly hack since aix build env appears to be somewhat broken */
-#endif
-#else /* !O_LARGEFILE */
-#ifdef S_SPLINT_S
-extern off_t afs_lseek(int FD, off_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)    lseek(FD, (off_t)(O), F)
-#define afs_stat               stat
-#define afs_fstat              fstat
-#define afs_open               open
-#define afs_fopen              fopen
-#define afs_ftruncate           ftruncate
-#define afs_mmap                mmap
-#endif /* !O_LARGEFILE */
-/*@=fcnmacros =macrofcndecl@*/
-
-
 #ifdef AFS_DEMAND_ATTACH_FS
 
 /*
index 05dcb31604b814886a5fd4f7b22991cda3e5d903..2185013b3f4898f85db4cbd71f862338bab1d239 100644 (file)
 #include <sys/mman.h>
 #include <unistd.h>
 
-/*@+fcnmacros +macrofcndecl@*/
-#ifdef O_LARGEFILE
-#ifdef S_SPLINT_S
-extern off64_t afs_lseek(int FD, off64_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)    lseek64(FD, (off64_t)(O), F)
-#define afs_stat               stat64
-#define afs_fstat              fstat64
-#define afs_open               open64
-#define afs_fopen              fopen64
-#define afs_mmap                mmap64
-#ifdef AFS_AIX_ENV
-extern void * mmap64();  /* ugly hack since aix build env appears to be somewhat broken */
-#endif
-#else /* !O_LARGEFILE */
-#ifdef S_SPLINT_S
-extern off_t afs_lseek(int FD, off_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)    lseek(FD, (off_t)(O), F)
-#define afs_stat               stat
-#define afs_fstat              fstat
-#define afs_open               open
-#define afs_fopen              fopen
-#define afs_mmap                mmap
-#endif /* !O_LARGEFILE */
-/*@=fcnmacros =macrofcndecl@*/
-
 
 #ifndef AFS_DEMAND_ATTACH_FS
 int
index f0690c60a0c658a1f14f32f32fc3fb01eb21aa94..2e026492ac6343911cea48a1c11ecf49c195f1bf 100644 (file)
 #include <rx/rx_prototypes.h>
 #include <hcrypto/md5.h>
 
-#ifdef O_LARGEFILE
-#define afs_stat        stat64
-#define afs_fstat       fstat64
-#define afs_open        open64
-#else /* !O_LARGEFILE */
-#define afs_stat        stat
-#define afs_fstat       fstat
-#define afs_open        open
-#endif /* !O_LARGEFILE */
 #ifdef AFS_PTHREAD_ENV
 #include <assert.h>
 pthread_key_t uclient_key;
index 86c740427c064bacc108b794eb24f7bc48316b1b..9ba8b8814517be242c17441c471aecb0bd9c7169 100644 (file)
@@ -119,17 +119,6 @@ extern void FidZero(DirHandle * file);
 pthread_mutex_t fileproc_glock_mutex;
 #endif /* AFS_PTHREAD_ENV */
 
-#ifdef O_LARGEFILE
-#define afs_stat       stat64
-#define afs_fstat      fstat64
-#define afs_open       open64
-#else /* !O_LARGEFILE */
-#define afs_stat       stat
-#define afs_fstat      fstat
-#define afs_open       open
-#endif /* !O_LARGEFILE */
-
-
 /* Useful local defines used by this module */
 
 #define        DONTCHECK       0
index 50a259aa53a1d821c828ac25f1b03c00f1fcb890..f2df45c2af4f75baad40740f32050c3e7e870ee5 100644 (file)
 #endif
 #include <rx/rx_globals.h>
 
-#ifdef O_LARGEFILE
-#define afs_stat       stat64
-#define afs_fstat      fstat64
-#define afs_open       open64
-#define afs_fopen      fopen64
-#else /* !O_LARGEFILE */
-#define afs_stat       stat
-#define afs_fstat      fstat
-#define afs_open       open
-#define afs_fopen      fopen
-#endif /* !O_LARGEFILE */
-
 extern int etext;
 
 void *ShutDown(void *);
index 1bf19589aa6f108572a82a7c9d74ce1fa2c87fae..287cfc534f56db2145488e47cc1c1337b9f6b3b3 100644 (file)
 #include "afs/afs_assert.h"
 #include <limits.h>
 
-#ifndef AFS_NT40_ENV
-#ifdef O_LARGEFILE
-#define afs_stat       stat64
-#define afs_fstat      fstat64
-#else /* !O_LARGEFILE */
-#define        afs_stat        stat
-#define        afs_fstat       fstat
-#endif /* !O_LARGEFILE */
-#endif /* AFS_NT40_ENV */
-
 #ifdef AFS_PTHREAD_ENV
 pthread_once_t ih_glock_once = PTHREAD_ONCE_INIT;
 pthread_mutex_t ih_glock_mutex;
index 3f863cd2ec7db2ed7b2d29953706f5735fdd27a5..93a101c3ae24032bb372e8ad797930026c946a12 100644 (file)
@@ -549,4 +549,55 @@ extern afs_sfsize_t ih_size(FD_t);
 #define FDH_LOCKFILE(H, O) OS_LOCKFILE((H)->fd_fd, O)
 #define FDH_UNLOCKFILE(H, O) OS_UNLOCKFILE((H)->fd_fd, O)
 
+#ifdef AFS_NT40_ENV
+#define afs_stat_st     __stat64
+#define afs_stat       _stat64
+#define afs_fstat      _fstat64
+#define afs_fopen      fopen
+#define afs_open       open
+#define afs_lseek(FD, O, F)    _lseeki64(FD, O, F)
+#else
+#ifdef O_LARGEFILE
+#define afs_stat_st     stat64
+#define afs_stat       stat64
+#define afs_fstat      fstat64
+#define afs_fopen      fopen64
+#define afs_open       open64
+#ifdef S_SPLINT_S
+extern off64_t afs_lseek(int FD, off64_t O, int F);
+#endif /*S_SPLINT_S */
+#define afs_lseek(FD, O, F)    lseek64(FD, (off64_t) (O), F)
+#define afs_ftruncate           ftruncate64
+#define afs_mmap                mmap64
+#ifdef AFS_AIX_ENV
+extern void * mmap64();  /* ugly hack since aix build env appears to be somewhat broken */
+#endif
+#else /* !O_LARGEFILE */
+#define afs_stat_st     stat
+#define        afs_stat        stat
+#define        afs_fstat       fstat
+#define afs_fopen      fopen
+#define afs_open       open
+#ifdef S_SPLINT_S
+extern off_t afs_lseek(int FD, off_t O, int F);
+#endif /*S_SPLINT_S */
+#define afs_lseek(FD, O, F)    lseek(FD, (off_t) (O), F)
+#define afs_ftruncate           ftruncate
+#define afs_mmap                mmap
+#endif /* !O_LARGEFILE */
+#if AFS_HAVE_STATVFS64
+# define afs_statvfs   statvfs64
+#else
+# if AFS_HAVE_STATFS64
+#  define afs_statfs   statfs64
+#else
+#  if AFS_HAVE_STATVFS
+#   define afs_statvfs statvfs
+#  else
+#   define afs_statfs  statfs
+#  endif /* !AFS_HAVE_STATVFS */
+# endif        /* !AFS_HAVE_STATFS64 */
+#endif /* !AFS_HAVE_STATVFS64 */
+#endif /* AFS_NT40_ENV */
+
 #endif /* _IHANDLE_H_ */
index fd608aa759c132e48c554bab8e52e0da5f748ed9..d13a2a190f3564f1cacb5ce09d2871930f4404ea 100644 (file)
@@ -112,28 +112,6 @@ ListViceInodes(char *devname, char *mountedOn, FILE *inodeFile,
 #include "fssync.h"
 #include "volume_inline.h"
 
-/*@+fcnmacros +macrofcndecl@*/
-#ifdef O_LARGEFILE
-#ifdef S_SPLINT_S
-extern off64_t afs_lseek(int FD, off64_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)   lseek64(FD, (off64_t) (O), F)
-#define afs_stat      stat64
-#define afs_fstat     fstat64
-#define afs_open      open64
-#define afs_fopen     fopen64
-#else /* !O_LARGEFILE */
-#ifdef S_SPLINT_S
-extern off_t afs_lseek(int FD, off_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)   lseek(FD, (off_t) (O), F)
-#define afs_stat      stat
-#define afs_fstat     fstat
-#define afs_open      open
-#define afs_fopen     fopen
-#endif /* !O_LARGEFILE */
-/*@=fcnmacros =macrofcndecl@*/
-
 /* Notice:  parts of this module have been cribbed from vfsck.c */
 
 #define        ROOTINODE       2
index dc3457d82f994835b6f434718203ee38208675fe..8d7585ab76ca1bc4fa9e6d44e7f062830b02f71a 100644 (file)
 #include <afs/errmap_nt.h>
 #endif
 
-/*@+fcnmacros +macrofcndecl@*/
-#ifdef O_LARGEFILE
-#ifdef S_SPLINT_S
-#endif /*S_SPLINT_S */
-#define afs_stat               stat64
-#define afs_fstat              fstat64
-#define afs_fopen              fopen64
-#else /* !O_LARGEFILE */
-#ifdef S_SPLINT_S
-#endif /*S_SPLINT_S */
-#define afs_stat               stat
-#define afs_fstat              fstat
-#define afs_fopen              fopen
-#endif /* !O_LARGEFILE */
-/*@=fcnmacros =macrofcndecl@*/
-
 #ifndef LOCK_SH
 #define   LOCK_SH   1    /* shared lock */
 #define   LOCK_EX   2    /* exclusive lock */
index 7313c2b78256785567318a421104966cb959b03c..c430803d22420458175d1620f84bdb623c3d22dc 100644 (file)
 #include "fssync.h"
 #include "common.h"
 
-#ifdef O_LARGEFILE
-#define afs_stat       stat64
-#else /* !O_LARGEFILE */
-#define afs_stat       stat
-#endif /* !O_LARGEFILE */
-
 struct Lock localLock;
 
 #define MAXATONCE      100
index 4ec19b907cd9ae2d0250fc43bd749c295c29a19a..f2ca2c5a6d0f225421192620020e21341ceabab1 100644 (file)
 #include <jfs/filsys.h>
 #endif
 
-#ifdef O_LARGEFILE
-
-#define afs_stat       stat64
-#define afs_open       open64
-#define afs_fopen      fopen64
-#ifndef AFS_NT40_ENV
-#if AFS_HAVE_STATVFS64
-# define afs_statvfs   statvfs64
-#else
-# if AFS_HAVE_STATFS64
-#  define afs_statfs   statfs64
-#else
-#  if AFS_HAVE_STATVFS
-#   define afs_statvfs statvfs
-#  else
-#   define afs_statfs  statfs
-#  endif /* !AFS_HAVE_STATVFS */
-# endif        /* !AFS_HAVE_STATFS64 */
-#endif /* !AFS_HAVE_STATVFS64 */
-#endif /* !AFS_NT40_ENV */
-
-#else /* !O_LARGEFILE */
-
-#define afs_stat       stat
-#define afs_open       open
-#define afs_fopen      fopen
-#ifndef AFS_NT40_ENV
-#if AFS_HAVE_STATVFS
-#define afs_statvfs    statvfs
-#else /* !AFS_HAVE_STATVFS */
-#define afs_statfs     statfs
-#endif /* !AFS_HAVE_STATVFS */
-#endif /* !AFS_NT40_ENV */
-
-#endif /* !O_LARGEFILE */
-
 int aixlow_water = 8;          /* default 8% */
 struct DiskPartition64 *DiskPartitionList;
 
index 391f9504a96bf4f857f9a5949eac526b059e58a2..93a28015d974c4b1587249f619b75ec9ebc99073 100644 (file)
 #include "vg_cache.h"
 #include "vg_cache_impl.h"
 
-#ifdef O_LARGEFILE
-#define afs_open       open64
-#else /* !O_LARGEFILE */
-#define afs_open       open
-#endif /* !O_LARGEFILE */
-
 static int _VVGC_scan_table_init(VVGCache_scan_table_t * tbl);
 static int _VVGC_scan_table_add(VVGCache_scan_table_t * tbl,
                                struct DiskPartition64 * dp,
index 667df83955a096b3f5e4509edbb489756f193e07..9a9f086287d6e33298a63b4af1876e954b2cea0a 100644 (file)
 
 #include <dirent.h>
 
-#ifdef O_LARGEFILE
-#define afs_stat       stat64
-#define afs_fstat      fstat64
-#define afs_open       open64
-#else /* !O_LARGEFILE */
-#define afs_stat       stat
-#define afs_fstat      fstat
-#define afs_open       open
-#endif /* !O_LARGEFILE */
-
 int DumpVnodes = 0;            /* Dump everything, i.e. summary of all vnodes */
 int DumpInodeNumber = 0;       /* Dump inode numbers with vnodes */
 int DumpDate = 0;              /* Dump vnode date (server modify date) with vnode */
index 932ef40a7f389ddf0f0c0afed7661d04a9ed1efd..44a3778d0461092c23496e81a4391301d5431d2f 100644 (file)
@@ -204,28 +204,6 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
 #include <pthread.h>
 #endif
 
-/*@+fcnmacros +macrofcndecl@*/
-#ifdef O_LARGEFILE
-#ifdef S_SPLINT_S
-extern off64_t afs_lseek(int FD, off64_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)    lseek64(FD, (off64_t) (O), F)
-#define afs_stat       stat64
-#define afs_fstat      fstat64
-#define afs_open       open64
-#define afs_fopen      fopen64
-#else /* !O_LARGEFILE */
-#ifdef S_SPLINT_S
-extern off_t afs_lseek(int FD, off_t O, int F);
-#endif /*S_SPLINT_S */
-#define afs_lseek(FD, O, F)    lseek(FD, (off_t) (O), F)
-#define afs_stat       stat
-#define afs_fstat      fstat
-#define afs_open       open
-#define afs_fopen      fopen
-#endif /* !O_LARGEFILE */
-/*@=fcnmacros =macrofcndecl@*/
-
 #ifdef AFS_OSF_ENV
 extern void *calloc();
 #endif
index c34ae4ca71b085d9739e8da57b4a61a1e9f35bb4..5fc4787591e1b100a5eb63836772b1fdf41fa381 100644 (file)
 #include <stddef.h>
 #endif
 
-#ifdef O_LARGEFILE
-#define afs_stat       stat64
-#define afs_fstat      fstat64
-#define afs_open       open64
-#else /* !O_LARGEFILE */
-#define afs_stat       stat
-#define afs_fstat      fstat
-#define afs_open       open
-#endif /* !O_LARGEFILE */
-
 #ifdef AFS_PTHREAD_ENV
 pthread_mutex_t vol_glock_mutex;
 pthread_mutex_t vol_trans_mutex;
index 912f0b417fd6da8ec251f022bdddd7950d82dfa8..adcdc3e2b2c4c5c3ae48c8c157fb8703a8246ef8 100644 (file)
 #define putint32(p, v)  *p++ = v>>24, *p++ = v>>16, *p++ = v>>8, *p++ = v
 #define putshort(p, v) *p++ = v>>8, *p++ = v
 
-#ifdef O_LARGEFILE
-#define afs_stat       stat64
-#define afs_fstat      fstat64
-#define afs_open       open64
-#else /* !O_LARGEFILE */
-#define afs_stat       stat
-#define afs_fstat      fstat
-#define afs_open       open
-#endif /* !O_LARGEFILE */
-
 int VolumeChanged;             /* needed by physio - leave alone */
 int verbose = 0;