summaryrefslogtreecommitdiffstats
path: root/fs/aio.c
diff options
context:
space:
mode:
authorKen Chen <kenneth.w.chen@intel.com>2005-05-01 08:59:15 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:59:15 -0700
commit212079cf4ee99e492a57b817e796825d423a30bb (patch)
tree58f54e75ec697f89ba12b39614e937bb374a451d /fs/aio.c
parentefcd5e3ab089496865571d22443dd3f514dae60c (diff)
downloadlinux-212079cf4ee99e492a57b817e796825d423a30bb.tar.gz
linux-212079cf4ee99e492a57b817e796825d423a30bb.tar.bz2
linux-212079cf4ee99e492a57b817e796825d423a30bb.zip
[PATCH] aio: remove superfluous kiocb member initialization
This patch removes superfluous kiocb member initialization in the AIO allocation and deallocation path. For example, in really_put_req(), right before kiocb is returned to slab, 5 variables are reset to NULL. The same variables will be initialized at the kiocb allocation time, so why bother reset them knowing that they will be set to valid data at alloc time? Another example: ki_retry is initialized in __aio_get_req, but is initialized again in io_submit_one. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Cc: Benjamin LaHaise <bcrl@kvack.org> Cc: Suparna Bhattacharya <suparna@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/aio.c')
-rw-r--r--fs/aio.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/fs/aio.c b/fs/aio.c
index a82214d2e46d..9f807a541fbe 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -405,7 +405,6 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx)
req->ki_ctx = ctx;
req->ki_cancel = NULL;
req->ki_retry = NULL;
- req->ki_obj.user = NULL;
req->ki_dtor = NULL;
req->private = NULL;
INIT_LIST_HEAD(&req->ki_run_list);
@@ -451,11 +450,6 @@ static inline void really_put_req(struct kioctx *ctx, struct kiocb *req)
{
if (req->ki_dtor)
req->ki_dtor(req);
- req->ki_ctx = NULL;
- req->ki_filp = NULL;
- req->ki_obj.user = NULL;
- req->ki_dtor = NULL;
- req->private = NULL;
kmem_cache_free(kiocb_cachep, req);
ctx->reqs_active--;
@@ -1515,8 +1509,7 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
}
req->ki_filp = file;
- iocb->aio_key = req->ki_key;
- ret = put_user(iocb->aio_key, &user_iocb->aio_key);
+ ret = put_user(req->ki_key, &user_iocb->aio_key);
if (unlikely(ret)) {
dprintk("EFAULT: aio_key\n");
goto out_put_req;
@@ -1531,8 +1524,6 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
req->ki_opcode = iocb->aio_lio_opcode;
init_waitqueue_func_entry(&req->ki_wait, aio_wake_function);
INIT_LIST_HEAD(&req->ki_wait.task_list);
- req->ki_run_list.next = req->ki_run_list.prev = NULL;
- req->ki_retry = NULL;
req->ki_retried = 0;
req->ki_kicked = 0;
req->ki_queued = 0;