lkml.org 
[lkml]   [2021]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v11 32/33] fs/netfs: Add folio fscache functions
    Date
    Matthew Wilcox (Oracle) <willy@infradead.org> wrote:

    > /**
    > - * set_page_fscache - Set PG_fscache on a page and take a ref
    > - * @page: The page.
    > + * folio_start_fscache - Start an fscache operation on a folio.
    > + * @folio: The folio.
    > *
    > - * Set the PG_fscache (PG_private_2) flag on a page and take the reference
    > - * needed for the VM to handle its lifetime correctly. This sets the flag and
    > - * takes the reference unconditionally, so care must be taken not to set the
    > - * flag again if it's already set.
    > + * Call this function before an fscache operation starts on a folio.
    > + * Starting a second fscache operation before the first one finishes is
    > + * not allowed.

    That's not correct. It's only used for operations that write from the page to
    disk. Operations that read into the page are covered by the page lock.

    > + * folio_end_fscache - End an fscache operation on a folio.
    > ...
    > + * Call this function after an fscache operation has finished. This will
    > + * wake any sleepers waiting on this folio.

    Ditto.

    > + * folio_wait_fscache - Wait for an fscache operation on this folio to end.
    > + * @folio: The folio.
    > *
    > + * If an fscache operation is in progress on this folio, wait for it to
    > + * finish. Another fscache operation may start after this one finishes,
    > + * unless the caller holds the folio lock.

    Ditto.

    Apart from that, it looks okay.

    David

    \
     
     \ /
      Last update: 2021-06-16 11:16    [W:4.125 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site