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

Commit df80c933 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Lachlan McIlroy
Browse files

[XFS] remove some easy bhv_vnode_t instances



In various places we can just move a VFS_I call into the argument list of
called functions/macros instead of having a local bhv_vnode_t.

SGI-PV: 981498

SGI-Modid: xfs-linux-melb:xfs-kern:31776a

Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarLachlan McIlroy <lachlan@sgi.com>
parent e1cccd91
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -980,12 +980,7 @@ STATIC struct inode *
xfs_fs_alloc_inode(
xfs_fs_alloc_inode(
	struct super_block	*sb)
	struct super_block	*sb)
{
{
	bhv_vnode_t		*vp;
	return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);

	vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
	if (unlikely(!vp))
		return NULL;
	return vp;
}
}


STATIC void
STATIC void
+3 −6
Original line number Original line Diff line number Diff line
@@ -130,7 +130,6 @@ xfs_swap_extents(
	xfs_mount_t	*mp;
	xfs_mount_t	*mp;
	xfs_trans_t	*tp;
	xfs_trans_t	*tp;
	xfs_bstat_t	*sbp = &sxp->sx_stat;
	xfs_bstat_t	*sbp = &sxp->sx_stat;
	bhv_vnode_t	*vp, *tvp;
	xfs_ifork_t	*tempifp, *ifp, *tifp;
	xfs_ifork_t	*tempifp, *ifp, *tifp;
	int		ilf_fields, tilf_fields;
	int		ilf_fields, tilf_fields;
	static uint	lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL;
	static uint	lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL;
@@ -149,8 +148,6 @@ xfs_swap_extents(
	}
	}


	sbp = &sxp->sx_stat;
	sbp = &sxp->sx_stat;
	vp = VFS_I(ip);
	tvp = VFS_I(tip);


	xfs_lock_two_inodes(ip, tip, lock_flags);
	xfs_lock_two_inodes(ip, tip, lock_flags);
	locked = 1;
	locked = 1;
@@ -174,7 +171,7 @@ xfs_swap_extents(
		goto error0;
		goto error0;
	}
	}


	if (VN_CACHED(tvp) != 0) {
	if (VN_CACHED(VFS_I(tip)) != 0) {
		xfs_inval_cached_trace(tip, 0, -1, 0, -1);
		xfs_inval_cached_trace(tip, 0, -1, 0, -1);
		error = xfs_flushinval_pages(tip, 0, -1,
		error = xfs_flushinval_pages(tip, 0, -1,
				FI_REMAPF_LOCKED);
				FI_REMAPF_LOCKED);
@@ -183,7 +180,7 @@ xfs_swap_extents(
	}
	}


	/* Verify O_DIRECT for ftmp */
	/* Verify O_DIRECT for ftmp */
	if (VN_CACHED(tvp) != 0) {
	if (VN_CACHED(VFS_I(tip)) != 0) {
		error = XFS_ERROR(EINVAL);
		error = XFS_ERROR(EINVAL);
		goto error0;
		goto error0;
	}
	}
@@ -227,7 +224,7 @@ xfs_swap_extents(
	 * vop_read (or write in the case of autogrow) they block on the iolock
	 * vop_read (or write in the case of autogrow) they block on the iolock
	 * until we have switched the extents.
	 * until we have switched the extents.
	 */
	 */
	if (VN_MAPPED(vp)) {
	if (VN_MAPPED(VFS_I(ip))) {
		error = XFS_ERROR(EBUSY);
		error = XFS_ERROR(EBUSY);
		goto error0;
		goto error0;
	}
	}
+3 −7
Original line number Original line Diff line number Diff line
@@ -1399,7 +1399,6 @@ xfs_itruncate_start(
	xfs_fsize_t	last_byte;
	xfs_fsize_t	last_byte;
	xfs_off_t	toss_start;
	xfs_off_t	toss_start;
	xfs_mount_t	*mp;
	xfs_mount_t	*mp;
	bhv_vnode_t	*vp;
	int		error = 0;
	int		error = 0;


	ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
	ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
@@ -1408,7 +1407,6 @@ xfs_itruncate_start(
	       (flags == XFS_ITRUNC_MAYBE));
	       (flags == XFS_ITRUNC_MAYBE));


	mp = ip->i_mount;
	mp = ip->i_mount;
	vp = VFS_I(ip);


	/* wait for the completion of any pending DIOs */
	/* wait for the completion of any pending DIOs */
	if (new_size < ip->i_size)
	if (new_size < ip->i_size)
@@ -1457,7 +1455,7 @@ xfs_itruncate_start(


#ifdef DEBUG
#ifdef DEBUG
	if (new_size == 0) {
	if (new_size == 0) {
		ASSERT(VN_CACHED(vp) == 0);
		ASSERT(VN_CACHED(VFS_I(ip)) == 0);
	}
	}
#endif
#endif
	return error;
	return error;
@@ -3465,7 +3463,6 @@ xfs_iflush_all(
	xfs_mount_t	*mp)
	xfs_mount_t	*mp)
{
{
	xfs_inode_t	*ip;
	xfs_inode_t	*ip;
	bhv_vnode_t	*vp;


 again:
 again:
	XFS_MOUNT_ILOCK(mp);
	XFS_MOUNT_ILOCK(mp);
@@ -3480,14 +3477,13 @@ xfs_iflush_all(
			continue;
			continue;
		}
		}


		vp = VFS_I(ip);
		if (!VFS_I(ip)) {
		if (!vp) {
			XFS_MOUNT_IUNLOCK(mp);
			XFS_MOUNT_IUNLOCK(mp);
			xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
			xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC);
			goto again;
			goto again;
		}
		}


		ASSERT(vn_count(vp) == 0);
		ASSERT(vn_count(VFS_I(ip)) == 0);


		ip = ip->i_mnext;
		ip = ip->i_mnext;
	} while (ip != mp->m_inodes);
	} while (ip != mp->m_inodes);
