Commit 42e357c8 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: make staging file forks explicit



Don't open-code "-1" for whichfork when we're creating a staging btree
for a repair; let's define an actual symbol to make grepping and
understanding easier.

Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 579d7022
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -614,7 +614,7 @@ xfs_bmbt_stage_cursor(
	cur = xfs_bmbt_init_common(mp, NULL, ip, XFS_DATA_FORK);

	/* Don't let anyone think we're attached to the real fork yet. */
	cur->bc_ino.whichfork = -1;
	cur->bc_ino.whichfork = XFS_STAGING_FORK;
	xfs_btree_stage_ifakeroot(cur, ifake);
	return cur;
}
+5 −3
Original line number Diff line number Diff line
@@ -80,11 +80,13 @@ typedef void * xfs_failaddr_t;
/*
 * Inode fork identifiers.
 */
#define	XFS_DATA_FORK	0
#define	XFS_ATTR_FORK	1
#define	XFS_COW_FORK	2
#define XFS_STAGING_FORK	(-1)	/* fake fork for staging a btree */
#define	XFS_DATA_FORK		(0)
#define	XFS_ATTR_FORK		(1)
#define	XFS_COW_FORK		(2)

#define XFS_WHICHFORK_STRINGS \
	{ XFS_STAGING_FORK, 	"staging" }, \
	{ XFS_DATA_FORK, 	"data" }, \
	{ XFS_ATTR_FORK,	"attr" }, \
	{ XFS_COW_FORK,		"cow" }