Commit 0eba048d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
parent 605e74e2
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -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;
	}
}