diff options
author | Christoph Hellwig <hch@lst.de> | 2021-04-13 11:15:10 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-04-15 09:35:50 -0700 |
commit | 0eba048dd3b73fab6c97742468176dff58650860 (patch) | |
tree | a93d561e20015d2540286859c17176c46c4f77d2 /fs/xfs | |
parent | 605e74e29218bb22edd5ddcf90a4d37df00446cc (diff) |
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 <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/libxfs/xfs_inode_fork.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index a8800ff03f94..73eea7939b55 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c @@ -522,17 +522,16 @@ xfs_idestroy_fork( ifp->if_broot = NULL; } - /* - * If the format is local, then we can't have an extents array so just - * look for an inline data array. If we're not local then we may or may - * not have an extents list, so check and free it up if we do. - */ - if (ifp->if_format == XFS_DINODE_FMT_LOCAL) { + switch (ifp->if_format) { + case XFS_DINODE_FMT_LOCAL: kmem_free(ifp->if_u1.if_data); ifp->if_u1.if_data = NULL; - } else if (ifp->if_flags & XFS_IFEXTENTS) { + break; + case XFS_DINODE_FMT_EXTENTS: + case XFS_DINODE_FMT_BTREE: if (ifp->if_height) xfs_iext_destroy(ifp); + break; } } |