aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2011-08-02 00:38:05 -0400
committerroot <root@serles.lst.de>2011-10-28 08:58:56 -0400
commit0dc2bc49be545626a2dc6da133202ffe69ac3fcc (patch)
tree25a2505be3e0498fea28c193b20dd613f27162e3
parentcde1ecb3247f67c167918ea6326159209996fd54 (diff)
direct-io: rearrange fields in dio/dio_submit to avoid holes
Fix most problems reported by pahole. There is still a weird 104 byte hole after map_bh. I'm not sure what causes this. Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--fs/direct-io.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index c1e03ae961af..b01ea0d7160d 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -73,10 +73,10 @@ struct dio_submit {
73 sector_t block_in_file; /* Current offset into the underlying 73 sector_t block_in_file; /* Current offset into the underlying
74 file in dio_block units. */ 74 file in dio_block units. */
75 unsigned blocks_available; /* At block_in_file. changes */ 75 unsigned blocks_available; /* At block_in_file. changes */
76 int reap_counter; /* rate limit reaping */
76 sector_t final_block_in_request;/* doesn't change */ 77 sector_t final_block_in_request;/* doesn't change */
77 unsigned first_block_in_page; /* doesn't change, Used only once */ 78 unsigned first_block_in_page; /* doesn't change, Used only once */
78 int boundary; /* prev block is at a boundary */ 79 int boundary; /* prev block is at a boundary */
79 int reap_counter; /* rate limit reaping */
80 get_block_t *get_block; /* block mapping function */ 80 get_block_t *get_block; /* block mapping function */
81 dio_submit_t *submit_io; /* IO submition function */ 81 dio_submit_t *submit_io; /* IO submition function */
82 82
@@ -114,27 +114,26 @@ struct dio_submit {
114/* dio_state communicated between submission path and end_io */ 114/* dio_state communicated between submission path and end_io */
115struct dio { 115struct dio {
116 int flags; /* doesn't change */ 116 int flags; /* doesn't change */
117 struct inode *inode;
118 int rw; 117 int rw;
118 struct inode *inode;
119 loff_t i_size; /* i_size when submitted */ 119 loff_t i_size; /* i_size when submitted */
120 dio_iodone_t *end_io; /* IO completion function */ 120 dio_iodone_t *end_io; /* IO completion function */
121 struct buffer_head map_bh; /* last get_block() result */
122 121
123 122
124 /* BIO completion state */ 123 /* BIO completion state */
125 spinlock_t bio_lock; /* protects BIO fields below */ 124 spinlock_t bio_lock; /* protects BIO fields below */
125 int page_errors; /* errno from get_user_pages() */
126 int is_async; /* is IO async ? */
127 int io_error; /* IO error in completion path */
126 unsigned long refcount; /* direct_io_worker() and bios */ 128 unsigned long refcount; /* direct_io_worker() and bios */
127 struct bio *bio_list; /* singly linked via bi_private */ 129 struct bio *bio_list; /* singly linked via bi_private */
128 struct task_struct *waiter; /* waiting task (NULL if none) */ 130 struct task_struct *waiter; /* waiting task (NULL if none) */
129 131
130 /* AIO related stuff */ 132 /* AIO related stuff */
131 struct kiocb *iocb; /* kiocb */ 133 struct kiocb *iocb; /* kiocb */
132 int is_async; /* is IO async ? */
133 int io_error; /* IO error in completion path */
134 ssize_t result; /* IO result */ 134 ssize_t result; /* IO result */
135 135
136 int page_errors; /* errno from get_user_pages() */ 136 struct buffer_head map_bh; /* last get_block() result */
137
138 /* 137 /*
139 * pages[] (and any fields placed after it) are not zeroed out at 138 * pages[] (and any fields placed after it) are not zeroed out at
140 * allocation time. Don't add new fields after pages[] unless you 139 * allocation time. Don't add new fields after pages[] unless you