afs: Fix some dcache-related comments
[openafs.git] / src / afs / afs.h
index 9a396a4..39a8e57 100644 (file)
@@ -135,6 +135,7 @@ struct sysname_info {
 #ifdef AFS_DARWIN_ENV
 #define        BOP_MOVE        5        /* ptr1 afs_uspc_param ptr2 sname ptr3 dname */
 #endif
+#define BOP_PARTIAL_STORE 6     /* parm1 is chunk to store */
 
 #define        B_DONTWAIT      1       /* On failure return; don't wait */
 
@@ -244,6 +245,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
@@ -440,6 +442,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 */
@@ -654,6 +657,7 @@ struct SimpleLocks {
 #endif
 #define CCreating      0x00400000      /* avoid needless store after open truncate */
 #define CPageHog       0x00800000      /* AIX - dumping large cores is a page hog. */
+#define CCorrupt       0x01000000      /* corrupt dir already reported */
 #define CDCLock                0x02000000      /* Vnode lock held over call to GetDownD */
 #define CBulkFetching  0x04000000      /* stats are being fetched by bulk stat */
 #define CExtendedFile  0x08000000      /* extended file via ftruncate call. */
@@ -722,9 +726,9 @@ struct SimpleLocks {
 #else
 #define VREFCOUNT(v)           ((v)->vrefCount)
 #define VREFCOUNT_GT(v,y)     ((v)->vrefCount > (y))
-#define VREFCOUNT_SET(v, c)    (v)->vrefCount = c;
-#define VREFCOUNT_DEC(v)       (v)->vrefCount--;
-#define VREFCOUNT_INC(v)       (v)->vrefCount++;
+#define VREFCOUNT_SET(v, c)    (v)->vrefCount = c
+#define VREFCOUNT_DEC(v)       (v)->vrefCount--
+#define VREFCOUNT_INC(v)       (v)->vrefCount++
 #define d_unhash(d) list_empty(&(d)->d_hash)
 #define dget_locked(d) dget(d)
 #endif
@@ -926,6 +930,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;
@@ -1381,9 +1392,14 @@ extern struct brequest afs_brs[NBRS];    /* request structures */
     (((rw) == UIO_WRITE) ? afs_write(avc, uio, io, cred, 1) : afs_read(avc, uio, cred, 1))
 
 /* Cache size truncation uses the following low and high water marks:
- * If the cache is more than 95% full (CM_DCACHECOUNTFREEPCT), the cache
- * truncation daemon is awakened and will free up space until the cache is 85%
- * (CM_DCACHESPACEFREEPCT - CM_DCACHEEXTRAPCT) full.
+ * If the cache is more than 90% full by space (CM_DCACHESPACEFREEPCT) or
+ * 95% full by # of chunks (CM_DCACHECOUNTFREEPCT), the cache truncation
+ * daemon is awakened and will start freeing space. The cache truncation
+ * daemon will continue to free space until the cache is at most 85% full
+ * by space (CM_DCACHESPACEFREEPCT - CM_DCACHEEXTRAPCT). The cache truncation
+ * daemon will also try to free space until the cache is at most 90% full by
+ * chunks (CM_DCACHECOUNTFREEPCT - CM_DCACHEEXTRAPCT), but the 85% space limit
+ * is the only limit that we must hit.
  * afs_UFSWrite and afs_GetDCache (when it needs to fetch data) will wait on
  * afs_WaitForCacheDrain if the cache is 98% (CM_WAITFORDRAINPCT) full.
  * afs_GetDownD wakes those processes once the cache is 95% full
@@ -1402,7 +1418,7 @@ extern struct brequest afs_brs[NBRS];     /* request structures */
 
 #define afs_CacheIsTooFull() \
     (afs_blocksUsed - afs_blocksDiscarded > \
-       PERCENT(CM_DCACHECOUNTFREEPCT, afs_cacheBlocks) || \
+       PERCENT(CM_DCACHESPACEFREEPCT, afs_cacheBlocks) || \
      afs_freeDCCount - afs_discardDCCount < \
        PERCENT(100 - CM_DCACHECOUNTFREEPCT, afs_cacheFiles))
 
@@ -1492,12 +1508,8 @@ struct afs_fakestat_state {
 };
 
 extern int afs_fakestat_enable;
-
-#ifdef AFS_MAXVCOUNT_ENV
+extern int afs_rmtsys_enable;
 extern int afsd_dynamic_vcaches;
-#else
-#define afsd_dynamic_vcaches 0
-#endif
 
 /*
  * Wrappers for access to credentials structure members