summaryrefslogtreecommitdiff
path: root/net/unix/garbage.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-11-10 22:06:01 -0800
committerDavid S. Miller <davem@davemloft.net>2007-11-10 22:06:01 -0800
commit9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 (patch)
tree957551b7016caedcb6f85ec733e6a14d6707096f /net/unix/garbage.c
parent8032b46489e50ef8f3992159abd0349b5b8e476c (diff)
downloadlinux-3.10-9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8.tar.gz
linux-3.10-9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8.tar.bz2
linux-3.10-9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8.zip
[AF_UNIX]: Make unix_tot_inflight counter non-atomic
This counter is _always_ modified under the unix_gc_lock spinlock, so its atomicity can be provided w/o additional efforts. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/unix/garbage.c')
-rw-r--r--net/unix/garbage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/unix/garbage.c b/net/unix/garbage.c
index 406b6433e46..399717ed7b9 100644
--- a/net/unix/garbage.c
+++ b/net/unix/garbage.c
@@ -92,7 +92,7 @@ static LIST_HEAD(gc_inflight_list);
static LIST_HEAD(gc_candidates);
static DEFINE_SPINLOCK(unix_gc_lock);
-atomic_t unix_tot_inflight = ATOMIC_INIT(0);
+unsigned int unix_tot_inflight;
static struct sock *unix_get_socket(struct file *filp)
@@ -133,7 +133,7 @@ void unix_inflight(struct file *fp)
} else {
BUG_ON(list_empty(&u->link));
}
- atomic_inc(&unix_tot_inflight);
+ unix_tot_inflight++;
spin_unlock(&unix_gc_lock);
}
}
@@ -147,7 +147,7 @@ void unix_notinflight(struct file *fp)
BUG_ON(list_empty(&u->link));
if (atomic_dec_and_test(&u->inflight))
list_del_init(&u->link);
- atomic_dec(&unix_tot_inflight);
+ unix_tot_inflight--;
spin_unlock(&unix_gc_lock);
}
}