diff options
author | Reed Riley <[email protected]> | 2024-05-11 00:20:12 +0000 |
---|---|---|
committer | Kent Overstreet <[email protected]> | 2024-07-14 19:00:15 -0400 |
commit | 7f3dc6c98b52204c0060fa7eee0fbced05958544 (patch) | |
tree | 42018a9817c38648a91eaeeae7891100cb616b56 | |
parent | 7a254053a59008913247606d0ce4a0a8b61fe6ee (diff) |
bcachefs: support REMAP_FILE_DEDUP in bch2_remap_file_range
By removing the early-exit when REMAP_FILE_DEDUP is set, we should be
able to support the fideduperange ioctl, albeit less efficiently than if
we handled some of the extent locking and comparison logic inside
bcachefs. Extent comparison logic already exists inside of
`__generic_remap_file_range_prep`.
Signed-off-by: Reed Riley <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
-rw-r--r-- | fs/bcachefs/fs-io.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index fead9ab10e4a..77b85da30fb2 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -867,9 +867,6 @@ loff_t bch2_remap_file_range(struct file *file_src, loff_t pos_src, if (remap_flags & ~(REMAP_FILE_DEDUP|REMAP_FILE_ADVISORY)) return -EINVAL; - if (remap_flags & REMAP_FILE_DEDUP) - return -EOPNOTSUPP; - if ((pos_src & (block_bytes(c) - 1)) || (pos_dst & (block_bytes(c) - 1))) return -EINVAL; @@ -902,7 +899,8 @@ loff_t bch2_remap_file_range(struct file *file_src, loff_t pos_src, if (ret) goto err; - file_update_time(file_dst); + if (!(remap_flags & REMAP_FILE_DEDUP)) + file_update_time(file_dst); bch2_mark_pagecache_unallocated(src, pos_src >> 9, (pos_src + aligned_len) >> 9); |