#define AFS_NRXPACKETS 80
#define AFS_RXDEADTIME 50
#define AFS_HARDDEADTIME 120
+#define AFS_IDLEDEADTIME 50
+#define AFS_BLKBITS 12
+#define AFS_BLKSIZE (1 << AFS_BLKBITS)
extern afs_int32 afs_rx_deadtime;
extern afs_int32 afs_rx_harddead;
+extern afs_int32 afs_rx_idledead;
struct sysname_info {
char *name;
#define BOP_STORE 2 /* parm1 is chunk to store */
#define BOP_PATH 3 /* parm1 is path, parm2 is chunk to fetch */
+#if defined(AFS_CACHE_BYPASS)
+#define BOP_FETCH_NOCACHE 4 /* parms are: vnode ptr, offset, segment ptr, addr, cred ptr */
+#endif
+
#define B_DONTWAIT 1 /* On failure return; don't wait */
/* protocol is: refCount is incremented by user to take block out of free pool.
char volumeError; /* encountered a missing or busy volume */
char networkError; /* encountered network problems */
char permWriteError; /* fileserver returns permenent error. */
+ char tokenError; /* a token error other than expired. */
+ char idleError; /* the server idled too long */
+ char skipserver[MAXHOSTS];
};
#define VOLMISSING 1
#define VOLBUSY 2
time_t timeout; /* data expire time, if non-zero */
struct cell_name *cnamep; /* pointer to our cell_name */
afs_rwlock_t lock; /* protects cell data */
+ unsigned char cellHandle[16]; /* deterministic handle for this cell */
};
struct cell_name {
#define UPrimary 4 /* on iff primary identity */
#define UNeedsReset 8 /* needs afs_ResetAccessCache call done */
#define UPAGCounted 16 /* entry seen during PAG search (for stats) */
+#define UNFSGetCreds 32 /* getting creds for NFS client */
/* A flag used by afs_GCPAGs to keep track of
* which entries in afs_users need to be deleted.
* The lifetime of its presence in the table is the
extern afs_int32 afs_gcpags;
extern afs_int32 afs_gcpags_procsize;
extern afs_int32 afs_bkvolpref;
+extern char afs_cachebasedir[1024];
+extern afs_int32 afs_numcachefiles;
+extern afs_int32 afs_numfilesperdir;
struct unixuser {
struct unixuser *next; /* next hash pointer */
char *stp; /* pointer to ticket itself */
struct ClearToken ct;
struct afs_exporter *exporter; /* more info about the exporter for the remote user */
+ void *cellinfo; /* pointer to cell info (PAG manager only) */
};
struct conn {
#endif
#define CUnique 0x00001000 /* vc's uniquifier - latest unifiquier for fid */
#define CForeign 0x00002000 /* this is a non-afs vcache */
+#define CReadDir 0x00004000 /* readdir in progress */
#define CUnlinked 0x00010000
#define CBulkStat 0x00020000 /* loaded by a bulk stat, and not ref'd since */
#define CUnlinkedDel 0x00040000
#define CVFlushed 0x00080000
#define CCore1 0x00100000 /* osf1 core file; not same as CCore above */
+#ifdef AFS_LINUX22_ENV
+#define CPageWrite 0x00200000 /* to detect vm deadlock - linux */
+#else
#define CWritingUFS 0x00200000 /* to detect vm deadlock - used by sgi */
+#endif
#define CCreating 0x00400000 /* avoid needless store after open truncate */
#define CPageHog 0x00800000 /* AIX - dumping large cores is a page hog. */
#define CDCLock 0x02000000 /* Vnode lock held over call to GetDownD */
#define VRevokeWait 0x1
#define VPageCleaning 0x2 /* Solaris - Cache Trunc Daemon sez keep out */
+#if defined(AFS_DISCON_ENV)
+
+/* Dirty disconnected vcache flags. */
+#define VDisconSetTime 0x00000001 /* set time. */
+#define VDisconSetMode 0x00000002 /* set mode. */
+/* XXX: to be continued ? */
+#define VDisconTrunc 0x00000020 /* truncate file. */
+#define VDisconSetAttrMask 0x0000003F /* Masks for setattr ops. */
+#define VDisconWriteClose 0x00000400 /* Write op on file close. */
+#define VDisconWriteFlush 0x00000800 /* Write op on normal fsync/flush. */
+#define VDisconWriteOsiFlush 0x00001000 /* Write op on osi flush. */
+
+#define VDisconShadowed 0x00002000 /* Shadowed dir. */
+#define VDisconRemove 0x00004000 /* Remove vnop. */
+#define VDisconCreate 0x00008000 /* Create vnop. */
+#define VDisconRename 0x00010000 /* Rename vnop. */
+#define VDisconRenameSameDir 0x00020000 /* Rename in same dir. */
+
+/*... to be continued ... */
+#endif
+
+#if defined(AFS_CACHE_BYPASS)
+/* vcache (file) cachingStates bits */
+#define FCSDesireBypass 0x1 /* This file should bypass the cache */
+#define FCSBypass 0x2 /* This file is currently NOT being cached */
+#define FCSManuallySet 0x4 /* The bypass flags were set, or reset, manually (via pioctl)
+ and should not be overridden by the file's name */
+
+/* Flag values used by the Transition routines */
+#define TRANSChangeDesiredBit 0x1 /* The Transition routine should set or
+ * reset the FCSDesireBypass bit */
+#define TRANSVcacheIsLocked 0x2 /* The Transition routine does not need to
+ * lock vcache (it's already locked) */
+#define TRANSSetManualBit 0x4 /* The Transition routine should set FCSManuallySet so that
+ * filename checking does not override pioctl requests */
+#endif /* AFS_CACHE_BYPASS */
+
#define CPSIZE 2
#if defined(AFS_XBSD_ENV) || defined(AFS_DARWIN_ENV)
#define vrefCount v->v_usecount
#endif
struct vcache *hnext; /* Hash next */
struct afs_q vhashq; /* Hashed per-volume list */
+
+#if defined(AFS_DISCON_ENV)
+ /*! Next element in afs_DDirtyVCList. Lock it with afs_DDirtyVCListLock. */
+ struct vcache *ddirty_next;
+ /*! Disconnected flags for this vcache element. */
+ uint32_t ddirty_flags;
+ /*! Shadow vnode + unique keep the shadow dir location. */
+ afs_uint32 shVnode;
+ afs_uint32 shUnique;
+ /*! The old parent FID for renamed vnodes. */
+ afs_uint32 oldVnode;
+ afs_uint32 oldUnique;
+#endif
+
struct VenusFid fid;
struct mstat {
afs_size_t Length;
* this file. */
short flockCount; /* count of flock readers, or -1 if writer */
char mvstat; /* 0->normal, 1->mt pt, 2->root. */
+
+#if defined(AFS_CACHE_BYPASS)
+ char cachingStates; /* Caching policies for this file */
+ afs_uint32 cachingTransitions; /* # of times file has flopped between caching and not */
+#if defined(AFS_LINUX24_ENV)
+ off_t next_seq_offset; /* Next sequential offset (used by prefetch/readahead) */
+#else
+ off_t next_seq_blk_offset; /* accounted in blocks for Solaris & IRIX */
+#endif
+#endif
+
afs_uint32 states; /* state bits */
#if defined(AFS_SUN5_ENV)
afs_uint32 vstates; /* vstate bits */
#endif /* defined(AFS_SUN5_ENV) */
struct dcache *dchint;
+ struct dcache *dcreaddir; /* dcache for in-progress readdir */
+ unsigned int readdir_pid; /* pid of the thread in readdir */
#ifdef AFS_LINUX22_ENV
u_short mapcnt; /* Number of mappings of this file. */
#endif
#endif
#endif
+
+#ifdef KERNEL
+/* it does not compile outside kernel */
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\
afs_int32 chunkBytes; /* Num bytes in this chunk */
char states; /* Has this chunk been modified? */
};
+#endif
/* magic numbers to specify the cache type */
/*#define afs_DirtyPages(avc) (((avc)->states & CDirty) || osi_VMDirty_p((avc)))*/
#define afs_DirtyPages(avc) ((avc)->states & CDirty)
+#define afs_InReadDir(avc) (((avc)->states & CReadDir) && (avc)->readdir_pid == MyPidxx)
+
/* The PFlush algorithm makes use of the fact that Fid.Unique is not used in
below hash algorithms. Change it if need be so that flushing algorithm
doesn't move things from one hash chain to another
};
extern int afs_fakestat_enable;
-
#endif /* _AFS_H_ */