]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r423,
authorSam Hartman <hartmans@debian.org>
Mon, 28 Jan 2002 00:24:18 +0000 (00:24 +0000)
committerSam Hartman <hartmans@debian.org>
Mon, 28 Jan 2002 00:24:18 +0000 (00:24 +0000)
which included commits to RCS files with non-trunk default branches.

acconfig.h
acinclude.m4
src/afs/LINUX/osi_vm.c
src/afs/afs_osi.c
src/afs/afs_vcache.c

index ece70bd0edfc6835459787fbde93e5ad6e4300f6..f2d08791707183f723e4c48bb9611f0e4460eedd 100644 (file)
@@ -31,6 +31,8 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #undef INODE_SETATTR_NOT_VOID
 #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
 #undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
+#undef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
+#undef STRUCT_INODE_HAS_I_DEVICES
 
 /* glue for RedHat kernel bug */
 #undef ENABLE_REDHAT_BUILDSYS
index 7d985f7a6f88403fd57cc4a3fcad27062164c567..8e31a6c07da31414e59bc294bd6e5228f2498c8b 100644 (file)
@@ -140,6 +140,12 @@ case $system in
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
                  AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM)
                 fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES)
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS)
+                fi
                 :
                fi
                 ;;
index c3aa5d55f0323a04d4f1fd42a33d6524fc31ac31..f856bac1274463cfdaa2c2f524117120bfe75dac 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vm.c,v 1.1.1.6 2001/10/14 17:59:08 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vm.c,v 1.1.1.7 2002/01/28 00:24:18 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -89,7 +89,15 @@ void osi_VM_FSyncInval(struct vcache *avc)
  */
 void osi_VM_StoreAllSegments(struct vcache *avc)
 {
-
+#ifdef AFS_LINUX24_ENV
+    struct inode *ip = (struct inode *) avc;
+   
+    ReleaseWriteLock(&avc->lock);
+    AFS_GUNLOCK();
+    write_inode_now(ip, 1);
+    AFS_GLOCK();
+    ObtainWriteLock(&avc->lock, 121);
+#endif
 }
 
 /* Purge VM for a file when its callback is revoked.
index 7e6de81f85d76290a88e2fb626c7c8b0cd5f3756..079dd4a6fe89325bf406592c3780029622f88e35 100644 (file)
@@ -10,7 +10,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.8 2002/01/22 19:47:59 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_osi.c,v 1.1.1.9 2002/01/28 00:24:06 hartmans Exp $");
 
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
@@ -280,37 +280,49 @@ afs_gfs_FlushText(vp)
 
 #endif /* AFS_TEXT_ENV */
 
+/* mask signals in afsds */
+void afs_osi_MaskSignals(){
+#ifdef AFS_LINUX22_ENV
+    osi_linux_mask();
+#endif
+}
+    
+/* unmask signals in rxk listener */
+void afs_osi_UnmaskRxkSignals(){
+#ifdef AFS_LINUX22_ENV
+    osi_linux_unmask();
+#endif
+}
+    
+/* register rxk listener proc info */
+void afs_osi_RxkRegister(){
+#ifdef AFS_LINUX22_ENV
+    osi_linux_rxkreg();
+#endif
+}
+
 /* procedure for making our processes as invisible as we can */
 void afs_osi_Invisible() {
-#ifndef        AFS_AIX32_ENV
-    /* called once per "kernel" lwp to make it invisible */
+#ifdef AFS_LINUX22_ENV
+    afs_osi_MaskSignals();
+#endif 
 #ifdef AFS_DEC_ENV
     u.u_procp->p_type |= SSYS;
-#else
-#if    defined(AFS_SUN5_ENV)
+#endif 
+#if AFS_SUN5_ENV
     curproc->p_flag |= SSYS;
-#else
-#if defined(AFS_SGI_ENV)
-    vrelvm();
 #endif
-#ifdef AFS_SUN_ENV
-    relvm(u.u_procp);  /* release all the resources */
-#endif
-#if    defined(AFS_HPUX101_ENV)
+#if AFS_HPUX101_ENV
     set_system_proc(u.u_procp);
-#else
+#endif
 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     /* maybe call init_process instead? */
     current_proc()->p_flag |= P_SYSTEM;
-#else
-#if !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
-    u.u_procp->p_flag |= SSYS;
-#endif /* AFS_SGI64_ENV */
-#endif
-#endif
-#endif
-#endif
 #endif
+#if defined(AFS_SGI_ENV)
+    vrelvm();
+#endif /* AFS_SGI_ENV */
+
     AFS_STATCNT(osi_Invisible);
 }
 
index 5c1c57aa2e7e2d269383a418a039584930a059e4..1ced2e0bc6ba604551a4530fd54e51124382658e 100644 (file)
@@ -38,7 +38,7 @@
 #include <afsconfig.h>
 #include "../afs/param.h"
 
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.10 2002/01/22 19:48:01 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_vcache.c,v 1.1.1.11 2002/01/28 00:24:08 hartmans Exp $");
 
 #include "../afs/sysincludes.h" /*Standard vendor system headers*/
 #include "../afs/afsincludes.h" /*AFS-based standard headers*/
@@ -525,97 +525,6 @@ afs_RemoveVCB(afid)
 } /*afs_RemoveVCB*/
 
 
