]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - fs/netfs/objects.c
netfs: Implement unbuffered/DIO write support
[thirdparty/linux.git] / fs / netfs / objects.c
index 7153f24e80341ddb516c395b123c998b5b533407..93f1d74311993805f9e33ac1f30c09e03b3c64a2 100644 (file)
@@ -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),