xfs: kill XFS_DIR2...FIRSTDB macros
They are just simple wrappers around xfs_dir2_byte_to_db(), and we've already removed one usage earlier in the patch set. Kill the rest before we start removing the xfs_mount from conversion functions. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Родитель
892e3f342f
Коммит
8c44a28561
|
@ -611,7 +611,8 @@ xfs_dir2_free_bests_p(struct xfs_dir2_free *free)
|
|||
static xfs_dir2_db_t
|
||||
xfs_dir2_db_to_fdb(struct xfs_mount *mp, xfs_dir2_db_t db)
|
||||
{
|
||||
return XFS_DIR2_FREE_FIRSTDB(mp) + db / xfs_dir2_free_max_bests(mp);
|
||||
return xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET) +
|
||||
(db / xfs_dir2_free_max_bests(mp));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -642,7 +643,8 @@ xfs_dir3_free_bests_p(struct xfs_dir2_free *free)
|
|||
static xfs_dir2_db_t
|
||||
xfs_dir3_db_to_fdb(struct xfs_mount *mp, xfs_dir2_db_t db)
|
||||
{
|
||||
return XFS_DIR2_FREE_FIRSTDB(mp) + db / xfs_dir3_free_max_bests(mp);
|
||||
return xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET) +
|
||||
(db / xfs_dir3_free_max_bests(mp));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -330,8 +330,6 @@ xfs_dir2_sf_firstentry(struct xfs_dir2_sf_hdr *hdr)
|
|||
#define XFS_DIR2_SPACE_SIZE (1ULL << (32 + XFS_DIR2_DATA_ALIGN_LOG))
|
||||
#define XFS_DIR2_DATA_SPACE 0
|
||||
#define XFS_DIR2_DATA_OFFSET (XFS_DIR2_DATA_SPACE * XFS_DIR2_SPACE_SIZE)
|
||||
#define XFS_DIR2_DATA_FIRSTDB(mp) \
|
||||
xfs_dir2_byte_to_db(mp, XFS_DIR2_DATA_OFFSET)
|
||||
|
||||
/*
|
||||
* Describe a free area in the data block.
|
||||
|
@ -456,8 +454,6 @@ xfs_dir2_data_unused_tag_p(struct xfs_dir2_data_unused *dup)
|
|||
*/
|
||||
#define XFS_DIR2_LEAF_SPACE 1
|
||||
#define XFS_DIR2_LEAF_OFFSET (XFS_DIR2_LEAF_SPACE * XFS_DIR2_SPACE_SIZE)
|
||||
#define XFS_DIR2_LEAF_FIRSTDB(mp) \
|
||||
xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET)
|
||||
|
||||
/*
|
||||
* Leaf block header.
|
||||
|
@ -531,8 +527,6 @@ xfs_dir2_leaf_bests_p(struct xfs_dir2_leaf_tail *ltp)
|
|||
*/
|
||||
#define XFS_DIR2_FREE_SPACE 2
|
||||
#define XFS_DIR2_FREE_OFFSET (XFS_DIR2_FREE_SPACE * XFS_DIR2_SPACE_SIZE)
|
||||
#define XFS_DIR2_FREE_FIRSTDB(mp) \
|
||||
xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET)
|
||||
|
||||
typedef struct xfs_dir2_free_hdr {
|
||||
__be32 magic; /* XFS_DIR2_FREE_MAGIC */
|
||||
|
|
|
@ -744,7 +744,7 @@ xfs_dir2_shrink_inode(
|
|||
/*
|
||||
* If it's not a data block, we're done.
|
||||
*/
|
||||
if (db >= XFS_DIR2_LEAF_FIRSTDB(mp))
|
||||
if (db >= xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET))
|
||||
return 0;
|
||||
/*
|
||||
* If the block isn't the last one in the directory, we're done.
|
||||
|
|
|
@ -347,8 +347,8 @@ xfs_dir3_leaf_get_buf(
|
|||
int error;
|
||||
|
||||
ASSERT(magic == XFS_DIR2_LEAF1_MAGIC || magic == XFS_DIR2_LEAFN_MAGIC);
|
||||
ASSERT(bno >= XFS_DIR2_LEAF_FIRSTDB(mp) &&
|
||||
bno < XFS_DIR2_FREE_FIRSTDB(mp));
|
||||
ASSERT(bno >= xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET) &&
|
||||
bno < xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET));
|
||||
|
||||
error = xfs_da_get_buf(tp, dp, xfs_dir2_db_to_da(mp, bno), -1, &bp,
|
||||
XFS_DATA_FORK);
|
||||
|
@ -404,7 +404,7 @@ xfs_dir2_block_to_leaf(
|
|||
return error;
|
||||
}
|
||||
ldb = xfs_dir2_da_to_db(mp, blkno);
|
||||
ASSERT(ldb == XFS_DIR2_LEAF_FIRSTDB(mp));
|
||||
ASSERT(ldb == xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET));
|
||||
/*
|
||||
* Initialize the leaf block, get a buffer for it.
|
||||
*/
|
||||
|
@ -1798,7 +1798,8 @@ xfs_dir2_node_to_leaf(
|
|||
/*
|
||||
* Get rid of the freespace block.
|
||||
*/
|
||||
error = xfs_dir2_shrink_inode(args, XFS_DIR2_FREE_FIRSTDB(mp), fbp);
|
||||
error = xfs_dir2_shrink_inode(args,
|
||||
xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET), fbp);
|
||||
if (error) {
|
||||
/*
|
||||
* This can't fail here because it can only happen when
|
||||
|
|
|
@ -315,7 +315,7 @@ xfs_dir2_leaf_to_node(
|
|||
if ((error = xfs_dir2_grow_inode(args, XFS_DIR2_FREE_SPACE, &fdb))) {
|
||||
return error;
|
||||
}
|
||||
ASSERT(fdb == XFS_DIR2_FREE_FIRSTDB(mp));
|
||||
ASSERT(fdb == xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET));
|
||||
/*
|
||||
* Get the buffer for the new freespace block.
|
||||
*/
|
||||
|
@ -1256,7 +1256,7 @@ xfs_dir2_leafn_remove(
|
|||
struct xfs_dir3_icfree_hdr freehdr;
|
||||
dp->d_ops->free_hdr_from_disk(&freehdr, free);
|
||||
ASSERT(freehdr.firstdb == dp->d_ops->free_max_bests(mp) *
|
||||
(fdb - XFS_DIR2_FREE_FIRSTDB(mp)));
|
||||
(fdb - xfs_dir2_byte_to_db(mp, XFS_DIR2_FREE_OFFSET)));
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
|
@ -1747,7 +1747,8 @@ xfs_dir2_node_addname_int(
|
|||
* us a freespace block to start with.
|
||||
*/
|
||||
if (++fbno == 0)
|
||||
fbno = XFS_DIR2_FREE_FIRSTDB(mp);
|
||||
fbno = xfs_dir2_byte_to_db(mp,
|
||||
XFS_DIR2_FREE_OFFSET);
|
||||
/*
|
||||
* If it's ifbno we already looked at it.
|
||||
*/
|
||||
|
@ -1887,7 +1888,9 @@ xfs_dir2_node_addname_int(
|
|||
/*
|
||||
* Remember the first slot as our empty slot.
|
||||
*/
|
||||
freehdr.firstdb = (fbno - XFS_DIR2_FREE_FIRSTDB(mp)) *
|
||||
freehdr.firstdb =
|
||||
(fbno - xfs_dir2_byte_to_db(mp,
|
||||
XFS_DIR2_FREE_OFFSET)) *
|
||||
dp->d_ops->free_max_bests(mp);
|
||||
} else {
|
||||
free = fbp->b_addr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче