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.