diff options
author | Dave Chinner <david@fromorbit.com> | 2012-04-23 01:58:52 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-05-14 17:20:48 -0400 |
commit | aa0e8833b05cbd9d34d6a1ddaf23a74a58d76a03 (patch) | |
tree | 72592f1fec3df30dea526f793416b56b8d133234 /fs/xfs/xfs_buf.h | |
parent | 4e94b71b7068b4bd9c615301197e09dbf0c3b770 (diff) |
xfs: use blocks for storing the desired IO size
Now that we pass block counts everywhere, and index buffers by block
number and length in units of blocks, convert the desired IO size
into block counts rather than bytes. Convert the code to use block
counts, and those that need byte counts get converted at the time of
use.
Rename the b_desired_count variable to something closer to it's
purpose - b_io_length - as it is only used to specify the length of
an IO for a subset of the buffer. The only time this is used is for
log IO - both writing iclogs and during log recovery. In all other
cases, the b_io_length matches b_length, and hence a lot of code
confuses the two. e.g. the buf item code uses the io count
exclusively when it should be using the buffer length. Fix these
apprpriately as they are found.
Also, remove the XFS_BUF_{SET_}COUNT() macros that are just wrappers
around the desired IO length. They only serve to make the code
shouty loud, don't actually add any real value, and are often used
incorrectly.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_buf.h')
-rw-r--r-- | fs/xfs/xfs_buf.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 3dab208686a4..9787645fa54c 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h | |||
@@ -128,7 +128,6 @@ typedef struct xfs_buf { | |||
128 | struct list_head b_list; | 128 | struct list_head b_list; |
129 | struct xfs_perag *b_pag; /* contains rbtree root */ | 129 | struct xfs_perag *b_pag; /* contains rbtree root */ |
130 | xfs_buftarg_t *b_target; /* buffer target (device) */ | 130 | xfs_buftarg_t *b_target; /* buffer target (device) */ |
131 | size_t b_count_desired;/* desired transfer size */ | ||
132 | void *b_addr; /* virtual address of buffer */ | 131 | void *b_addr; /* virtual address of buffer */ |
133 | struct work_struct b_iodone_work; | 132 | struct work_struct b_iodone_work; |
134 | xfs_buf_iodone_t b_iodone; /* I/O completion function */ | 133 | xfs_buf_iodone_t b_iodone; /* I/O completion function */ |
@@ -137,6 +136,7 @@ typedef struct xfs_buf { | |||
137 | struct xfs_trans *b_transp; | 136 | struct xfs_trans *b_transp; |
138 | struct page **b_pages; /* array of page pointers */ | 137 | struct page **b_pages; /* array of page pointers */ |
139 | struct page *b_page_array[XB_PAGES]; /* inline pages */ | 138 | struct page *b_page_array[XB_PAGES]; /* inline pages */ |
139 | int b_io_length; /* IO size in BBs */ | ||
140 | atomic_t b_pin_count; /* pin count */ | 140 | atomic_t b_pin_count; /* pin count */ |
141 | atomic_t b_io_remaining; /* #outstanding I/O requests */ | 141 | atomic_t b_io_remaining; /* #outstanding I/O requests */ |
142 | unsigned int b_page_count; /* size of page array */ | 142 | unsigned int b_page_count; /* size of page array */ |
@@ -244,8 +244,6 @@ void xfs_buf_stale(struct xfs_buf *bp); | |||
244 | 244 | ||
245 | #define XFS_BUF_ADDR(bp) ((bp)->b_bn) | 245 | #define XFS_BUF_ADDR(bp) ((bp)->b_bn) |
246 | #define XFS_BUF_SET_ADDR(bp, bno) ((bp)->b_bn = (xfs_daddr_t)(bno)) | 246 | #define XFS_BUF_SET_ADDR(bp, bno) ((bp)->b_bn = (xfs_daddr_t)(bno)) |
247 | #define XFS_BUF_COUNT(bp) ((bp)->b_count_desired) | ||
248 | #define XFS_BUF_SET_COUNT(bp, cnt) ((bp)->b_count_desired = (cnt)) | ||
249 | 247 | ||
250 | static inline void xfs_buf_set_ref(struct xfs_buf *bp, int lru_ref) | 248 | static inline void xfs_buf_set_ref(struct xfs_buf *bp, int lru_ref) |
251 | { | 249 | { |