• David Howells's avatar
    netfs: Implement a write-through caching option · 41d8e767
    David Howells authored
    Provide a flag whereby a filesystem may request that cifs_perform_write()
    perform write-through caching.  This involves putting pages directly into
    writeback rather than dirty and attaching them to a write operation as we
    go.
    
    Further, the writes being made are limited to the byte range being written
    rather than whole folios being written.  This can be used by cifs, for
    example, to deal with strict byte-range locking.
    
    This can't be used with content encryption as that may require expansion of
    the write RPC beyond the write being made.
    
    This doesn't affect writes via mmap - those are written back in the normal
    way; similarly failed writethrough writes are marked dirty and left to
    writeback to retry.  Another option would be to simply invalidate them, but
    the contents can be simultaneously accessed by read() and through mmap.
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    cc: Jeff Layton <jlayton@kernel.org>
    cc: linux-cachefs@redhat.com
    cc: linux-fsdevel@vger.kernel.org
    cc: linux-mm@kvack.org
    41d8e767
main.c 3 KB