diff options
author | Dave Chinner <dchinner@redhat.com> | 2012-04-23 15:58:51 +1000 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-05-14 16:20:47 -0500 |
commit | 4e94b71b7068b4bd9c615301197e09dbf0c3b770 (patch) | |
tree | fc441ec17202a749a6b1a3d5b70ba37101b595da /fs/xfs/xfs_buf.h | |
parent | de1cbee46269a3b707eb99b37f33afdd4cfaaea4 (diff) |
xfs: use blocks for counting length of buffers
Now that we pass block counts everywhere, and index buffers by block
number, track the length of the buffer in units of blocks rather
than bytes. Convert the code to use block counts, and those that
need byte counts get converted at the time of use.
Also, remove the XFS_BUF_{SET_}SIZE() macros that are just wrappers
around the buffer length. They only serve to make the code shouty
loud and don't actually add any real value.
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 4d472e5ded7a..3dab208686a4 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -117,7 +117,7 @@ typedef struct xfs_buf { */ struct rb_node b_rbnode; /* rbtree node */ xfs_daddr_t b_bn; /* block number for I/O */ - size_t b_buffer_length;/* size of buffer in bytes */ + int b_length; /* size of buffer in BBs */ atomic_t b_hold; /* reference count */ atomic_t b_lru_ref; /* lru reclaim ref count */ xfs_buf_flags_t b_flags; /* status flags */ @@ -246,8 +246,6 @@ void xfs_buf_stale(struct xfs_buf *bp); #define XFS_BUF_SET_ADDR(bp, bno) ((bp)->b_bn = (xfs_daddr_t)(bno)) #define XFS_BUF_COUNT(bp) ((bp)->b_count_desired) #define XFS_BUF_SET_COUNT(bp, cnt) ((bp)->b_count_desired = (cnt)) -#define XFS_BUF_SIZE(bp) ((bp)->b_buffer_length) -#define XFS_BUF_SET_SIZE(bp, cnt) ((bp)->b_buffer_length = (cnt)) static inline void xfs_buf_set_ref(struct xfs_buf *bp, int lru_ref) { |