Skip to content

Commit ac1e067

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: remove XFS_IFBROOT
Just check for a btree format fork instead of the using the equivalent in-memory XFS_IFBROOT flag. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 0eba048 commit ac1e067

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@ xfs_bmap_btree_to_extents(
633633
cur->bc_bufs[0] = NULL;
634634
xfs_iroot_realloc(ip, -1, whichfork);
635635
ASSERT(ifp->if_broot == NULL);
636-
ASSERT((ifp->if_flags & XFS_IFBROOT) == 0);
637636
ifp->if_format = XFS_DINODE_FMT_EXTENTS;
638637
*logflagsp |= XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
639638
return 0;
@@ -677,7 +676,6 @@ xfs_bmap_extents_to_btree(
677676
* to expand the root.
678677
*/
679678
xfs_iroot_realloc(ip, 1, whichfork);
680-
ifp->if_flags |= XFS_IFBROOT;
681679

682680
/*
683681
* Fill in the root.
@@ -4196,7 +4194,7 @@ xfs_bmapi_allocate(
41964194
return error;
41974195
}
41984196

4199-
if ((ifp->if_flags & XFS_IFBROOT) && !bma->cur)
4197+
if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur)
42004198
bma->cur = xfs_bmbt_init_cursor(mp, bma->tp, bma->ip, whichfork);
42014199
/*
42024200
* Bump the number of extents we've allocated
@@ -4269,7 +4267,7 @@ xfs_bmapi_convert_unwritten(
42694267
* Modify (by adding) the state flag, if writing.
42704268
*/
42714269
ASSERT(mval->br_blockcount <= len);
4272-
if ((ifp->if_flags & XFS_IFBROOT) && !bma->cur) {
4270+
if (ifp->if_format == XFS_DINODE_FMT_BTREE && !bma->cur) {
42734271
bma->cur = xfs_bmbt_init_cursor(bma->ip->i_mount, bma->tp,
42744272
bma->ip, whichfork);
42754273
}
@@ -4732,7 +4730,7 @@ xfs_bmapi_remap(
47324730
ip->i_nblocks += len;
47334731
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
47344732

4735-
if (ifp->if_flags & XFS_IFBROOT) {
4733+
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
47364734
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
47374735
cur->bc_ino.flags = 0;
47384736
}
@@ -5411,7 +5409,7 @@ __xfs_bunmapi(
54115409
end--;
54125410

54135411
logflags = 0;
5414-
if (ifp->if_flags & XFS_IFBROOT) {
5412+
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
54155413
ASSERT(ifp->if_format == XFS_DINODE_FMT_BTREE);
54165414
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
54175415
cur->bc_ino.flags = 0;
@@ -5885,7 +5883,7 @@ xfs_bmap_collapse_extents(
58855883
if (error)
58865884
return error;
58875885

5888-
if (ifp->if_flags & XFS_IFBROOT) {
5886+
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
58895887
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
58905888
cur->bc_ino.flags = 0;
58915889
}
@@ -6000,7 +5998,7 @@ xfs_bmap_insert_extents(
60005998
if (error)
60015999
return error;
60026000

6003-
if (ifp->if_flags & XFS_IFBROOT) {
6001+
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
60046002
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
60056003
cur->bc_ino.flags = 0;
60066004
}
@@ -6115,7 +6113,7 @@ xfs_bmap_split_extent(
61156113
new.br_blockcount = got.br_blockcount - gotblkcnt;
61166114
new.br_state = got.br_state;
61176115

6118-
if (ifp->if_flags & XFS_IFBROOT) {
6116+
if (ifp->if_format == XFS_DINODE_FMT_BTREE) {
61196117
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
61206118
cur->bc_ino.flags = 0;
61216119
error = xfs_bmbt_lookup_eq(cur, &got, &i);

fs/xfs/libxfs/xfs_btree_staging.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ xfs_btree_bload_prep_block(
387387
new_size = bbl->iroot_size(cur, nr_this_block, priv);
388388
ifp->if_broot = kmem_zalloc(new_size, 0);
389389
ifp->if_broot_bytes = (int)new_size;
390-
ifp->if_flags |= XFS_IFBROOT;
391390

392391
/* Initialize it and send it out. */
393392
xfs_btree_init_block_int(cur->bc_mp, ifp->if_broot,

fs/xfs/libxfs/xfs_inode_fork.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ xfs_init_local_fork(
6060
}
6161

6262
ifp->if_bytes = size;
63-
ifp->if_flags &= ~(XFS_IFEXTENTS | XFS_IFBROOT);
63+
ifp->if_flags &= ~XFS_IFEXTENTS;
6464
ifp->if_flags |= XFS_IFINLINE;
6565
}
6666

@@ -214,7 +214,6 @@ xfs_iformat_btree(
214214
xfs_bmdr_to_bmbt(ip, dfp, XFS_DFORK_SIZE(dip, ip->i_mount, whichfork),
215215
ifp->if_broot, size);
216216
ifp->if_flags &= ~XFS_IFEXTENTS;
217-
ifp->if_flags |= XFS_IFBROOT;
218217

219218
ifp->if_bytes = 0;
220219
ifp->if_u1.if_root = NULL;
@@ -433,7 +432,6 @@ xfs_iroot_realloc(
433432
XFS_BMBT_BLOCK_LEN(ip->i_mount));
434433
} else {
435434
new_broot = NULL;
436-
ifp->if_flags &= ~XFS_IFBROOT;
437435
}
438436

439437
/*

fs/xfs/libxfs/xfs_inode_fork.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ struct xfs_ifork {
3232
*/
3333
#define XFS_IFINLINE 0x01 /* Inline data is read in */
3434
#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */
35-
#define XFS_IFBROOT 0x04 /* i_broot points to the bmap b-tree root */
3635

3736
/*
3837
* Worst-case increase in the fork extent count when we're adding a single

0 commit comments

Comments
 (0)