xfs: Conditionally upgrade existing inodes to use large extent counters
This commit enables upgrading existing inodes to use large extent counters provided that underlying filesystem's superblock has large extent counter feature enabled. Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
This commit is contained in:
@ -859,6 +859,9 @@ xfs_alloc_file_space(
|
||||
|
||||
error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK,
|
||||
XFS_IEXT_ADD_NOSPLIT_CNT);
|
||||
if (error == -EFBIG)
|
||||
error = xfs_iext_count_upgrade(tp, ip,
|
||||
XFS_IEXT_ADD_NOSPLIT_CNT);
|
||||
if (error)
|
||||
goto error;
|
||||
|
||||
@ -914,6 +917,8 @@ xfs_unmap_extent(
|
||||
|
||||
error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK,
|
||||
XFS_IEXT_PUNCH_HOLE_CNT);
|
||||
if (error == -EFBIG)
|
||||
error = xfs_iext_count_upgrade(tp, ip, XFS_IEXT_PUNCH_HOLE_CNT);
|
||||
if (error)
|
||||
goto out_trans_cancel;
|
||||
|
||||
@ -1195,6 +1200,8 @@ xfs_insert_file_space(
|
||||
|
||||
error = xfs_iext_count_may_overflow(ip, XFS_DATA_FORK,
|
||||
XFS_IEXT_PUNCH_HOLE_CNT);
|
||||
if (error == -EFBIG)
|
||||
error = xfs_iext_count_upgrade(tp, ip, XFS_IEXT_PUNCH_HOLE_CNT);
|
||||
if (error)
|
||||
goto out_trans_cancel;
|
||||
|
||||
@ -1423,6 +1430,9 @@ xfs_swap_extent_rmap(
|
||||
error = xfs_iext_count_may_overflow(ip,
|
||||
XFS_DATA_FORK,
|
||||
XFS_IEXT_SWAP_RMAP_CNT);
|
||||
if (error == -EFBIG)
|
||||
error = xfs_iext_count_upgrade(tp, ip,
|
||||
XFS_IEXT_SWAP_RMAP_CNT);
|
||||
if (error)
|
||||
goto out;
|
||||
}
|
||||
@ -1431,6 +1441,9 @@ xfs_swap_extent_rmap(
|
||||
error = xfs_iext_count_may_overflow(tip,
|
||||
XFS_DATA_FORK,
|
||||
XFS_IEXT_SWAP_RMAP_CNT);
|
||||
if (error == -EFBIG)
|
||||
error = xfs_iext_count_upgrade(tp, ip,
|
||||
XFS_IEXT_SWAP_RMAP_CNT);
|
||||
if (error)
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user