Linux: Make dir dentry aliases act like symlinks
[openafs.git] / src / afs / afs.h
index ca5509a..6a24cc0 100644 (file)
@@ -95,13 +95,15 @@ extern int afs_shuttingdown;
 #define        AFS_NRXPACKETS  80
 #define        AFS_RXDEADTIME  50
 #define AFS_HARDDEADTIME       120
-#define        AFS_IDLEDEADTIME        50
+#define        AFS_IDLEDEADTIME        1200
+#define AFS_IDLEDEADTIME_REP    180 /* more than fs's cb dead time */
 #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;
+extern afs_int32 afs_rx_idledead_rep;
 
 struct sysname_info {
     char *name;
@@ -129,10 +131,7 @@ struct sysname_info {
 #define        BOP_FETCH       1       /* parm1 is chunk to get */
 #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
 #ifdef AFS_DARWIN_ENV
 #define        BOP_MOVE        5        /* ptr1 afs_uspc_param ptr2 sname ptr3 dname */
 #endif
@@ -245,6 +244,7 @@ struct vrequest {
     char tokenError;            /* a token error other than expired. */
     char idleError;             /* the server idled too long */
     char skipserver[AFS_MAXHOSTS];
+    afs_int32 lasterror[AFS_MAXHOSTS];
 };
 #define VOLMISSING 1
 #define VOLBUSY 2
@@ -383,6 +383,8 @@ struct unixuser {
 struct sa_conn_vector;
 typedef struct sa_conn_vector * p_sa_conn_vector; /* forward decl */
 
+#define CONN_REPLICATED 0x1
+
 struct afs_conn {
     int refCount;
     int activated;
@@ -406,6 +408,7 @@ struct sa_conn_vector {
     struct srvAddr *srvr;      /* server associated with this conn */
     short refCount;            /* reference count for allocation */
     unsigned short port;       /* port associated with this connection */
+    int flags;
 
     /* next connection to return when all in cvec are fully utilized */
     int select_index; 
@@ -438,6 +441,7 @@ struct srvAddr {
     struct srvAddr *next_sa;   /* another interface on same host */
     struct server *server;     /* back to parent */
     struct sa_conn_vector *conns;   /* All user connections to this server */
+    struct afs_conn *natping;
     afs_int32 sa_ip;           /* Host addr in network byte order */
     u_short sa_iprank;         /* indiv ip address priority */
     u_short sa_portal;         /* port addr in network byte order */
@@ -682,7 +686,6 @@ struct SimpleLocks {
 
 /*... to be continued ...  */
 
-#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 */
@@ -696,7 +699,6 @@ struct SimpleLocks {
                                                                                 * 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)
@@ -893,14 +895,13 @@ struct vcache {
     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 */
+    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
+    off_t next_seq_offset;     /* Next sequential offset (used by prefetch/readahead) */
+#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI65_ENV)
+    off_t next_seq_blk_offset; /* accounted in blocks for Solaris & IRIX */
 #endif
 
 #if    defined(AFS_SUN5_ENV)
@@ -927,6 +928,13 @@ struct vcache {
 #if defined(AFS_LINUX26_ENV)
     cred_t *cred;              /* last writer's cred */
 #endif
+#ifdef AFS_LINUX24_ENV
+    struct dentry *target_link; /* dentry we prefer, when we are redirecting
+                                 * all requests due to duplicate dentry aliases.
+                                 * See LINUX/osi_vnodeops.c. Note that this is
+                                 * NOT an actual reference to a dentry, so this
+                                 * pointer MUST NOT be dereferenced on its own. */
+#endif
     afs_int32 vc_error;                /* stash write error for this vnode. */
     int xlatordv;              /* Used by nfs xlator */
     afs_ucred_t *uncred;
@@ -1493,12 +1501,7 @@ struct afs_fakestat_state {
 };
 
 extern int afs_fakestat_enable;
-
-#ifdef AFS_MAXVCOUNT_ENV
 extern int afsd_dynamic_vcaches;
-#else
-#define afsd_dynamic_vcaches 0
-#endif
 
 /*
  * Wrappers for access to credentials structure members