public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] kill pointless ki_nbytes assignment in aio_setup_single_vector
@ 2006-12-04 16:34 Chen, Kenneth W
  2006-12-04 20:22 ` Zach Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Chen, Kenneth W @ 2006-12-04 16:34 UTC (permalink / raw)
  To: Andrew Morton, 'Zach Brown'; +Cc: linux-kernel

io_submit_one assigns ki_left = ki_nbytes = iocb->aio_nbytes, then
calls down to aio_setup_iocb, then to aio_setup_single_vector. In there,
ki_nbytes is reassigned to the same value it got two call stack above it.
There is no need to do so.

Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>


diff -Nurp linux-2.6.19/fs/aio.c linux-2.6.19.ken/fs/aio.c
--- linux-2.6.19/fs/aio.c	2006-12-03 17:16:52.000000000 -0800
+++ linux-2.6.19.ken/fs/aio.c	2006-12-03 17:19:06.000000000 -0800
@@ -1415,7 +1415,6 @@ static ssize_t aio_setup_single_vector(s
 	kiocb->ki_iovec->iov_len = kiocb->ki_left;
 	kiocb->ki_nr_segs = 1;
 	kiocb->ki_cur_seg = 0;
-	kiocb->ki_nbytes = kiocb->ki_left;
 	if (unlikely((ssize_t) kiocb->ki_nbytes < 0))
 		return -EINVAL;
 	return 0;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-04 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-04 16:34 [patch] kill pointless ki_nbytes assignment in aio_setup_single_vector Chen, Kenneth W
2006-12-04 20:22 ` Zach Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox