aboutsummaryrefslogtreecommitdiffstats
path: root/fs/netfs/objects.c
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2024-12-16 20:40:58 +0000
committerChristian Brauner <[email protected]>2024-12-20 21:34:03 +0000
commit360157829ee3dba848ffa817792d9a07969e0a95 (patch)
tree50ec8de002e0066f18f10029498779ac3482269a /fs/netfs/objects.c
parentnetfs: Split retry code out of fs/netfs/write_collect.c (diff)
downloadkernel-360157829ee3dba848ffa817792d9a07969e0a95.tar.gz
kernel-360157829ee3dba848ffa817792d9a07969e0a95.zip
netfs: Drop the error arg from netfs_read_subreq_terminated()
Drop the error argument from netfs_read_subreq_terminated() in favour of passing the value in subreq->error. Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/r/[email protected] cc: Jeff Layton <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'fs/netfs/objects.c')
-rw-r--r--fs/netfs/objects.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c
index 5cdddaf1f978..f10fd56efa17 100644
--- a/fs/netfs/objects.c
+++ b/fs/netfs/objects.c
@@ -191,7 +191,20 @@ struct netfs_io_subrequest *netfs_alloc_subrequest(struct netfs_io_request *rreq
}
memset(subreq, 0, kmem_cache_size(cache));
- INIT_WORK(&subreq->work, NULL);
+
+ switch (rreq->origin) {
+ case NETFS_READAHEAD:
+ case NETFS_READPAGE:
+ case NETFS_READ_GAPS:
+ case NETFS_READ_FOR_WRITE:
+ case NETFS_DIO_READ:
+ INIT_WORK(&subreq->work, netfs_read_subreq_termination_worker);
+ break;
+ default:
+ INIT_WORK(&subreq->work, NULL);
+ break;
+ }
+
INIT_LIST_HEAD(&subreq->rreq_link);
refcount_set(&subreq->ref, 2);
subreq->rreq = rreq;