From f16dea54b789aad464ae4f34caea9f8d81052729 Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 11 Jul 2018 22:26:20 -0700 Subject: xfs: use ->t_firstblock in dir ops Callers of the xfs_dir_*() functions currently pass an on-stack firstblock variable. While the dirops infrastructure carries a pointer to this variable, it never rolls the transaction and so it is safe to use ->t_firstblock instead. Fix up the various xfs_dir_*() callers to use ->t_firstblock. Also remove the unnecessary parameter for xfs_cross_rename(). Signed-off-by: Brian Foster Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_symlink.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'fs/xfs/xfs_symlink.c') diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c index e50e97308f81..8ddc7f1147dc 100644 --- a/fs/xfs/xfs_symlink.c +++ b/fs/xfs/xfs_symlink.c @@ -164,7 +164,6 @@ xfs_symlink( int error = 0; int pathlen; struct xfs_defer_ops dfops; - xfs_fsblock_t first_block; bool unlock_dp_on_error = false; xfs_fileoff_t first_fsb; xfs_filblks_t fs_blocks; @@ -246,7 +245,7 @@ xfs_symlink( * Initialize the bmap freelist prior to calling either * bmapi or the directory create code. */ - xfs_defer_init(tp, &dfops, &first_block); + xfs_defer_init(tp, &dfops, &tp->t_firstblock); /* * Allocate an inode for the symlink. @@ -289,8 +288,8 @@ xfs_symlink( nmaps = XFS_SYMLINK_MAPS; error = xfs_bmapi_write(tp, ip, first_fsb, fs_blocks, - XFS_BMAPI_METADATA, &first_block, resblks, - mval, &nmaps); + XFS_BMAPI_METADATA, &tp->t_firstblock, + resblks, mval, &nmaps); if (error) goto out_bmap_cancel; @@ -338,7 +337,7 @@ xfs_symlink( * Create the directory entry for the symlink. */ error = xfs_dir_createname(tp, dp, link_name, ip->i_ino, - &first_block, resblks); + &tp->t_firstblock, resblks); if (error) goto out_bmap_cancel; xfs_trans_ichgtime(tp, dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); -- cgit v1.2.3