From 4c7f65aea7b7fe66c08f8f7304c1ea3f7a871d5a Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 18 Aug 2021 18:48:54 -0700 Subject: xfs: rename buffer cache index variable b_bn To stop external users from using b_bn as the disk address of the buffer, rename it to b_rhash_key to indicate that it is the buffer cache index, not the block number of the buffer. Code that needs the disk address should use xfs_buf_daddr() to obtain it. Do the rename and clean up any of the remaining internal b_bn users. Also clean up any remaining b_bn cruft that is now unused. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_buf.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'fs/xfs/xfs_buf.h') diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h index 6db2fba44b46..6b0200b8007d 100644 --- a/fs/xfs/xfs_buf.h +++ b/fs/xfs/xfs_buf.h @@ -134,11 +134,7 @@ struct xfs_buf { */ struct rhash_head b_rhash_head; /* pag buffer hash node */ - /* - * b_bn is the cache index. Do not use directly, use b_maps[0].bm_bn - * for the buffer disk address instead. - */ - xfs_daddr_t b_bn; + xfs_daddr_t b_rhash_key; /* buffer cache index */ int b_length; /* size of buffer in BBs */ atomic_t b_hold; /* reference count */ atomic_t b_lru_ref; /* lru reclaim ref count */ @@ -301,18 +297,6 @@ extern int xfs_buf_delwri_pushbuf(struct xfs_buf *, struct list_head *); extern int xfs_buf_init(void); extern void xfs_buf_terminate(void); -/* - * These macros use the IO block map rather than b_bn. b_bn is now really - * just for the buffer cache index for cached buffers. As IO does not use b_bn - * anymore, uncached buffers do not use b_bn at all and hence must modify the IO - * map directly. Uncached buffers are not allowed to be discontiguous, so this - * is safe to do. - * - * In future, uncached buffers will pass the block number directly to the io - * request function and hence these macros will go away at that point. - */ -#define XFS_BUF_SET_ADDR(bp, bno) ((bp)->b_maps[0].bm_bn = (xfs_daddr_t)(bno)) - static inline xfs_daddr_t xfs_buf_daddr(struct xfs_buf *bp) { return bp->b_maps[0].bm_bn; -- cgit v1.2.3