Re: [PATCH 14/17] gup: Convert for_each_compound_head() to gup_for_each_folio()

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

 



On Sun, Jan 02, 2022 at 09:57:26PM +0000, Matthew Wilcox (Oracle) wrote:
> This macro can be considerably simplified by returning the folio from
> gup_folio_next() instead of void from compound_next().  Convert both
> callers to work on folios instead of pages.

This looks sensible, but looking at the macro I wonder if an open
coded while loop (using your new calling conventions) wouldn't make
formore readable code than the macro:

	int i = 0;

	...

	while ((folio = gup_folio_next(i, npages, list, &ntail) != NULL)) {
		...
		i += ntails;
	}





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux