keyring-gcpags-20060927
authorChas Williams <chas@cmf.nrl.navy.mil>
Wed, 27 Sep 2006 21:01:10 +0000 (21:01 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 27 Sep 2006 21:01:10 +0000 (21:01 +0000)
FIXES 40659

do gcpags for keyrings without needing tasklist_lock

src/afs/LINUX/osi_groups.c
src/afs/afs_osi_gcpags.c

index c4a0514..a754cb6 100644 (file)
@@ -554,12 +554,26 @@ static int afs_pag_match(const struct key *key, const void *description)
        return strcmp(key->description, description) == 0;
 }
 
+static void afs_pag_destroy(struct key *key)
+{
+    afs_uint32 pag = key->payload.value;
+    struct unixuser *pu;
+
+    pu = afs_FindUser(pag, -1, READ_LOCK);
+    if (pu) {
+       pu->ct.EndTimestamp = 0;
+       pu->tokenTime = 0;
+       afs_PutUser(pu, READ_LOCK);
+    }
+}
+
 struct key_type key_type_afs_pag =
 {
     .name        = "afs_pag",
     .describe    = afs_pag_describe,
     .instantiate = afs_pag_instantiate,
     .match       = afs_pag_match,
+    .destroy     = afs_pag_destroy,
 };
 
 void osi_keyring_init(void)
index c5df931..cd54fdf 100644 (file)
@@ -226,11 +226,13 @@ afs_osi_TraverseProcTable(void)
 #endif
 
 #if defined(AFS_LINUX22_ENV)
-extern rwlock_t tasklist_lock __attribute__((weak));
 void
 afs_osi_TraverseProcTable()
 {
+#if !defined(LINUX_KEYRING_SUPPORT)
+    extern rwlock_t tasklist_lock __attribute__((weak));
     struct task_struct *p;
     if (&tasklist_lock)
        read_lock(&tasklist_lock);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
@@ -267,6 +269,7 @@ afs_osi_TraverseProcTable()
     else
        rcu_read_unlock();
 #endif
+#endif
 }
 #endif