+1 −3
Original line number Original line Diff line number Diff line
@@ -59,7 +59,6 @@ xfs_bulkstat_one_iget(
{
{
	xfs_icdinode_t	*dic;	/* dinode core info pointer */
	xfs_icdinode_t	*dic;	/* dinode core info pointer */
	xfs_inode_t	*ip;		/* incore inode pointer */
	xfs_inode_t	*ip;		/* incore inode pointer */
	bhv_vnode_t	*vp;
	int		error;
	int		error;


	error = xfs_iget(mp, NULL, ino,
	error = xfs_iget(mp, NULL, ino,
@@ -72,7 +71,6 @@ xfs_bulkstat_one_iget(
	ASSERT(ip != NULL);
	ASSERT(ip != NULL);
	ASSERT(ip->i_blkno != (xfs_daddr_t)0);
	ASSERT(ip->i_blkno != (xfs_daddr_t)0);


	vp = VFS_I(ip);
	dic = &ip->i_d;
	dic = &ip->i_d;


	/* xfs_iget returns the following without needing
	/* xfs_iget returns the following without needing
@@ -85,7 +83,7 @@ xfs_bulkstat_one_iget(
	buf->bs_uid = dic->di_uid;
	buf->bs_uid = dic->di_uid;
	buf->bs_gid = dic->di_gid;
	buf->bs_gid = dic->di_gid;
	buf->bs_size = dic->di_size;
	buf->bs_size = dic->di_size;
	vn_atime_to_bstime(vp, &buf->bs_atime);
	vn_atime_to_bstime(VFS_I(ip), &buf->bs_atime);
	buf->bs_mtime.tv_sec = dic->di_mtime.t_sec;
	buf->bs_mtime.tv_sec = dic->di_mtime.t_sec;
	buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec;
	buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec;
	buf->bs_ctime.tv_sec = dic->di_ctime.t_sec;
	buf->bs_ctime.tv_sec = dic->di_ctime.t_sec;
+1 −2
Original line number Original line Diff line number Diff line
@@ -128,7 +128,6 @@ xfs_unmount_flush(
	xfs_inode_t	*rip = mp->m_rootip;
	xfs_inode_t	*rip = mp->m_rootip;
	xfs_inode_t	*rbmip;
	xfs_inode_t	*rbmip;
	xfs_inode_t	*rsumip = NULL;
	xfs_inode_t	*rsumip = NULL;
	bhv_vnode_t	*rvp = VFS_I(rip);
	int		error;
	int		error;


	xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT);
	xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT);
@@ -167,7 +166,7 @@ xfs_unmount_flush(
	if (error == EFSCORRUPTED)
	if (error == EFSCORRUPTED)
		goto fscorrupt_out2;
		goto fscorrupt_out2;


	if (vn_count(rvp) != 1 && !relocation) {
	if (vn_count(VFS_I(rip)) != 1 && !relocation) {
		xfs_iunlock(rip, XFS_ILOCK_EXCL);
		xfs_iunlock(rip, XFS_ILOCK_EXCL);
		return XFS_ERROR(EBUSY);
		return XFS_ERROR(EBUSY);
	}
	}
Loading