On Sat, May 11, 2024 at 12:20:12AM +0000, Reed Riley wrote: > 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]> > ---
Seems reasonable: Reviewed-by: Brian Foster <[email protected]> Have you run any tests just to make sure there are no surprises? If not, it looks like xfs_io has a 'dedupe' command that would make it easy to run a quick test or two from the command line. fstests has a bunch of tests in the dedupe group (which I presume this patch should now allow to run on bcachefs) as well. Brian > fs/bcachefs/fs-io.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c > index 20b40477425f..4f513f22a66a 100644 > --- a/fs/bcachefs/fs-io.c > +++ b/fs/bcachefs/fs-io.c > @@ -857,9 +857,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; > -- > 2.44.0 > >
