Skip to content

Commit 0eba048

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: only look at the fork format in xfs_idestroy_fork
Stop using the XFS_IFEXTENTS flag, and instead switch on the fork format in xfs_idestroy_fork to decide how to cleanup. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Brian Foster <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 605e74e commit 0eba048

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

fs/xfs/libxfs/xfs_inode_fork.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -522,17 +522,16 @@ xfs_idestroy_fork(
522522
ifp->if_broot = NULL;
523523
}
524524

525-
/*
526-
* If the format is local, then we can't have an extents array so just
527-
* look for an inline data array. If we're not local then we may or may
528-
* not have an extents list, so check and free it up if we do.
529-
*/
530-
if (ifp->if_format == XFS_DINODE_FMT_LOCAL) {
525+
switch (ifp->if_format) {
526+
case XFS_DINODE_FMT_LOCAL:
531527
kmem_free(ifp->if_u1.if_data);
532528
ifp->if_u1.if_data = NULL;
533-
} else if (ifp->if_flags & XFS_IFEXTENTS) {
529+
break;
530+
case XFS_DINODE_FMT_EXTENTS:
531+
case XFS_DINODE_FMT_BTREE:
534532
if (ifp->if_height)
535533
xfs_iext_destroy(ifp);
534+
break;
536535
}
537536
}
538537

0 commit comments

Comments
 (0)