• David Howells's avatar
    netfs: Make netfs_read_folio() handle streaming-write pages · 7f84a7b9
    David Howells authored
    netfs_read_folio() needs to handle partially-valid pages that are marked
    dirty, but not uptodate in the event that someone tries to read a page was
    used to cache data by a streaming write.
    
    In such a case, make netfs_read_folio() set up a bvec iterator that points
    to the parts of the folio that need filling and to a sink page for the data
    that should be discarded and use that instead of i_pages as the iterator to
    be written to.
    
    This requires netfs_rreq_unlock_folios() to convert the page into a normal
    dirty uptodate page, getting rid of the partial write record and bumping
    the group pointer over to folio->private.
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    cc: linux-cachefs@redhat.com
    cc: linux-fsdevel@vger.kernel.org
    cc: linux-mm@kvack.org
    7f84a7b9
buffered_read.c 16.3 KB