aboutsummaryrefslogtreecommitdiffstats
path: root/net/unix/garbage.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-30 13:33:48 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-30 13:33:48 -0400
commit15dd859cacf312f606f54502d1f66537a1e5c78c (patch)
treee50e125eaa6da83fa715704e53c1bde013d1ef8e /net/unix/garbage.c
parentb2d9d33412b9d13a40cd314d93ab517950fc5950 (diff)
parent6e86841d05f371b5b9b86ce76c02aaee83352298 (diff)
Merge commit 'v2.6.27-rc1' into x86/core
Conflicts: include/asm-x86/dma-mapping.h include/asm-x86/namei.h include/asm-x86/uaccess.h Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/unix/garbage.c')
-rw-r--r--net/unix/garbage.c18
1 files changed, 9 insertions, 9 deletions
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
238static void dec_inflight(struct unix_sock *usk) 238static void dec_inflight(struct unix_sock *usk)
239{ 239{
240 atomic_dec(&usk->inflight); 240 atomic_long_dec(&usk->inflight);
241} 241}
242 242
243static void inc_inflight(struct unix_sock *usk) 243static void inc_inflight(struct unix_sock *usk)
244{ 244{
245 atomic_inc(&usk->inflight); 245 atomic_long_inc(&usk->inflight);
246} 246}
247 247
248static void inc_inflight_move_tail(struct unix_sock *u) 248static 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);