Re: [PATCH] mm: include swap.h in swapops.h

From: Kiryl Shutsemau

Date: Wed Aug 19 2026 - 10:47:45 EST


On Wed, Aug 19, 2026 at 01:26:07PM +0800, Barry Song wrote:
> On Tue, Aug 18, 2026 at 7:50 PM Kiryl Shutsemau <kirill@xxxxxxxxxxxxx> wrote:
> >
> > From: "Kiryl Shutsemau (Meta)" <kas@xxxxxxxxxx>
> >
> > swapops.h uses MAX_SWAPFILES_SHIFT, SWP_MIGRATION_READ and SWP_PTE_MARKER,
> > all of which swap.h defines, but does not include swap.h. It compiles only
> > where the translation unit pulled swap.h in first. leafops.h includes
> > swapops.h on the line above swap.h, so a file whose include list reaches
> > leafops.h before swap.h gets:
> >
> > In file included from include/linux/leafops.h:11:
> > include/linux/swapops.h:88:21: error: use of undeclared
> > identifier 'MAX_SWAPFILES_SHIFT'
> >
> > A header that uses a definition has to include the header that provides it.
> >
> > Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202608181757.mza9RRj7-lkp@xxxxxxxxx/
> > Signed-off-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
> > ---
>
> Basically, is this preparing for the patchset below?
>
> https://lore.kernel.org/linux-mm/20260816224609.308019-1-kirill@xxxxxxxxxxxxx/

My patchset just triggered inert bug.

> Reviewed-by: Barry Song <baohua@xxxxxxxxxx>

Thanks!

--
Kiryl Shutsemau / Kirill A. Shutemov