mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 20:14:08 +00:00
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>
This commit is contained in:
parent
cde1ecb324
commit
0dc2bc49be
1 changed files with 6 additions and 7 deletions
|
@ -73,10 +73,10 @@ struct dio_submit {
|
||||||
sector_t block_in_file; /* Current offset into the underlying
|
sector_t block_in_file; /* Current offset into the underlying
|
||||||
file in dio_block units. */
|
file in dio_block units. */
|
||||||
unsigned blocks_available; /* At block_in_file. changes */
|
unsigned blocks_available; /* At block_in_file. changes */
|
||||||
|
int reap_counter; /* rate limit reaping */
|
||||||
sector_t final_block_in_request;/* doesn't change */
|
sector_t final_block_in_request;/* doesn't change */
|
||||||
unsigned first_block_in_page; /* doesn't change, Used only once */
|
unsigned first_block_in_page; /* doesn't change, Used only once */
|
||||||
int boundary; /* prev block is at a boundary */
|
int boundary; /* prev block is at a boundary */
|
||||||
int reap_counter; /* rate limit reaping */
|
|
||||||
get_block_t *get_block; /* block mapping function */
|
get_block_t *get_block; /* block mapping function */
|
||||||
dio_submit_t *submit_io; /* IO submition function */
|
dio_submit_t *submit_io; /* IO submition function */
|
||||||
|
|
||||||
|
@ -114,27 +114,26 @@ struct dio_submit {
|
||||||
/* dio_state communicated between submission path and end_io */
|
/* dio_state communicated between submission path and end_io */
|
||||||
struct dio {
|
struct dio {
|
||||||
int flags; /* doesn't change */
|
int flags; /* doesn't change */
|
||||||
struct inode *inode;
|
|
||||||
int rw;
|
int rw;
|
||||||
|
struct inode *inode;
|
||||||
loff_t i_size; /* i_size when submitted */
|
loff_t i_size; /* i_size when submitted */
|
||||||
dio_iodone_t *end_io; /* IO completion function */
|
dio_iodone_t *end_io; /* IO completion function */
|
||||||
struct buffer_head map_bh; /* last get_block() result */
|
|
||||||
|
|
||||||
|
|
||||||
/* BIO completion state */
|
/* BIO completion state */
|
||||||
spinlock_t bio_lock; /* protects BIO fields below */
|
spinlock_t bio_lock; /* protects BIO fields below */
|
||||||
|
int page_errors; /* errno from get_user_pages() */
|
||||||
|
int is_async; /* is IO async ? */
|
||||||
|
int io_error; /* IO error in completion path */
|
||||||
unsigned long refcount; /* direct_io_worker() and bios */
|
unsigned long refcount; /* direct_io_worker() and bios */
|
||||||
struct bio *bio_list; /* singly linked via bi_private */
|
struct bio *bio_list; /* singly linked via bi_private */
|
||||||
struct task_struct *waiter; /* waiting task (NULL if none) */
|
struct task_struct *waiter; /* waiting task (NULL if none) */
|
||||||
|
|
||||||
/* AIO related stuff */
|
/* AIO related stuff */
|
||||||
struct kiocb *iocb; /* kiocb */
|
struct kiocb *iocb; /* kiocb */
|
||||||
int is_async; /* is IO async ? */
|
|
||||||
int io_error; /* IO error in completion path */
|
|
||||||
ssize_t result; /* IO result */
|
ssize_t result; /* IO result */
|
||||||
|
|
||||||
int page_errors; /* errno from get_user_pages() */
|
struct buffer_head map_bh; /* last get_block() result */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pages[] (and any fields placed after it) are not zeroed out at
|
* pages[] (and any fields placed after it) are not zeroed out at
|
||||||
* allocation time. Don't add new fields after pages[] unless you
|
* allocation time. Don't add new fields after pages[] unless you
|
||||||
|
|
Loading…
Add table
Reference in a new issue