From: Matthew Wilcox <willy@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org
Subject: Re: [RFC PATCH] folio: Add a function to get the host inode for a folio
Date: Thu, 12 Aug 2021 23:44:24 +0100 [thread overview]
Message-ID: <YRWkSGnk6M+6H/Oh@casper.infradead.org> (raw)
In-Reply-To: <162880453171.3369675.3704943108660112470.stgit@warthog.procyon.org.uk>
On Thu, Aug 12, 2021 at 10:42:11PM +0100, David Howells wrote:
> Add a convenience function, folio_inode() that will get the host inode from
> a folio's mapping.
>
> [Includes netfs and afs changes for illustration, but I'd move those to a
> different patch].
Seems like a good idea. Across my entire devel tree, I find 36
occurrences:
$ git log -p origin..devel |grep folio.*mapping.*host
+ struct inode *inode = folio->mapping->host;
+ struct inode *dir = folio->mapping->host;
+ unsigned int nr_blocks = i_blocks_per_folio(page->mapping->host, folio);
+ struct btrfs_fs_info *fs_info = btrfs_sb(folio->mapping->host->i_sb);
+ struct afs_vnode *dvnode = AFS_FS_I(folio->mapping->host);
+ tree = &BTRFS_I(folio->mapping->host)->io_tree;
+ btrfs_warn(BTRFS_I(folio->mapping->host)->root->fs_info,
+ struct btrfs_inode *inode = BTRFS_I(folio->mapping->host);
+ inode = folio->mapping->host;
+ struct cifsInodeInfo *cifsi = CIFS_I(folio->mapping->host);
+ struct inode *inode = folio->mapping->host;
+ struct gfs2_sbd *sdp = GFS2_SB(folio->mapping->host);
+ trace_iomap_invalidate_folio(folio->mapping->host, offset, len);
+ nfs_wb_page_cancel(folio_file_mapping(folio)->host, &folio->page);
+ nfs_fscache_invalidate_page(&folio->page, folio->mapping->host);
+ struct inode *inode = folio->mapping->host;
+ struct inode *inode = folio->mapping->host;
+ struct inode *inode = folio->mapping->host;
+ struct inode *inode = folio->mapping->host;
+ struct inode *inode = folio->mapping->host;
+ int err = fuse_readlink_page(folio->mapping->host, &folio->page);
+ struct inode *inode = folio->mapping->host;
+ struct btrfs_inode *inode = BTRFS_I(folios[0]->mapping->host);
+ struct inode *inode = folio->mapping->host;
+ __entry->i_ino = folio->mapping->host->i_ino;
+ if (folio->mapping->host->i_sb)
+ __entry->s_dev = folio->mapping->host->i_sb->s_dev;
+ __entry->s_dev = folio->mapping->host->i_rdev;
+ struct inode *inode = folio->mapping->host;
+ struct inode *inode = folio->mapping->host;
+ struct inode *inode = folio->mapping->host;
+ struct inode *inode = folio->mapping->host;
+ trace_iomap_invalidatepage(folio->mapping->host, offset, len);
+ trace_iomap_releasepage(folio->mapping->host, folio_pos(folio),
+ struct inode *inode = folio->mapping->host;
+ if (folio->mapping->host->i_sb->s_iflags & SB_I_STABLE_WRITES)
It's only two characters less, but it seems worth doing.
next prev parent reply other threads:[~2021-08-12 22:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 21:42 David Howells
2021-08-12 22:44 ` Matthew Wilcox [this message]
2021-08-13 10:15 ` David Howells
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=YRWkSGnk6M+6H/Oh@casper.infradead.org \
--to=willy@infradead.org \
--cc=dhowells@redhat.com \
--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