lkml.org 
[lkml]   [2013]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/6] fs: Don't call dio_cleanup() before submitting all bios
Date
do_blockdev_direct_IO() can call dio_cleanup() before submitting
all bios. This will be inconvenient for us because we need to keep
preallocated structure in sdio which we attach to bio on submit and
it is natural to cleanup unused allocation in dio_cleanup().

Since dio_cleanup() is called again after submitting the last bio it is
enough to just remove the first dio_cleanup() call.

Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/direct-io.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index cf5b44b..3a430f3 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1209,10 +1209,8 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
((sdio.final_block_in_request - sdio.block_in_file) <<
blkbits);

- if (retval) {
- dio_cleanup(dio, &sdio);
+ if (retval)
break;
- }
} /* end iovec loop */

if (retval == -ENOTBLK) {
--
1.7.1


\
 
 \ /
  Last update: 2013-01-31 23:43    [W:0.145 / U:1.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site