keyring-gcpags-20060927

FIXES 40659

do gcpags for keyrings without needing tasklist_lock
This commit is contained in:
Chas Williams 2006-09-27 21:01:10 +00:00 committed by Derrick Brashear
parent 2201fd6d9f
commit 6a2ac1e2d4
2 changed files with 18 additions and 1 deletions

View 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)

View 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