Re: [PATCH v4 09/25] mm: Add folio_index, folio_page and folio_contains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 13, 2021 at 12:37:16PM -0800, Andrew Morton wrote:
> On Fri,  5 Mar 2021 04:18:45 +0000 "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> wrote:
> > folio_index() is the equivalent of page_index() for folios.  folio_page()
> > finds the page in a folio for a page cache index.  folio_contains()
> > tells you whether a folio contains a particular page cache index.
> > 
> 
> copy-paste changelog into each function's covering comment?

Certainly.

> > +static inline struct page *folio_page(struct folio *folio, pgoff_t index)
> > +{
> > +	index -= folio_index(folio);
> > +	VM_BUG_ON_FOLIO(index >= folio_nr_pages(folio), folio);
> > +	return &folio->page + index;
> > +}
> 
> One would expect folio_page() to be the reverse of page_folio(), only
> it isn't anything like that.

It is ... but only for files.  So maybe folio_file_page()?




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux