[PATCH] rcu file: use atomic primitives
Use atomic_inc_not_zero for rcu files instead of special case rcuref. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: "Paul E. McKenney" <paulmck@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
a57004e1af
commit
095975da26
3
fs/aio.c
3
fs/aio.c
@@ -29,7 +29,6 @@
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/security.h>
|
||||
#include <linux/rcuref.h>
|
||||
|
||||
#include <asm/kmap_types.h>
|
||||
#include <asm/uaccess.h>
|
||||
@@ -514,7 +513,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
|
||||
/* Must be done under the lock to serialise against cancellation.
|
||||
* Call this aio_fput as it duplicates fput via the fput_work.
|
||||
*/
|
||||
if (unlikely(rcuref_dec_and_test(&req->ki_filp->f_count))) {
|
||||
if (unlikely(atomic_dec_and_test(&req->ki_filp->f_count))) {
|
||||
get_ioctx(ctx);
|
||||
spin_lock(&fput_lock);
|
||||
list_add(&req->ki_list, &fput_head);
|
||||
|
Reference in New Issue
Block a user