]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: Remove 'slept' from osi_VM_FlushVCache
authorAndrew Deason <adeason@sinenomine.net>
Fri, 18 May 2012 21:49:31 +0000 (17:49 -0400)
committerDaria Brashear <shadow@your-file-system.com>
Fri, 12 Dec 2014 21:58:05 +0000 (16:58 -0500)
No implementation of osi_VM_FlushVCache drops and reacquires
afs_xvcache. Doing so would cause problems when afs_FlushVCache calls
osi_VM_FlushVCache, since someone could grab a reference to the vcache
while xvcache is dropped. So, prohibit dropping and reacquiring
afs_xvcache in osi_VM_FlushVCache, and remove the 'slept' argument to
it.

Change-Id: I50b4ee35f54a5277749f44e93b1094e4fb5c93e9
Reviewed-on: http://gerrit.openafs.org/7435
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
16 files changed:
src/afs/AIX/osi_vm.c
src/afs/DARWIN/osi_vm.c
src/afs/FBSD/osi_vm.c
src/afs/HPUX/osi_vm.c
src/afs/IRIX/osi_vm.c
src/afs/LINUX/osi_prototypes.h
src/afs/LINUX/osi_vm.c
src/afs/LINUX24/osi_prototypes.h
src/afs/LINUX24/osi_vm.c
src/afs/NBSD/osi_vcache.c
src/afs/NBSD/osi_vm.c
src/afs/OBSD/osi_vm.c
src/afs/SOLARIS/osi_vm.c
src/afs/UKERNEL/osi_vm.c
src/afs/afs_prototypes.h
src/afs/afs_vcache.c

index b7e233816dada2f2a44b24e4af442dc07b7e64f5..c2e11737de33ac9b6105d158c3c38c2eebd2a7bc 100644 (file)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     if (avc->vrefCount != 0)
        return EBUSY;
index 805cb38f0c17c6c83d9abda649b946adddef1c98..f847037529c23959e1bdec77c2bd8ff119cd0378 100644 (file)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  *
  * OSF/1 Locking:  VN_LOCK has been called.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     struct vnode *vp = AFSTOV(avc);
     kern_return_t kret;
index 40ba11904659a90d56cc2c2559f177c54fa601f2..d475d914ec9c24cc616a65eae8a0d7b844d96519 100644 (file)
@@ -10,7 +10,7 @@
 
 /* osi_vm.c implements:
  *
- * osi_VM_FlushVCache(avc, slept)
+ * osi_VM_FlushVCache(avc)
  * osi_ubc_flush_dirty_and_wait(vp, flags)
  * osi_VM_StoreAllSegments(avc)
  * osi_VM_TryToSmush(avc, acred, sync)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  *
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     struct vnode *vp;
     int code;
index 0e169bd0f7dd68b4beba2d9d3176e4df9ab86f12..ef87e910800f588d0052568a56b5d8def49f15f5 100644 (file)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     if (avc->vrefCount > 1)
        return EBUSY;
index 50a61aeb70edf6ae3586ef42ddf840c0cd96f2c6..7d07be07698401acd620e7e3763b3138322ece2a 100644 (file)
@@ -25,15 +25,10 @@ extern struct vnodeops Afs_vnodeops;
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     int s, code;
     vnode_t *vp = &avc->v;
index 316065f18f7e457c81005283671672cd1520a793..277b50a93a3b256cdfd067e01549791d3016a86b 100644 (file)
@@ -73,7 +73,7 @@ extern int osi_sysctl_init(void);
 extern void osi_sysctl_clean(void);
 
 /* osi_vm.c */
-extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
+extern int osi_VM_FlushVCache(struct vcache *avc);
 extern void osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred,
                              int sync);
 extern void osi_VM_FSyncInval(struct vcache *avc);
index 8bc792e45535b87597597f665305abbefe222d88..d9e767d2dcf7bad4f40801e1f7d556a854c700e7 100644 (file)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     struct inode *ip = AFSTOV(avc);
 
index ad2522cacd75c6e5479b1c0ca953428711364006..cb4bee153219b10ba1a7e828079f4caceec81849 100644 (file)
@@ -70,7 +70,7 @@ extern int osi_sysctl_init(void);
 extern void osi_sysctl_clean(void);
 
 /* osi_vm.c */
-extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
+extern int osi_VM_FlushVCache(struct vcache *avc);
 extern void osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred,
                              int sync);
 extern void osi_VM_FSyncInval(struct vcache *avc);
index 747e37b7dfb5b57e657ae4a7b958fba5649a05ff..ea65ff547a197841c42e65462b3b3cff8c0f3110 100644 (file)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     struct inode *ip = AFSTOV(avc);
 
