aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/direct-io.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 6874785bb65a..901dc55e9f54 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -958,36 +958,22 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
958 ssize_t ret2; 958 ssize_t ret2;
959 size_t bytes; 959 size_t bytes;
960 960
961 dio->bio = NULL;
962 dio->inode = inode; 961 dio->inode = inode;
963 dio->rw = rw; 962 dio->rw = rw;
964 dio->blkbits = blkbits; 963 dio->blkbits = blkbits;
965 dio->blkfactor = inode->i_blkbits - blkbits; 964 dio->blkfactor = inode->i_blkbits - blkbits;
966 dio->start_zero_done = 0;
967 dio->size = 0;
968 dio->block_in_file = offset >> blkbits; 965 dio->block_in_file = offset >> blkbits;
969 dio->blocks_available = 0;
970 dio->cur_page = NULL;
971 966
972 dio->boundary = 0;
973 dio->reap_counter = 0;
974 dio->get_block = get_block; 967 dio->get_block = get_block;
975 dio->end_io = end_io; 968 dio->end_io = end_io;
976 dio->map_bh.b_private = NULL;
977 dio->map_bh.b_state = 0;
978 dio->final_block_in_bio = -1; 969 dio->final_block_in_bio = -1;
979 dio->next_block_for_io = -1; 970 dio->next_block_for_io = -1;
980 971
981 dio->page_errors = 0;
982 dio->io_error = 0;
983 dio->result = 0;
984 dio->iocb = iocb; 972 dio->iocb = iocb;
985 dio->i_size = i_size_read(inode); 973 dio->i_size = i_size_read(inode);
986 974
987 spin_lock_init(&dio->bio_lock); 975 spin_lock_init(&dio->bio_lock);
988 dio->refcount = 1; 976 dio->refcount = 1;
989 dio->bio_list = NULL;
990 dio->waiter = NULL;
991 977
992 /* 978 /*
993 * In case of non-aligned buffers, we may need 2 more 979 * In case of non-aligned buffers, we may need 2 more
@@ -995,8 +981,6 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode,
995 */ 981 */
996 if (unlikely(dio->blkfactor)) 982 if (unlikely(dio->blkfactor))
997 dio->pages_in_io = 2; 983 dio->pages_in_io = 2;
998 else
999 dio->pages_in_io = 0;
1000 984
1001 for (seg = 0; seg < nr_segs; seg++) { 985 for (seg = 0; seg < nr_segs; seg++) {
1002 user_addr = (unsigned long)iov[seg].iov_base; 986 user_addr = (unsigned long)iov[seg].iov_base;
@@ -1184,7 +1168,7 @@ __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1184 } 1168 }
1185 } 1169 }
1186 1170
1187 dio = kmalloc(sizeof(*dio), GFP_KERNEL); 1171 dio = kzalloc(sizeof(*dio), GFP_KERNEL);
1188 retval = -ENOMEM; 1172 retval = -ENOMEM;
1189 if (!dio) 1173 if (!dio)
1190 goto out; 1174 goto out;