diff options
author | David Howells <dhowells@redhat.com> | 2022-02-21 14:38:17 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2023-12-28 12:45:24 +0300 |
commit | 153a9961b551101cd38e94e26cd92fbfd198b19b (patch) | |
tree | 4d45c248dbdaf8ded00848164de353f239f8bac9 /fs/netfs/objects.c | |
parent | 016dc8516aec8719641e7aaaacd78d344759178e (diff) | |
download | linux-153a9961b551101cd38e94e26cd92fbfd198b19b.tar.xz |
netfs: Implement unbuffered/DIO write support
Implement support for unbuffered writes and direct I/O writes. If the
write is misaligned with respect to the fscrypt block size, then RMW cycles
are performed if necessary. DIO writes are a special case of unbuffered
writes with extra restriction imposed, such as block size alignment
requirements.
Also provide a field that can tell the code to add some extra space onto
the bounce buffer for use by the filesystem in the case of a
content-encrypted file.
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
Diffstat (limited to 'fs/netfs/objects.c')
-rw-r--r-- | fs/netfs/objects.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c index 7153f24e8034..93f1d7431199 100644 --- a/fs/netfs/objects.c +++ b/fs/netfs/objects.c @@ -20,8 +20,10 @@ struct netfs_io_request *netfs_alloc_request(struct address_space *mapping, struct inode *inode = file ? file_inode(file) : mapping->host; struct netfs_inode *ctx = netfs_inode(inode); struct netfs_io_request *rreq; - bool is_dio = (origin == NETFS_DIO_READ); - bool cached = is_dio && netfs_is_cache_enabled(ctx); + bool is_unbuffered = (origin == NETFS_UNBUFFERED_WRITE || + origin == NETFS_DIO_READ || + origin == NETFS_DIO_WRITE); + bool cached = !is_unbuffered && netfs_is_cache_enabled(ctx); int ret; rreq = kzalloc(ctx->ops->io_request_size ?: sizeof(struct netfs_io_request), |