lkml.org 
[lkml]   [2022]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RESEND PATCH v4] fs/ufs: Replace kmap() with kmap_local_page()
    On Fri, Nov 25, 2022 at 10:17:28PM +0000, Al Viro wrote:

    > The bottom line:
    > * teach your ufs_put_page() to accept any address within the page
    > * flip the ways you return page and address in ufs_get_page()
    > * use offset_in_page(addr) instead of these addr - page_address(page)
    > and you'll get a much smaller patch, with a lot less noise in it.
    > What's more, offset_in_page() part can be carved out into a separate
    > commit - it's valid on its own, and it makes both halves easier to
    > follow.
    >
    > AFAICS, similar observations apply in your sysvfs patch; the point about
    > calling conventions for ufs_get_page() definitely applies there, and
    > stronger than for ufs - those casts are eye-watering...

    As the matter of fact, I'd probably split it into 3 steps:
    1) switch the calling conventions of ufs_get_page() - callers follow
    it with something like kaddr = page_address(page); and that change makes
    sense on its own. Isolated and easy to follow.
    2) offset_in_page() changes. Again, separate, stands on its own and
    is easy to follow.
    3) kmap_local() switch itself - pass address to ufs_put_page(), etc.
    Considerably smaller and less cluttered than your current variant.

    \
     
     \ /
      Last update: 2022-11-25 23:51    [W:3.044 / U:0.332 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site