Linux-bcachefs Archive mirror
 help / color / mirror / Atom feed
From: Reed Riley <reed@riley.engineer>
To: "linux-bcachefs@vger.kernel.org" <linux-bcachefs@vger.kernel.org>
Subject: [PATCH] bcachefs: support REMAP_FILE_DEDUP in bch2_remap_file_range
Date: Sat, 11 May 2024 00:20:12 +0000	[thread overview]
Message-ID: <yuG-zWAd7xX9SkysCfG2ELC8drJi3bxsagrf03hf2Aeah__0W1exPDJabqC23NyOzt5BXmYEF95045yO2SfCbZMgGkYqbycmlUIBZqk2vyE=@riley.engineer> (raw)

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 <reed@riley.engineer>
---
 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


             reply	other threads:[~2024-05-11  0:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11  0:20 Reed Riley [this message]
2024-05-13 12:34 ` [PATCH] bcachefs: support REMAP_FILE_DEDUP in bch2_remap_file_range Brian Foster
2024-05-13 23:42   ` Reed Riley
2024-05-14 10:58     ` Brian Foster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='yuG-zWAd7xX9SkysCfG2ELC8drJi3bxsagrf03hf2Aeah__0W1exPDJabqC23NyOzt5BXmYEF95045yO2SfCbZMgGkYqbycmlUIBZqk2vyE=@riley.engineer' \
    --to=reed@riley.engineer \
    --cc=linux-bcachefs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).