xfs: drop unnecessary setfilesize helper
authorBrian Foster <bfoster@redhat.com>
Fri, 9 Apr 2021 17:27:56 +0000 (10:27 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 9 Apr 2021 17:32:13 +0000 (10:32 -0700)
xfs_setfilesize() is the only remaining caller of the internal
__xfs_setfilesize() helper. Fold them into a single function.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_aops.c

index 796fc4b48585e545b73ed1a04e7e295a0eef9045..fb66c5d20d261ba49c48a2e463b3a0f59c29ada2 100644 (file)
@@ -42,14 +42,20 @@ static inline bool xfs_ioend_is_append(struct iomap_ioend *ioend)
 /*
  * Update on-disk file size now that data has been written to disk.
  */
-STATIC int
-__xfs_setfilesize(
+int
+xfs_setfilesize(
        struct xfs_inode        *ip,
-       struct xfs_trans        *tp,
        xfs_off_t               offset,
        size_t                  size)
 {
+       struct xfs_mount        *mp = ip->i_mount;
+       struct xfs_trans        *tp;
        xfs_fsize_t             isize;
+       int                     error;
+
+       error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);
+       if (error)
+               return error;
 
        xfs_ilock(ip, XFS_ILOCK_EXCL);
        isize = xfs_new_eof(ip, offset + size);
@@ -68,23 +74,6 @@ __xfs_setfilesize(
        return xfs_trans_commit(tp);
 }
 
-int
-xfs_setfilesize(
-       struct xfs_inode        *ip,
-       xfs_off_t               offset,
-       size_t                  size)
-{
-       struct xfs_mount        *mp = ip->i_mount;
-       struct xfs_trans        *tp;
-       int                     error;
-
-       error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);
-       if (error)
-               return error;
-
-       return __xfs_setfilesize(ip, tp, offset, size);
-}
-
 /*
  * IO write completion.
  */