diff options
author | Christoph Hellwig <hch@lst.de> | 2024-08-31 00:36:55 +0200 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-09-01 17:58:19 +0200 |
commit | 237130564ef3745ab4a8b5ba09da929befc761d9 (patch) | |
tree | a187ed2e7273adcf4d4bc32368c1efa058ac1230 /fs/xfs/xfs_rtalloc.c | |
parent | xfs: add bounds checking to xfs_rt{bitmap,summary}_read_buf (diff) | |
download | linux-237130564ef3745ab4a8b5ba09da929befc761d9.tar.xz linux-237130564ef3745ab4a8b5ba09da929befc761d9.zip |
xfs: cleanup the calling convention for xfs_rtpick_extent
xfs_rtpick_extent never returns an error. Do away with the error return
and directly return the picked extent instead of doing that through a
call by reference argument.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r-- | fs/xfs/xfs_rtalloc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 3728445b0b1c..64ba4bcf6e29 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -1300,12 +1300,11 @@ xfs_rtunmount_inodes( * of rtextents and the fraction. * The fraction sequence is 0, 1/2, 1/4, 3/4, 1/8, ..., 7/8, 1/16, ... */ -static int +static xfs_rtxnum_t xfs_rtpick_extent( xfs_mount_t *mp, /* file system mount point */ xfs_trans_t *tp, /* transaction pointer */ - xfs_rtxlen_t len, /* allocation length (rtextents) */ - xfs_rtxnum_t *pick) /* result rt extent */ + xfs_rtxlen_t len) /* allocation length (rtextents) */ { xfs_rtxnum_t b; /* result rtext */ int log2; /* log of sequence number */ @@ -1336,8 +1335,7 @@ xfs_rtpick_extent( ts.tv_sec = seq + 1; inode_set_atime_to_ts(VFS_I(mp->m_rbmip), ts); xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); - *pick = b; - return 0; + return b; } static void @@ -1444,9 +1442,7 @@ retry: * If it's an allocation to an empty file at offset 0, pick an * extent that will space things out in the rt area. */ - error = xfs_rtpick_extent(mp, ap->tp, ralen, &start); - if (error) - return error; + start = xfs_rtpick_extent(mp, ap->tp, ralen); } else { start = 0; } |