mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 20:33:49 -04:00
xfs: remove bc_ino.flags
Just move the two flags into bc_flags where there is plenty of space. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
committed by
Darrick J. Wong
parent
fd9c7f7722
commit
e9e66df8bf
@@ -651,7 +651,8 @@ xfs_bmap_extents_to_btree(
|
||||
* Need a cursor. Can't allocate until bb_level is filled in.
|
||||
*/
|
||||
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
|
||||
cur->bc_ino.flags = wasdel ? XFS_BTCUR_BMBT_WASDEL : 0;
|
||||
if (wasdel)
|
||||
cur->bc_flags |= XFS_BTREE_BMBT_WASDEL;
|
||||
/*
|
||||
* Convert to a btree with two levels, one record in root.
|
||||
*/
|
||||
@@ -1449,8 +1450,7 @@ xfs_bmap_add_extent_delay_real(
|
||||
|
||||
ASSERT(whichfork != XFS_ATTR_FORK);
|
||||
ASSERT(!isnullstartblock(new->br_startblock));
|
||||
ASSERT(!bma->cur ||
|
||||
(bma->cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
|
||||
ASSERT(!bma->cur || (bma->cur->bc_flags & XFS_BTREE_BMBT_WASDEL));
|
||||
|
||||
XFS_STATS_INC(mp, xs_add_exlist);
|
||||
|
||||
@@ -2709,7 +2709,7 @@ xfs_bmap_add_extent_hole_real(
|
||||
struct xfs_bmbt_irec old;
|
||||
|
||||
ASSERT(!isnullstartblock(new->br_startblock));
|
||||
ASSERT(!cur || !(cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL));
|
||||
ASSERT(!cur || !(cur->bc_flags & XFS_BTREE_BMBT_WASDEL));
|
||||
|
||||
XFS_STATS_INC(mp, xs_add_exlist);
|
||||
|
||||
@@ -4229,9 +4229,8 @@ xfs_bmapi_allocate(
|
||||
*/
|
||||
bma->nallocs++;
|
||||
|
||||
if (bma->cur)
|
||||
bma->cur->bc_ino.flags =
|
||||
bma->wasdel ? XFS_BTCUR_BMBT_WASDEL : 0;
|
||||
if (bma->cur && bma->wasdel)
|
||||
bma->cur->bc_flags |= XFS_BTREE_BMBT_WASDEL;
|
||||
|
||||
bma->got.br_startoff = bma->offset;
|
||||
bma->got.br_startblock = bma->blkno;
|
||||
@@ -4766,10 +4765,8 @@ xfs_bmapi_remap(
|
||||
ip->i_nblocks += len;
|
||||
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
|
||||
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE)
|
||||
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
|
||||
cur->bc_ino.flags = 0;
|
||||
}
|
||||
|
||||
got.br_startoff = bno;
|
||||
got.br_startblock = startblock;
|
||||
@@ -5400,7 +5397,6 @@ __xfs_bunmapi(
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
|
||||
ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE);
|
||||
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
|
||||
cur->bc_ino.flags = 0;
|
||||
} else
|
||||
cur = NULL;
|
||||
|
||||
@@ -5861,10 +5857,8 @@ xfs_bmap_collapse_extents(
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE)
|
||||
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
|
||||
cur->bc_ino.flags = 0;
|
||||
}
|
||||
|
||||
if (!xfs_iext_lookup_extent(ip, ifp, *next_fsb, &icur, &got)) {
|
||||
*done = true;
|
||||
@@ -5978,10 +5972,8 @@ xfs_bmap_insert_extents(
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE)
|
||||
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
|
||||
cur->bc_ino.flags = 0;
|
||||
}
|
||||
|
||||
if (*next_fsb == NULLFSBLOCK) {
|
||||
xfs_iext_last(ifp, &icur);
|
||||
@@ -6098,7 +6090,6 @@ xfs_bmap_split_extent(
|
||||
|
||||
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
|
||||
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
|
||||
cur->bc_ino.flags = 0;
|
||||
error = xfs_bmbt_lookup_eq(cur, &got, &i);
|
||||
if (error)
|
||||
goto del_cursor;
|
||||
|
||||
@@ -171,13 +171,8 @@ xfs_bmbt_dup_cursor(
|
||||
|
||||
new = xfs_bmbt_init_cursor(cur->bc_mp, cur->bc_tp,
|
||||
cur->bc_ino.ip, cur->bc_ino.whichfork);
|
||||
|
||||
/*
|
||||
* Copy the firstblock, dfops, and flags values,
|
||||
* since init cursor doesn't get them.
|
||||
*/
|
||||
new->bc_ino.flags = cur->bc_ino.flags;
|
||||
|
||||
new->bc_flags |= (cur->bc_flags &
|
||||
(XFS_BTREE_BMBT_INVALID_OWNER | XFS_BTREE_BMBT_WASDEL));
|
||||
return new;
|
||||
}
|
||||
|
||||
@@ -211,7 +206,7 @@ xfs_bmbt_alloc_block(
|
||||
xfs_rmap_ino_bmbt_owner(&args.oinfo, cur->bc_ino.ip->i_ino,
|
||||
cur->bc_ino.whichfork);
|
||||
args.minlen = args.maxlen = args.prod = 1;
|
||||
args.wasdel = cur->bc_ino.flags & XFS_BTCUR_BMBT_WASDEL;
|
||||
args.wasdel = cur->bc_flags & XFS_BTREE_BMBT_WASDEL;
|
||||
if (!args.wasdel && args.tp->t_blk_res == 0)
|
||||
return -ENOSPC;
|
||||
|
||||
@@ -557,7 +552,6 @@ xfs_bmbt_init_common(
|
||||
|
||||
cur->bc_ino.ip = ip;
|
||||
cur->bc_ino.allocated = 0;
|
||||
cur->bc_ino.flags = 0;
|
||||
|
||||
return cur;
|
||||
}
|
||||
@@ -748,7 +742,7 @@ xfs_bmbt_change_owner(
|
||||
ASSERT(xfs_ifork_ptr(ip, whichfork)->if_format == XFS_DINODE_FMT_BTREE);
|
||||
|
||||
cur = xfs_bmbt_init_cursor(ip->i_mount, tp, ip, whichfork);
|
||||
cur->bc_ino.flags |= XFS_BTCUR_BMBT_INVALID_OWNER;
|
||||
cur->bc_flags |= XFS_BTREE_BMBT_INVALID_OWNER;
|
||||
|
||||
error = xfs_btree_change_owner(cur, new_owner, buffer_list);
|
||||
xfs_btree_del_cursor(cur, error);
|
||||
|
||||
@@ -1837,7 +1837,7 @@ xfs_btree_lookup_get_block(
|
||||
|
||||
/* Check the inode owner since the verifiers don't. */
|
||||
if (xfs_has_crc(cur->bc_mp) &&
|
||||
!(cur->bc_ino.flags & XFS_BTCUR_BMBT_INVALID_OWNER) &&
|
||||
!(cur->bc_flags & XFS_BTREE_BMBT_INVALID_OWNER) &&
|
||||
(cur->bc_ops->geom_flags & XFS_BTGEO_LONG_PTRS) &&
|
||||
be64_to_cpu((*blkp)->bb_u.l.bb_owner) !=
|
||||
cur->bc_ino.ip->i_ino)
|
||||
|
||||
@@ -249,12 +249,6 @@ struct xfs_btree_cur_ino {
|
||||
int allocated;
|
||||
short forksize;
|
||||
char whichfork;
|
||||
char flags;
|
||||
/* We are converting a delalloc reservation */
|
||||
#define XFS_BTCUR_BMBT_WASDEL (1 << 0)
|
||||
|
||||
/* For extent swap, ignore owner check in verifier */
|
||||
#define XFS_BTCUR_BMBT_INVALID_OWNER (1 << 1)
|
||||
};
|
||||
|
||||
struct xfs_btree_level {
|
||||
@@ -321,6 +315,12 @@ xfs_btree_cur_sizeof(unsigned int nlevels)
|
||||
*/
|
||||
#define XFS_BTREE_STAGING (1U << 0)
|
||||
|
||||
/* We are converting a delalloc reservation (only for bmbt btrees) */
|
||||
#define XFS_BTREE_BMBT_WASDEL (1U << 1)
|
||||
|
||||
/* For extent swap, ignore owner check in verifier (only for bmbt btrees) */
|
||||
#define XFS_BTREE_BMBT_INVALID_OWNER (1U << 2)
|
||||
|
||||
#define XFS_BTREE_NOERROR 0
|
||||
#define XFS_BTREE_ERROR 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user