cellservdb-proc-file-glocking-20090315
[openafs.git] / src / afs / LINUX / osi_proc.c
index 75ee013..cf5497c 100644 (file)
@@ -46,6 +46,7 @@ static void *c_start(struct seq_file *m, loff_t *pos)
        struct afs_q *cq, *tq;
        loff_t n = 0;
 
+       AFS_GLOCK();
        ObtainReadLock(&afs_xcell);
        for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
                tq = QNext(cq);
@@ -54,8 +55,9 @@ static void *c_start(struct seq_file *m, loff_t *pos)
                        break;
        }
        if (cq == &CellLRU)
-               return NULL;
+               cq = NULL;
 
+       AFS_GUNLOCK();
        return cq;
 }
 
@@ -63,18 +65,22 @@ static void *c_next(struct seq_file *m, void *p, loff_t *pos)
 {
        struct afs_q *cq = p, *tq;
 
+       AFS_GLOCK();
        (*pos)++;
        tq = QNext(cq);
 
        if (tq == &CellLRU)
                return NULL;
 
+       AFS_GUNLOCK();
        return tq;
 }
 
 static void c_stop(struct seq_file *m, void *p)
 {
+        AFS_GLOCK();
        ReleaseReadLock(&afs_xcell);
+       AFS_GUNLOCK();
 }
 
 static int c_show(struct seq_file *m, void *p)