summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-10-30 20:24:58 +0100
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-03 19:22:30 +0100
commit57c49444d7cc93167961842af94df465478b2f55 (patch)
tree4d17d6912fe5944ab4718b2bff9ff592f94cd577 /fs/xfs/xfs_iomap.c
parentxfs: mark xfs_eof_alignment static (diff)
downloadlinux-57c49444d7cc93167961842af94df465478b2f55.tar.xz
linux-57c49444d7cc93167961842af94df465478b2f55.zip
xfs: remove the extsize argument to xfs_eof_alignment
And move the code dependent on it to the one caller that cares instead. Signed-off-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_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index e01010af5c0a..7615ddf0ddba 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -118,8 +118,7 @@ xfs_iomap_end_fsb(
static xfs_extlen_t
xfs_eof_alignment(
- struct xfs_inode *ip,
- xfs_extlen_t extsize)
+ struct xfs_inode *ip)
{
struct xfs_mount *mp = ip->i_mount;
xfs_extlen_t align = 0;
@@ -142,17 +141,6 @@ xfs_eof_alignment(
align = 0;
}
- /*
- * Always round up the allocation request to an extent boundary
- * (when file on a real-time subvolume or has di_extsize hint).
- */
- if (extsize) {
- if (align)
- align = roundup_64(align, extsize);
- else
- align = extsize;
- }
-
return align;
}
@@ -167,12 +155,22 @@ xfs_iomap_eof_align_last_fsb(
{
struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
xfs_extlen_t extsz = xfs_get_extsz_hint(ip);
- xfs_extlen_t align = xfs_eof_alignment(ip, extsz);
+ xfs_extlen_t align = xfs_eof_alignment(ip);
struct xfs_bmbt_irec irec;
struct xfs_iext_cursor icur;
ASSERT(ifp->if_flags & XFS_IFEXTENTS);
+ /*
+ * Always round up the allocation request to the extent hint boundary.
+ */
+ if (extsz) {
+ if (align)
+ align = roundup_64(align, extsz);
+ else
+ align = extsz;
+ }
+
if (align) {
xfs_fileoff_t aligned_end_fsb = roundup_64(end_fsb, align);
@@ -992,7 +990,7 @@ xfs_buffered_write_iomap_begin(
p_end_fsb = XFS_B_TO_FSBT(mp, end_offset) +
prealloc_blocks;
- align = xfs_eof_alignment(ip, 0);
+ align = xfs_eof_alignment(ip);
if (align)
p_end_fsb = roundup_64(p_end_fsb, align);