git.samba.org
/
sfrench
/
cifs-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert uid hash to hlist
[sfrench/cifs-2.6.git]
/
kernel
/
user.c
diff --git
a/kernel/user.c
b/kernel/user.c
index 98b82507797a9f26fd0a2d4ee3d9d22d92928c08..add57c7e4c074237572da1b9beaf4592b4488896 100644
(file)
--- a/
kernel/user.c
+++ b/
kernel/user.c
@@
-55,25
+55,22
@@
struct user_struct root_user = {
/*
* These routines must be called with the uidhash spinlock held!
*/
/*
* These routines must be called with the uidhash spinlock held!
*/
-static inline void uid_hash_insert(struct user_struct *up, struct list_head *hashent)
+static inline void uid_hash_insert(struct user_struct *up, struct
h
list_head *hashent)
{
{
-
list_add(&up->uidhash_list
, hashent);
+
hlist_add_head(&up->uidhash_node
, hashent);
}
static inline void uid_hash_remove(struct user_struct *up)
{
}
static inline void uid_hash_remove(struct user_struct *up)
{
-
list_del(&up->uidhash_list
);
+
hlist_del(&up->uidhash_node
);
}
}
-static inline struct user_struct *uid_hash_find(uid_t uid, struct list_head *hashent)
+static inline struct user_struct *uid_hash_find(uid_t uid, struct
h
list_head *hashent)
{
{
- struct list_head *up;
-
- list_for_each(up, hashent) {
- struct user_struct *user;
-
- user = list_entry(up, struct user_struct, uidhash_list);
+ struct user_struct *user;
+ struct hlist_node *h;
+ hlist_for_each_entry(user, h, hashent, uidhash_node) {
if(user->uid == uid) {
atomic_inc(&user->__count);
return user;
if(user->uid == uid) {
atomic_inc(&user->__count);
return user;
@@
-122,7
+119,7
@@
void free_uid(struct user_struct *up)
struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
{
struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
{
- struct list_head *hashent = uidhashentry(ns, uid);
+ struct
h
list_head *hashent = uidhashentry(ns, uid);
struct user_struct *up;
spin_lock_irq(&uidhash_lock);
struct user_struct *up;
spin_lock_irq(&uidhash_lock);
@@
-208,10
+205,10
@@
static int __init uid_cache_init(void)
int n;
uid_cachep = kmem_cache_create("uid_cache", sizeof(struct user_struct),
int n;
uid_cachep = kmem_cache_create("uid_cache", sizeof(struct user_struct),
- 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL
, NULL
);
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
for(n = 0; n < UIDHASH_SZ; ++n)
for(n = 0; n < UIDHASH_SZ; ++n)
- INIT_LIST_HEAD(init_user_ns.uidhash_table + n);
+ INIT_
H
LIST_HEAD(init_user_ns.uidhash_table + n);
/* Insert the root user immediately (init already runs as root) */
spin_lock_irq(&uidhash_lock);
/* Insert the root user immediately (init already runs as root) */
spin_lock_irq(&uidhash_lock);