netfs: Add a function to consolidate beginning a read
authorDavid Howells <dhowells@redhat.com>
Wed, 2 Mar 2022 10:50:22 +0000 (10:50 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 18 Mar 2022 09:29:05 +0000 (09:29 +0000)
commit4090b31422a6f24dfe701e31ffec7ba5804a7e2f
tree51494064485647840568ce41531bbf66cf5aec2e
parentbc899ee1c898e520574ff4d99356eb2e724a9265
netfs: Add a function to consolidate beginning a read

Add a function to do the steps needed to begin a read request, allowing
this code to be removed from several other functions and consolidated.

Changes
=======
ver #2)
 - Move before the unstaticking patch so that some functions can be left
   static.
 - Set uninitialised return code in netfs_begin_read()[1][2].
 - Fixed a refleak caused by non-removal of a get from netfs_write_begin()
   when the request submission code got moved to netfs_begin_read().
 - Use INIT_WORK() to (re-)init the request work_struct[3].

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/20220303163826.1120936-1-nathan@kernel.org/
Link: https://lore.kernel.org/r/20220303235647.1297171-1-colin.i.king@gmail.com/
Link: https://lore.kernel.org/r/9d69be49081bccff44260e4c6e0049c63d6d04a1.camel@redhat.com/
Link: https://lore.kernel.org/r/164623004355.3564931.7275693529042495641.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164678214287.1200972.16734134007649832160.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164692911113.2099075.1060868473229451371.stgit@warthog.procyon.org.uk/
fs/netfs/internal.h
fs/netfs/objects.c
fs/netfs/read_helper.c
include/trace/events/netfs.h