#if defined(AFS_HPUX102_ENV)
#define AFS_FLOCK k_flock
#else
-#if defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV) && !defined(AFS_IA64_LINUX26_ENV) && !defined(AFS_S390X_LINUX26_ENV) && !defined(AFS_ALPHA_LINUX26_ENV))
+#if defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !(defined(AFS_LINUX26_ENV) && defined(AFS_LINUX_64BIT_KERNEL)))
#define AFS_FLOCK flock64
#else
#define AFS_FLOCK flock
#define VPageCleaning 0x2 /* Solaris - Cache Trunc Daemon sez keep out */
#define CPSIZE 2
-#if defined(AFS_XBSD_ENV)
+#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
#define vrefCount v->v_usecount
#else
#define vrefCount v.v_count
extern afs_uint32 afs_stampValue; /* stamp for pair's usage */
#define MakeStamp() (++afs_stampValue)
-#if defined(AFS_XBSD_ENV)
+#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
#define VTOAFS(v) ((struct vcache *)(v)->v_data)
#define AFSTOV(vc) ((vc)->v)
#else
* !(avc->nextfree) && !avc->vlruq.next => (FreeVCList == avc->nextfree)
*/
struct vcache {
-#if defined(AFS_XBSD_ENV)
+#if defined(AFS_XBSD_ENV)||defined(AFS_DARWIN_ENV)
struct vnode *v;
#else
struct vnode v; /* Has reference count in v.v_count */
#define NULLIDX (-1) /* null index definition */
/* struct dcache states bits */
+#define DRO 1
+#define DBackup 2
+#define DRW 4
#define DWriting 8 /* file being written (used for cache validation) */
/* dcache data flags */
#endif
#endif
+struct buffer {
+ afs_int32 fid; /* is adc->index, the cache file number */
+ afs_inode_t inode; /* is adc->f.inode, the inode number of the cac\
+ he file */
+ afs_int32 page;
+ afs_int32 accesstime;
+ struct buffer *hashNext;
+ char *data;
+ char lockers;
+ char dirty;
+ char hashIndex;
+#if AFS_USEBUFFERS
+ struct buf *bufp;
+#endif
+ afs_rwlock_t lock; /* the lock for this structure */
+};
+
/* kept on disk and in dcache entries */
struct fcache {
struct VenusFid fid; /* Fid for this file */
char mflags; /* Meta flags */
struct fcache f; /* disk image */
afs_int32 stamp; /* used with vtodc struct for hints */
-
+ afs_int32 bucket; /* which bucket these dcache entries are in */
/*
* Locking rules:
*
/* this is obsolete and should be removed */
#define ihint stamp
+/* afs_memcache.c */
+struct memCacheEntry {
+ int size; /* # of valid bytes in this entry */
+ int dataSize; /* size of allocated data area */
+ afs_lock_t afs_memLock;
+ char *data; /* bytes */
+};
+
/* macro to mark a dcache entry as bad */
#define ZapDCE(x) \
do { \
extern int afs_fakestat_enable;
-struct buffer {
- afs_int32 fid; /* is adc->index, the cache file number */
- afs_inode_t inode; /* is adc->f.inode, the inode number of the cache file */
- afs_int32 page;
- afs_int32 accesstime;
- struct buffer *hashNext;
- char *data;
- char lockers;
- char dirty;
- char hashIndex;
-#if AFS_USEBUFFERS
- struct buf *bufp;
-#endif
- afs_rwlock_t lock; /* the lock for this structure */
-};
-
-/* afs_memcache.c */
-struct memCacheEntry {
- int size; /* # of valid bytes in this entry */
- int dataSize; /* size of allocated data area */
- afs_lock_t afs_memLock;
- char *data; /* bytes */
-};
-
/* First 32 bits of capabilities */
#define CAPABILITY_ERRORTRANS (1<<0)