linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 14/24] remap_range: Remove check of uptodate flag
Date: Mon, 30 May 2022 13:35:32 +0100	[thread overview]
Message-ID: <YpS6FHg0Gz7yfQsj@casper.infradead.org> (raw)
In-Reply-To: <YpG6J7BxY3DAGp/0@infradead.org>

On Fri, May 27, 2022 at 10:59:03PM -0700, Christoph Hellwig wrote:
> On Fri, May 27, 2022 at 04:50:26PM +0100, Matthew Wilcox (Oracle) wrote:
> > read_mapping_folio() returns an ERR_PTR if the folio is not
> > uptodate, so this check is simply dead code.
> 
> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 
> >  /* Read a page's worth of file data into the page cache. */
> >  static struct folio *vfs_dedupe_get_folio(struct file *file, loff_t pos)
> >  {
> > +	return read_mapping_folio(file->f_mapping, pos >> PAGE_SHIFT, file);
> >  }
> 
> But I wonder if this isn't useful enough to go to filemap.c in one form
> or another.

It looks like it should be, but most in-kernel users of
read_mapping_folio() and its friends want to pass NULL for file as they
don't have an open file.

Indeed, this code used to until I realised we actually do have open
files here, so should pass them.  I don't think it affects anything;
the only users who need the struct file are network filesystems, and
nobody does dedupe across the network.  If it's not done transparently
by the server, it's an obvious server offload operation.

  reply	other threads:[~2022-05-30 12:36 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 15:50 [PATCH 00/24] Begin removing PageError Matthew Wilcox (Oracle)
2022-05-27 15:50 ` [PATCH 01/24] block: Remove check of PageError Matthew Wilcox (Oracle)
2022-05-28  5:47   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 02/24] afs: " Matthew Wilcox (Oracle)
2022-05-28  5:47   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 03/24] freevxfs: " Matthew Wilcox (Oracle)
2022-05-28  5:48   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 04/24] gfs: Check PageUptodate instead " Matthew Wilcox (Oracle)
2022-05-28  5:48   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 05/24] hfs: Remove check for PageError Matthew Wilcox (Oracle)
2022-05-28  5:48   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 06/24] hfsplus: " Matthew Wilcox (Oracle)
2022-05-28  5:48   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 07/24] ntfs: " Matthew Wilcox (Oracle)
2022-05-28  5:48   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 08/24] ext2: " Matthew Wilcox (Oracle)
2022-05-28  5:49   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 09/24] nilfs2: " Matthew Wilcox (Oracle)
2022-05-28  5:49   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 10/24] ntfs: " Matthew Wilcox (Oracle)
2022-05-28  5:49   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 11/24] ntfs3: " Matthew Wilcox (Oracle)
2022-05-28  5:51   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 12/24] reiserfs: " Matthew Wilcox (Oracle)
2022-05-28  5:52   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 13/24] ufs: Remove checks " Matthew Wilcox (Oracle)
2022-05-28  5:56   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 14/24] remap_range: Remove check of uptodate flag Matthew Wilcox (Oracle)
2022-05-28  5:59   ` Christoph Hellwig
2022-05-30 12:35     ` Matthew Wilcox [this message]
2022-05-27 15:50 ` [PATCH 15/24] jfs: Remove check for PageUptodate Matthew Wilcox (Oracle)
2022-05-28  5:59   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 16/24] iomap: Remove test for folio error Matthew Wilcox (Oracle)
2022-05-28  6:00   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 17/24] orangefs: " Matthew Wilcox (Oracle)
2022-05-28  6:00   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 18/24] buffer: Remove check for PageError Matthew Wilcox (Oracle)
2022-05-28  6:01   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 19/24] nfs: Leave pages in the pagecache if readpage failed Matthew Wilcox (Oracle)
2022-05-28  6:02   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 20/24] btrfs: Use a folio in wait_dev_supers() Matthew Wilcox (Oracle)
2022-05-28  6:03   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 21/24] buffer: Don't test folio error in block_read_full_folio() Matthew Wilcox (Oracle)
2022-05-28  6:05   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 22/24] squashfs: Return the actual error from squashfs_read_folio() Matthew Wilcox (Oracle)
2022-05-28  6:06   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 23/24] hostfs: Handle page write errors correctly Matthew Wilcox (Oracle)
2022-05-28  6:06   ` Christoph Hellwig
2022-05-27 15:50 ` [PATCH 24/24] ocfs2: Use filemap_write_and_wait_range() in ocfs2_cow_sync_writeback() Matthew Wilcox (Oracle)
2022-05-28  6:07   ` Christoph Hellwig
2022-05-28  6:12 ` [PATCH 00/24] Begin removing PageError Christoph Hellwig

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=YpS6FHg0Gz7yfQsj@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.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 NNTP newsgroup(s).