Skip to content

Commit 7a6ccf0

Browse files
djwongdchinner
authored andcommitted
xfs: remove redundant remap partial EOF block checks
Now that we've moved the partial EOF block checks to the VFS helpers, we can remove the redundant functionality from XFS. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent 3f68c1f commit 7a6ccf0

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

fs/xfs/xfs_reflink.c

-19
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,6 @@ xfs_reflink_remap_prep(
13141314
struct inode *inode_out = file_inode(file_out);
13151315
struct xfs_inode *dest = XFS_I(inode_out);
13161316
bool same_inode = (inode_in == inode_out);
1317-
u64 blkmask = i_blocksize(inode_in) - 1;
13181317
ssize_t ret;
13191318

13201319
/* Lock both files against IO */
@@ -1342,24 +1341,6 @@ xfs_reflink_remap_prep(
13421341
if (ret < 0 || *len == 0)
13431342
goto out_unlock;
13441343

1345-
/*
1346-
* If the dedupe data matches, chop off the partial EOF block
1347-
* from the source file so we don't try to dedupe the partial
1348-
* EOF block.
1349-
*/
1350-
if (remap_flags & REMAP_FILE_DEDUP) {
1351-
*len &= ~blkmask;
1352-
} else if (*len & blkmask) {
1353-
/*
1354-
* The user is attempting to share a partial EOF block,
1355-
* if it's inside the destination EOF then reject it.
1356-
*/
1357-
if (pos_out + *len < i_size_read(inode_out)) {
1358-
ret = -EINVAL;
1359-
goto out_unlock;
1360-
}
1361-
}
1362-
13631344
/* Attach dquots to dest inode before changing block map */
13641345
ret = xfs_qm_dqattach(dest);
13651346
if (ret)

0 commit comments

Comments
 (0)