aboutsummaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-07-26 00:39:17 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-07-26 20:53:40 -0400
commit516e0cc5646f377ab80fcc2ee639892eccb99853 (patch)
treee06296dcedb42dbe397d237887873e70c5823d51 /fs/aio.c
parent3c333937ee3be114b181c4861188cfe8f6a59697 (diff)
[PATCH] f_count may wrap around
make it atomic_long_t; while we are at it, get rid of useless checks in affs, hfs and hpfs - ->open() always has it equal to 1, ->release() - to 0. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/aio.c b/fs/aio.c
index 0051fd94b44e..f658441d5666 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -512,8 +512,8 @@ static void aio_fput_routine(struct work_struct *data)
512 */ 512 */
513static int __aio_put_req(struct kioctx *ctx, struct kiocb *req) 513static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
514{ 514{
515 dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n", 515 dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n",
516 req, atomic_read(&req->ki_filp->f_count)); 516 req, atomic_long_read(&req->ki_filp->f_count));
517 517
518 assert_spin_locked(&ctx->ctx_lock); 518 assert_spin_locked(&ctx->ctx_lock);
519 519
@@ -528,7 +528,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
528 /* Must be done under the lock to serialise against cancellation. 528 /* Must be done under the lock to serialise against cancellation.
529 * Call this aio_fput as it duplicates fput via the fput_work. 529 * Call this aio_fput as it duplicates fput via the fput_work.
530 */ 530 */
531 if (unlikely(atomic_dec_and_test(&req->ki_filp->f_count))) { 531 if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) {
532 get_ioctx(ctx); 532 get_ioctx(ctx);
533 spin_lock(&fput_lock); 533 spin_lock(&fput_lock);
534 list_add(&req->ki_list, &fput_head); 534 list_add(&req->ki_list, &fput_head);