index 8b37efa35f31ad7be50ca714e2607a1b7f70f36d..6ceefc9bc7c050b4f5fbf80620d5f5b39e9b2318 100644 (file)
@@ -24,7 +24,7 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep)
        printf("%s enter\n", __func__);
     }
 
-    if (osi_VM_FlushVCache(avc, slept) != 0) {
+    if (osi_VM_FlushVCache(avc) != 0) {
        code = 0;
     } else {
        code = 1;
index 5cc2beb3fa3772a25788205d1deb208a9113ef4e..d3524294d32b1f711b16b3fbce3480c790f6e047 100644 (file)
@@ -10,7 +10,7 @@
 
 /* osi_vm.c implements:
  *
- * osi_VM_FlushVCache(avc, slept)
+ * osi_VM_FlushVCache(avc)
  * osi_ubc_flush_dirty_and_wait(vp, flags)
  * osi_VM_StoreAllSegments(avc)
  * osi_VM_TryToSmush(avc, acred, sync)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  *
  * OSF/1 Locking:  VN_LOCK has been called.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     struct vnode *vp = AFSTOV(avc);
 
@@ -110,7 +105,7 @@ osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred, int sync)
     }
 
     ReleaseWriteLock(&avc->lock);
-    osi_VM_FlushVCache(avc, NULL);
+    osi_VM_FlushVCache(avc);
     ObtainWriteLock(&avc->lock, 59);
 
     if ((afs_debug & AFSDEB_VNLAYER) != 0) {
index 737b742310d3649ffbcea0f23f059ee761d638d2..419516121ae650b8f23387845dd0246d4828eb46 100644 (file)
@@ -10,7 +10,7 @@
 
 /* osi_vm.c implements:
  *
- * osi_VM_FlushVCache(avc, slept)
+ * osi_VM_FlushVCache(avc)
  * osi_ubc_flush_dirty_and_wait(vp, flags)
  * osi_VM_StoreAllSegments(avc)
  * osi_VM_TryToSmush(avc, acred, sync)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  *
  * OSF/1 Locking:  VN_LOCK has been called.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     struct vnode *vp = AFSTOV(avc);
 
index 10fbb333055fcefe888274bf56cc540514efeefc..99f1439c24e031458417c908868b7578ac6aabe0 100644 (file)
@@ -89,15 +89,10 @@ osi_VM_MultiPageConflict(struct vcache *avc, struct dcache *adc)
  * We also do some non-VM-related chores, such as releasing the cred pointer
  * (for AIX and Solaris) and releasing the gnode (for AIX).
  *
- * Locking:  afs_xvcache lock is held.  If it is dropped and re-acquired,
- *   *slept should be set to warn the caller.
- *
- * Formerly, afs_xvcache was dropped and re-acquired for Solaris, but now it
- * is not dropped and re-acquired for any platform.  It may be that *slept is
- * therefore obsolescent.
+ * Locking:  afs_xvcache lock is held. It must not be dropped.
  */
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     if (avc->vrefCount != 0)
        return EBUSY;
index a0e7fd677d10681fd3cbaf22f8ca204d284be91d..3585ce3b71ed2b9de92448eb485f86f8c9a32280 100644 (file)
@@ -22,7 +22,7 @@ osi_VM_Truncate(struct vcache *avc, int alen, afs_ucred_t *acred)
 }
 
 int
-osi_VM_FlushVCache(struct vcache *avc, int *slept)
+osi_VM_FlushVCache(struct vcache *avc)
 {
     return 0;
 }
index a2853db0f5d56163aed02fec0923855693a74ff9..0ad3e6959d1e970c4cef0247ecff77627eaf3802 100644 (file)
@@ -747,7 +747,7 @@ extern afs_int32 osi_get_group_pag(afs_ucred_t *cred);
 
 
 /* ARCH/osi_vm.c */
-extern int osi_VM_FlushVCache(struct vcache *avc, int *slept);
+extern int osi_VM_FlushVCache(struct vcache *avc);
 extern void osi_VM_StoreAllSegments(struct vcache *avc);
 extern void osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred,
                              int sync);
index 72b511c4f2ba8116e828da329673b93ab740a5ab..dad73bbfe7b23856d5c08a572a3a1c23922f7503 100644 (file)
@@ -143,7 +143,7 @@ afs_FlushVCache(struct vcache *avc, int *slept)
     afs_Trace2(afs_iclSetp, CM_TRACE_FLUSHV, ICL_TYPE_POINTER, avc,
               ICL_TYPE_INT32, avc->f.states);
 
-    code = osi_VM_FlushVCache(avc, slept);
+    code = osi_VM_FlushVCache(avc);
     if (code)
        goto bad;