OSDN Git Service

afs: Use the netfs_write_begin() helper
authorDavid Howells <dhowells@redhat.com>
Thu, 6 Feb 2020 14:22:29 +0000 (14:22 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 23 Apr 2021 09:17:28 +0000 (10:17 +0100)
commit3003bbd0697b659944237f3459489cb596ba196c
tree9549110fad53b5950e1a9ab5851268d48d5f8fdd
parent5cbf03985c67c7f0ac8c5382cf5d4d0d630f95f3
afs: Use the netfs_write_begin() helper

Make AFS use the new netfs_write_begin() helper to do the pre-reading
required before the write.  If successful, the helper returns with the
required page filled in and locked.  It may read more than just one page,
expanding the read to meet cache granularity requirements as necessary.

Note: A more advanced version of this could be made that does
generic_perform_write() for a whole cache granule.  This would make it
easier to avoid doing the download/read for the data to be overwritten.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-By: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-cachefs@redhat.com
cc: linux-fsdevel@vger.kernel.org
Link: https://lore.kernel.org/r/160588546422.3465195.1546354372589291098.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/161539563244.286939.16537296241609909980.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/161653819291.2770958.406013201547420544.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/161789102743.6155.17396591236631761195.stgit@warthog.procyon.org.uk/
fs/afs/file.c
fs/afs/internal.h
fs/afs/write.c