diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 23:23:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-26 23:23:44 -0400 |
commit | 4836e3007882984279ca63d3c42bf0b14616eb78 (patch) | |
tree | 28bf22726964e068b825491d71a141eefedbe5f8 /net/unix | |
parent | 5c7c204aeca51ccfad63caab4fcdc5d8026c0fd8 (diff) | |
parent | 4e1e018ecc6f7bfd10fc75b3ff9715cc8164e0a2 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (39 commits)
[PATCH] fix RLIM_NOFILE handling
[PATCH] get rid of corner case in dup3() entirely
[PATCH] remove remaining namei_{32,64}.h crap
[PATCH] get rid of indirect users of namei.h
[PATCH] get rid of __user_path_lookup_open
[PATCH] f_count may wrap around
[PATCH] dup3 fix
[PATCH] don't pass nameidata to __ncp_lookup_validate()
[PATCH] don't pass nameidata to gfs2_lookupi()
[PATCH] new (local) helper: user_path_parent()
[PATCH] sanitize __user_walk_fd() et.al.
[PATCH] preparation to __user_walk_fd cleanup
[PATCH] kill nameidata passing to permission(), rename to inode_permission()
[PATCH] take noexec checks to very few callers that care
Re: [PATCH 3/6] vfs: open_exec cleanup
[patch 4/4] vfs: immutable inode checking cleanup
[patch 3/4] fat: dont call notify_change
[patch 2/4] vfs: utimes cleanup
[patch 1/4] vfs: utimes: move owner check into inode_change_ok()
[PATCH] vfs: use kstrdup() and check failing allocation
...
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 2 | ||||
-rw-r--r-- | net/unix/garbage.c | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 24eb214581d5..015606b54d9b 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -603,7 +603,7 @@ static struct sock * unix_create1(struct net *net, struct socket *sock) | |||
603 | u->dentry = NULL; | 603 | u->dentry = NULL; |
604 | u->mnt = NULL; | 604 | u->mnt = NULL; |
605 | spin_lock_init(&u->lock); | 605 | spin_lock_init(&u->lock); |
606 | atomic_set(&u->inflight, 0); | 606 | atomic_long_set(&u->inflight, 0); |
607 | INIT_LIST_HEAD(&u->link); | 607 | INIT_LIST_HEAD(&u->link); |
608 | mutex_init(&u->readlock); /* single task reading lock */ | 608 | mutex_init(&u->readlock); /* single task reading lock */ |
609 | init_waitqueue_head(&u->peer_wait); | 609 | init_waitqueue_head(&u->peer_wait); |
diff --git a/net/unix/garbage.c b/net/unix/garbage.c index ebdff3d877a1..2a27b84f740b 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c | |||
@@ -127,7 +127,7 @@ void unix_inflight(struct file *fp) | |||
127 | if(s) { | 127 | if(s) { |
128 | struct unix_sock *u = unix_sk(s); | 128 | struct unix_sock *u = unix_sk(s); |
129 | spin_lock(&unix_gc_lock); | 129 | spin_lock(&unix_gc_lock); |
130 | if (atomic_inc_return(&u->inflight) == 1) { | 130 | if (atomic_long_inc_return(&u->inflight) == 1) { |
131 | BUG_ON(!list_empty(&u->link)); | 131 | BUG_ON(!list_empty(&u->link)); |
132 | list_add_tail(&u->link, &gc_inflight_list); | 132 | list_add_tail(&u->link, &gc_inflight_list); |
133 | } else { | 133 | } else { |
@@ -145,7 +145,7 @@ void unix_notinflight(struct file *fp) | |||
145 | struct unix_sock *u = unix_sk(s); | 145 | struct unix_sock *u = unix_sk(s); |
146 | spin_lock(&unix_gc_lock); | 146 | spin_lock(&unix_gc_lock); |
147 | BUG_ON(list_empty(&u->link)); | 147 | BUG_ON(list_empty(&u->link)); |
148 | if (atomic_dec_and_test(&u->inflight)) | 148 | if (atomic_long_dec_and_test(&u->inflight)) |
149 | list_del_init(&u->link); | 149 | list_del_init(&u->link); |
150 | unix_tot_inflight--; | 150 | unix_tot_inflight--; |
151 | spin_unlock(&unix_gc_lock); | 151 | spin_unlock(&unix_gc_lock); |
@@ -237,17 +237,17 @@ static void scan_children(struct sock *x, void (*func)(struct unix_sock *), | |||
237 | 237 | ||
238 | static void dec_inflight(struct unix_sock *usk) | 238 | static void dec_inflight(struct unix_sock *usk) |
239 | { | 239 | { |
240 | atomic_dec(&usk->inflight); | 240 | atomic_long_dec(&usk->inflight); |
241 | } | 241 | } |
242 | 242 | ||
243 | static void inc_inflight(struct unix_sock *usk) | 243 | static void inc_inflight(struct unix_sock *usk) |
244 | { | 244 | { |
245 | atomic_inc(&usk->inflight); | 245 | atomic_long_inc(&usk->inflight); |
246 | } | 246 | } |
247 | 247 | ||
248 | static void inc_inflight_move_tail(struct unix_sock *u) | 248 | static void inc_inflight_move_tail(struct unix_sock *u) |
249 | { | 249 | { |
250 | atomic_inc(&u->inflight); | 250 | atomic_long_inc(&u->inflight); |
251 | /* | 251 | /* |
252 | * If this is still a candidate, move it to the end of the | 252 | * If this is still a candidate, move it to the end of the |
253 | * list, so that it's checked even if it was already passed | 253 | * list, so that it's checked even if it was already passed |
@@ -288,11 +288,11 @@ void unix_gc(void) | |||
288 | * before the detach without atomicity guarantees. | 288 | * before the detach without atomicity guarantees. |
289 | */ | 289 | */ |
290 | list_for_each_entry_safe(u, next, &gc_inflight_list, link) { | 290 | list_for_each_entry_safe(u, next, &gc_inflight_list, link) { |
291 | int total_refs; | 291 | long total_refs; |
292 | int inflight_refs; | 292 | long inflight_refs; |
293 | 293 | ||
294 | total_refs = file_count(u->sk.sk_socket->file); | 294 | total_refs = file_count(u->sk.sk_socket->file); |
295 | inflight_refs = atomic_read(&u->inflight); | 295 | inflight_refs = atomic_long_read(&u->inflight); |
296 | 296 | ||
297 | BUG_ON(inflight_refs < 1); | 297 | BUG_ON(inflight_refs < 1); |
298 | BUG_ON(total_refs < inflight_refs); | 298 | BUG_ON(total_refs < inflight_refs); |
@@ -324,7 +324,7 @@ void unix_gc(void) | |||
324 | /* Move cursor to after the current position. */ | 324 | /* Move cursor to after the current position. */ |
325 | list_move(&cursor, &u->link); | 325 | list_move(&cursor, &u->link); |
326 | 326 | ||
327 | if (atomic_read(&u->inflight) > 0) { | 327 | if (atomic_long_read(&u->inflight) > 0) { |
328 | list_move_tail(&u->link, &gc_inflight_list); | 328 | list_move_tail(&u->link, &gc_inflight_list); |
329 | u->gc_candidate = 0; | 329 | u->gc_candidate = 0; |
330 | scan_children(&u->sk, inc_inflight_move_tail, NULL); | 330 | scan_children(&u->sk, inc_inflight_move_tail, NULL); |