-#if defined(AFS_LINUX22_ENV)
-/* afs_TryFlushDcacheChildren -- Shakes loose vcache references held by
- *                               children of the dentry
- * LOCKS -- Called with afs_xvcache write locked. Drops and reaquires
- *          AFS_GLOCK, so it can call dput, which may call iput, but
- *          keeps afs_xvcache exclusively.
- *
- * Tree traversal algorithm from fs/dcache.c: select_parent()
- */
-static void afs_TryFlushDcacheChildren(struct dentry *parent)
-{
-    struct dentry *this_parent = parent;
-    struct list_head *next;
-
- repeat:
-    next = this_parent->d_subdirs.next;
- resume:
-    while (next != &this_parent->d_subdirs) {
-       struct list_head *tmp = next;
-       struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
-
-       next = tmp->next;
-       if (!DCOUNT(dentry) && !dentry->d_inode) {
-           DGET(dentry);
-           DUNLOCK();
-           AFS_GUNLOCK();
-           d_drop(dentry);
-           dput(dentry);
-           AFS_GLOCK();
-           DLOCK();
-           goto repeat;
-       }
-        
-       /*
-        * Descend a level if the d_subdirs list is non-empty.
-        */
-       if (!list_empty(&dentry->d_subdirs)) {
-           this_parent = dentry;
-           goto repeat;
-       }
-    }
-    /*
-     * All done at this level ... ascend and resume the search.
-     */
-    if (this_parent != parent) {
-       next = this_parent->d_child.next;
-       this_parent = this_parent->d_parent;
-       goto resume;
-    }
-}
-
-/* afs_TryFlushDcache -- Shakes loose vcache references held by the Linux
- *                       dcache.
- *
- * LOCKS -- Called with afs_xvcache write locked. Drops and reaquires
- *          AFS_GLOCK, so it can call dput, which may call iput, but
- *          keeps afs_xvcache exclusively.
- */
-static void afs_TryFlushDcache(struct vcache *vcp)
-{
-    struct inode *ip = (struct inode *) vcp;
-  
-    DLOCK();
- retry:
-    if (!list_empty(&ip->i_dentry)) {
-       struct list_head *cur, *head = &ip->i_dentry;
-       cur = head;
-       while ((cur = cur->next) != head) {
-           struct dentry *dentry = list_entry(cur, struct dentry, d_alias);
-
-           if (DCOUNT(dentry)) {
-               afs_TryFlushDcacheChildren(dentry);
-           }
-           
-           if (!DCOUNT(dentry)) {
-               DGET(dentry);
-               DUNLOCK();
-               AFS_GUNLOCK();
-               d_drop(dentry);
-               dput(dentry);
-               AFS_GLOCK();
-               DLOCK();
-               goto retry;
-           }
-       }
-       DUNLOCK();
-    }
-}
-#endif
-           
 /*
  * afs_NewVCache
  *
@@ -650,6 +559,63 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
     int code, fv_slept;
 
     AFS_STATCNT(afs_NewVCache);
+#ifdef AFS_LINUX22_ENV
+    if (!freeVCList) {
+       /* Free some if possible. */
+        struct afs_q *tq, *uq;
+        int i; char *panicstr;
+        int vmax = 2 * afs_cacheStats;
+        int vn = VCACHE_FREE;
+       
+        i = 0;
+        for(tq = VLRU.prev; tq != &VLRU && vn > 0; tq = uq) {
+           tvc = QTOV(tq);
+           uq = QPrev(tq);
+           if (tvc->states & CVFlushed) 
+                refpanic ("CVFlushed on VLRU");
+           else if (i++ > vmax)
+                refpanic ("Exceeded pool of AFS vnodes(VLRU cycle?)");
+           else if (QNext(uq) != tq)
+                refpanic ("VLRU inconsistent");
+           
+           if (tvc == afs_globalVp)
+               continue;
+           
+           if ( VREFCOUNT(tvc) && tvc->opens == 0 ) {
+               struct inode *ip = (struct inode*)tvc;
+               if (list_empty(&ip->i_dentry)) {
+                   vn --;
+               }
+               else {
+                   struct list_head *cur;
+                   struct list_head *head = &ip->i_dentry;
+                   int all = 1;
+               restart:
+                   DLOCK();
+                   cur = head;
+                   while ((cur = cur->next) != head) {
+                       struct dentry *dentry = list_entry(cur, struct dentry, d_alias);
+                       if (!DCOUNT(dentry)) {
+                           AFS_GUNLOCK();
+                           DGET(dentry);
+                           DUNLOCK();
+                           d_drop(dentry);
+                           dput(dentry);
+                           AFS_GLOCK();
+                           goto restart;
+                       }
+                       else {
+                           all = 0;
+                       }
+                   }
+                   DUNLOCK();
+                   if (all) vn --;
+               }
+           }
+           if (tq == uq) break;
+        }
+    }
+#endif /* AFS_LINUX22_ENV */
 #ifdef AFS_OSF_ENV
 #ifdef AFS_OSF30_ENV
     if (afs_vcount >= afs_maxvcount) 
@@ -740,10 +706,6 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
                   continue;  /* start over - may have raced. */
                }
             }
-#endif
-#if defined(AFS_LINUX22_ENV)
-          if (tvc != afs_globalVp && VREFCOUNT(tvc) && tvc->opens == 0)
-              afs_TryFlushDcache(tvc);
 #endif
           if (VREFCOUNT(tvc) == 0 && tvc->opens == 0
               && (tvc->states & CUnlinkedDel) == 0) {
@@ -984,10 +946,10 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
        INIT_LIST_HEAD(&ip->i_data.locked_pages);
        INIT_LIST_HEAD(&ip->i_dirty_buffers);
 #ifdef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
-       INIT_LIST_HEAD(&inode->i_dirty_data_buffers);
+       INIT_LIST_HEAD(&ip->i_dirty_data_buffers);
 #endif
 #ifdef STRUCT_INODE_HAS_I_DEVICES
-       INIT_LIST_HEAD(&inode->i_devices);
+       INIT_LIST_HEAD(&ip->i_devices);
 #endif
        ip->i_data.host = (void*) ip;
        ip->i_mapping = &ip->i_data;