Skip to content

Commit e7a3d7e

Browse files
Brian FosterDarrick J. Wong
authored andcommitted
xfs: drop unnecessary setfilesize helper
xfs_setfilesize() is the only remaining caller of the internal __xfs_setfilesize() helper. Fold them into a single function. Signed-off-by: Brian Foster <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 044c644 commit e7a3d7e

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

fs/xfs/xfs_aops.c

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,20 @@ static inline bool xfs_ioend_is_append(struct iomap_ioend *ioend)
4242
/*
4343
* Update on-disk file size now that data has been written to disk.
4444
*/
45-
STATIC int
46-
__xfs_setfilesize(
45+
int
46+
xfs_setfilesize(
4747
struct xfs_inode *ip,
48-
struct xfs_trans *tp,
4948
xfs_off_t offset,
5049
size_t size)
5150
{
51+
struct xfs_mount *mp = ip->i_mount;
52+
struct xfs_trans *tp;
5253
xfs_fsize_t isize;
54+
int error;
55+
56+
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);
57+
if (error)
58+
return error;
5359

5460
xfs_ilock(ip, XFS_ILOCK_EXCL);
5561
isize = xfs_new_eof(ip, offset + size);
@@ -68,23 +74,6 @@ __xfs_setfilesize(
6874
return xfs_trans_commit(tp);
6975
}
7076

71-
int
72-
xfs_setfilesize(
73-
struct xfs_inode *ip,
74-
xfs_off_t offset,
75-
size_t size)
76-
{
77-
struct xfs_mount *mp = ip->i_mount;
78-
struct xfs_trans *tp;
79-
int error;
80-
81-
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp);
82-
if (error)
83-
return error;
84-
85-
return __xfs_setfilesize(ip, tp, offset, size);
86-
}
87-
8877
/*
8978
* IO write completion.
9079
*/

0 commit comments

Comments
 (0)