Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44a8736b authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: clean up IRELE/iput callsites



Replace the IRELE macro with a proper function so that we can do proper
typechecking and so that we can stop open-coding iput in scrub, which
means that we'll be able to ftrace inode lifetimes going through scrub
correctly.

Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 89c3e8cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -711,7 +711,7 @@ xchk_get_inode(
		return error;
	}
	if (VFS_I(ip)->i_generation != sc->sm->sm_gen) {
		iput(VFS_I(ip));
		xfs_irele(ip);
		return -ENOENT;
	}

+1 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ xchk_dir_check_ftype(
			xfs_mode_to_ftype(VFS_I(ip)->i_mode));
	if (ino_dtype != dtype)
		xchk_fblock_set_corrupt(sdc->sc, XFS_DATA_FORK, offset);
	iput(VFS_I(ip));
	xfs_irele(ip);
out:
	return error;
}
+3 −3
Original line number Diff line number Diff line
@@ -230,11 +230,11 @@ xchk_parent_validate(

	/* Drat, parent changed.  Try again! */
	if (dnum != dp->i_ino) {
		iput(VFS_I(dp));
		xfs_irele(dp);
		*try_again = true;
		return 0;
	}
	iput(VFS_I(dp));
	xfs_irele(dp);

	/*
	 * '..' didn't change, so check that there was only one entry
@@ -247,7 +247,7 @@ xchk_parent_validate(
out_unlock:
	xfs_iunlock(dp, XFS_IOLOCK_SHARED);
out_rele:
	iput(VFS_I(dp));
	xfs_irele(dp);
out:
	return error;
}
+1 −1
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ xchk_teardown(
			xfs_iunlock(sc->ip, sc->ilock_flags);
		if (sc->ip != ip_in &&
		    !xfs_internal_inum(sc->mp, sc->ip->i_ino))
			iput(VFS_I(sc->ip));
			xfs_irele(sc->ip);
		sc->ip = NULL;
	}
	if (sc->has_quotaofflock)
+2 −2
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ xfs_bui_recover(
	xfs_defer_move(dfops, tp->t_dfops);
	error = xfs_trans_commit(tp);
	xfs_iunlock(ip, XFS_ILOCK_EXCL);
	IRELE(ip);
	xfs_irele(ip);

	return error;

@@ -506,7 +506,7 @@ xfs_bui_recover(
	xfs_trans_cancel(tp);
	if (ip) {
		xfs_iunlock(ip, XFS_ILOCK_EXCL);
		IRELE(ip);
		xfs_irele(ip);
	}
	return error;
}
Loading