Re: [PATCH 4/6] mm: reintroduce vma_flags_test() as a singular flag test
"Lorenzo Stoakes (Oracle)" <[email protected]> Wed, 25 Mar 2026 15:02:02 +0000
| Newsgroups | dev.linux.lists.ntfs3,dev.linux.lists.nvdimm,org.kernel.vger.linux-cxl,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kvack.linux-mm,org.ozlabs.lists.linux-erofs |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Mar 25, 2026 at 02:57:22PM +0000, Pedro Falcato wrote: > On Thu, Mar 05, 2026 at 10:50:17AM +0000, Lorenzo Stoakes (Oracle) wrote: > > Since we've now renamed vma_flags_test() to vma_flags_test_any() to be very > > clear as to what we are in fact testing, we now have the opportunity to > > bring vma_flags_test() back, but for explicitly testing a single VMA flag. > > > > This is useful, as often flag tests are against a single flag, and > > vma_flags_test_any(flags, VMA_READ_BIT) reads oddly and potentially causes > > confusion. > > > > We use sparse to enforce that users won't accidentally pass vm_flags_t to > > this function without it being flagged so this should make it harder to get > > this wrong. > > > > Of course, passing vma_flags_t to the function is impossible, as it is a > > struct. > > > > Also update the VMA tests to reflect this change. > > > > Signed-off-by: Lorenzo Stoakes (Oracle) <[email protected]> > > Reviewed-by: Pedro Falcato <[email protected]> > > This is a lot nicer, though I am wondering if there is any difference in > codegen as well... Not that I could tell, this was more about cromulence. > > -- > Pedro Thanks, Lorenzo