]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Copy local writes to the cache when writing to the server
authorDavid Howells <dhowells@redhat.com>
Thu, 6 Feb 2020 14:22:30 +0000 (14:22 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 7 Jan 2022 13:44:52 +0000 (13:44 +0000)
commit8cf7fec8f164b513365aa30e35b82bc70bb059db
tree2f604c5cc0acbe83a10271054fd1d8c4662df50e
parent5838578751f7fc4b5725d6add48419e8e25d3aa9
afs: Copy local writes to the cache when writing to the server

When writing to the server from afs_writepage() or afs_writepages(), copy
the data to the cache object too.

To make this possible, the cookie must have its active users count
incremented when the page is dirtied and kept incremented until we manage
to clean up all the pages.  This allows the writeback to take place after
the last file struct is released.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: kafs-testing@auristor.com
Acked-by: Jeff Layton <jlayton@kernel.org>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/163819662333.215744.7531373404219224438.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163906970998.143852.674420788614608063.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163967176564.1823006.16666056085593949570.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164021570208.640689.9193494979708031862.stgit@warthog.procyon.org.uk/
fs/afs/file.c
fs/afs/inode.c
fs/afs/internal.h
fs/afs/super.c
fs/afs/write.c