lkml.org 
[lkml]   [2000]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH correction] Re: 2.4.0test - uid_hash_find()

I noticed I forgot a ; somewhere there. Here's the right patch:

--- linux-2.4.0-test9/kernel/user.c Mon Oct 9 01:37:35 2000
+++ linux.vanilla/kernel/user.c Sun Oct 8 22:33:55 2000
@@ -51,22 +51,18 @@
*up->pprev = up->next;
}

-static inline struct user_struct *uid_hash_find(uid_t uid, unsigned int hashent)
+static inline struct user_struct *uid_hash_find(unsigned short uid, unsigned int hashent)
{
- struct user_struct *up, *next;
+ struct user_struct *up;

- next = uidhash[hashent];
- for (;;) {
- up = next;
- if (next) {
- next = up->next;
- if (up->uid != uid)
- continue;
- atomic_inc(&up->__count);
+ for (up = uidhash[hashent]; up ; up = up->next)
+ if (up->uid == uid)
+ {
+ atomic_inc(&up->__count);
+ return up;
}
- break;
- }
- return up;
+
+ return NULL;
}

/*
@@ -136,16 +132,11 @@

static int __init uid_cache_init(void)
{
- int i;
-
uid_cachep = kmem_cache_create("uid_cache", sizeof(struct user_struct),
0,
SLAB_HWCACHE_ALIGN, NULL, NULL);
if(!uid_cachep)
panic("Cannot create uid taskcount SLAB cache\n");
-
- for(i = 0; i < UIDHASH_SZ; i++)
- uidhash[i] = 0;

/* Insert the root user immediately - init already runs with this */
uid_hash_insert(&root_user, uidhashfn(0));
--
Dan Aloni
dax@karrde.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.067 / U:3.848 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site