diff options
author | David Howells <dhowells@redhat.com> | 2022-01-20 21:55:46 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2022-03-18 09:24:00 +0000 |
commit | 2de160417315b8d64455fe03e9bb7d3308ac3281 (patch) | |
tree | fe7a61cba73b3f0e025e859c2bb7609818086da3 /fs/9p | |
parent | 663dfb65c3b3ea4b8e1944680352992d58f3aa22 (diff) | |
download | linux-2de160417315b8d64455fe03e9bb7d3308ac3281.tar.gz linux-2de160417315b8d64455fe03e9bb7d3308ac3281.tar.bz2 linux-2de160417315b8d64455fe03e9bb7d3308ac3281.zip |
netfs: Change ->init_request() to return an error code
Change the request initialisation function to return an error code so that
the network filesystem can return a failure (ENOMEM, for example).
This will also allow ceph to abort a ->readahead() op if the server refuses
to give it a cap allowing local caching from within the netfslib framework
(errors aren't passed back through ->readahead(), so returning, say,
-ENOBUFS will cause the op to be aborted).
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/164678212401.1200972.16537041523832944934.stgit@warthog.procyon.org.uk/ # v2
Link: https://lore.kernel.org/r/164692905398.2099075.5238033621684646524.stgit@warthog.procyon.org.uk/ # v3
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/vfs_addr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index fdc1033a1546..91d3926c9559 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -56,12 +56,13 @@ static void v9fs_issue_read(struct netfs_io_subrequest *subreq) * @rreq: The read request * @file: The file being read from */ -static void v9fs_init_request(struct netfs_io_request *rreq, struct file *file) +static int v9fs_init_request(struct netfs_io_request *rreq, struct file *file) { struct p9_fid *fid = file->private_data; refcount_inc(&fid->count); rreq->netfs_priv = fid; + return 0; } /** |