From f02f2377ebbbcb2cb14f0784ffe670682ccfb928 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 17 Oct 2005 16:43:33 -0700 Subject: [PATCH] --- yaml --- r: 9919 b: refs/heads/master c: 4faa5285283fad081443e3612ca426a311bb6c7e h: refs/heads/master i: 9917: 5f4ece28103b720495802de3c113b8e0065e0e7f 9915: 2cc741fb010f60b212dd2d807193dfdf53e09e10 9911: 87db5027252276292e94feb80125a581e7bc617d 9903: 27dd995cb697118f963428daf02c5363ea3e2c6f 9887: 5dfa2c0f5e92ec856dedb3dbc9e73bdac33996ad 9855: 14e2bbfa83011681bdfeab826a315fbca2138309 v: v3 --- [refs] | 2 +- trunk/fs/aio.c | 26 +------------------------- trunk/include/linux/aio.h | 7 ++++++- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/[refs] b/[refs] index dfffdb82598a..4ba50f3322e3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e7507ed91e093b9e4e218e41ebfdce05458258fc +refs/heads/master: 4faa5285283fad081443e3612ca426a311bb6c7e diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index d6b1551342b7..9fe7216457d8 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -398,7 +398,7 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx) if (unlikely(!req)) return NULL; - req->ki_flags = 1 << KIF_LOCKED; + req->ki_flags = 0; req->ki_users = 2; req->ki_key = 0; req->ki_ctx = ctx; @@ -547,25 +547,6 @@ struct kioctx *lookup_ioctx(unsigned long ctx_id) return ioctx; } -static int lock_kiocb_action(void *param) -{ - schedule(); - return 0; -} - -static inline void lock_kiocb(struct kiocb *iocb) -{ - wait_on_bit_lock(&iocb->ki_flags, KIF_LOCKED, lock_kiocb_action, - TASK_UNINTERRUPTIBLE); -} - -static inline void unlock_kiocb(struct kiocb *iocb) -{ - kiocbClearLocked(iocb); - smp_mb__after_clear_bit(); - wake_up_bit(&iocb->ki_flags, KIF_LOCKED); -} - /* * use_mm * Makes the calling kernel thread take on the specified @@ -796,9 +777,7 @@ static int __aio_run_iocbs(struct kioctx *ctx) * Hold an extra reference while retrying i/o. */ iocb->ki_users++; /* grab extra reference */ - lock_kiocb(iocb); aio_run_iocb(iocb); - unlock_kiocb(iocb); if (__aio_put_req(ctx, iocb)) /* drop extra ref */ put_ioctx(ctx); } @@ -1542,7 +1521,6 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, spin_lock_irq(&ctx->ctx_lock); aio_run_iocb(req); - unlock_kiocb(req); if (!list_empty(&ctx->run_list)) { /* drain the run list */ while (__aio_run_iocbs(ctx)) @@ -1674,7 +1652,6 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, if (NULL != cancel) { struct io_event tmp; pr_debug("calling cancel\n"); - lock_kiocb(kiocb); memset(&tmp, 0, sizeof(tmp)); tmp.obj = (u64)(unsigned long)kiocb->ki_obj.user; tmp.data = kiocb->ki_user_data; @@ -1686,7 +1663,6 @@ asmlinkage long sys_io_cancel(aio_context_t ctx_id, struct iocb __user *iocb, if (copy_to_user(result, &tmp, sizeof(tmp))) ret = -EFAULT; } - unlock_kiocb(kiocb); } else ret = -EINVAL; diff --git a/trunk/include/linux/aio.h b/trunk/include/linux/aio.h index 60def658b246..0decf66117c1 100644 --- a/trunk/include/linux/aio.h +++ b/trunk/include/linux/aio.h @@ -24,7 +24,12 @@ struct kioctx; #define KIOCB_SYNC_KEY (~0U) /* ki_flags bits */ -#define KIF_LOCKED 0 +/* + * This may be used for cancel/retry serialization in the future, but + * for now it's unused and we probably don't want modules to even + * think they can use it. + */ +/* #define KIF_LOCKED 0 */ #define KIF_KICKED 1 #define KIF_CANCELLED 2