netfs: Implement unbuffered/DIO vs buffered I/O locking
authorDavid Howells <dhowells@redhat.com>
Wed, 11 Oct 2023 14:34:07 +0000 (15:34 +0100)
committerDavid Howells <dhowells@redhat.com>
Sun, 24 Dec 2023 15:08:52 +0000 (15:08 +0000)
commit46ed60dcd4f2c94d27735743ce55cd8d6b93cc1d
treedf301bcb6bd4bdf33b46ba46499353f83753c4df
parentc1ec4d7c2e13471558cfea302b7583856284f94c
netfs: Implement unbuffered/DIO vs buffered I/O locking

Borrow NFS's direct-vs-buffered I/O locking into netfslib.  Similar code is
also used in ceph.

Modify it to have the correct checker annotations for i_rwsem lock
acquisition/release and to return -ERESTARTSYS if waits are interrupted.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
fs/netfs/Makefile
fs/netfs/locking.c [new file with mode: 0644]
include/linux/netfs.h