summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_symlink.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-07-12 08:26:20 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-12 08:26:20 +0300
commitf16dea54b789aad464ae4f34caea9f8d81052729 (patch)
tree84dd1a1d9e6f3765234f0c8c1f2d58b2f13d9700 /fs/xfs/xfs_symlink.c
parentbba59c5e4b38e160c6be25b2f4fe36ebc84f53df (diff)
downloadlinux-f16dea54b789aad464ae4f34caea9f8d81052729.tar.xz
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 <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_symlink.c')
-rw-r--r--fs/xfs/xfs_symlink.c9
1 files changed, 4 insertions, 5 deletions
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);