cachefiles: Implement a function to get/create a directory in the cache
authorDavid Howells <dhowells@redhat.com>
Thu, 21 Oct 2021 07:34:55 +0000 (08:34 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 7 Jan 2022 13:41:40 +0000 (13:41 +0000)
commit32759f7d7af5454c616574190c388e1a59184f92
tree051ba39a7244f8d091e59f7010902db06b9382f6
parent1bd9c4e4f0494915b2391f373d25096579f835ff
cachefiles: Implement a function to get/create a directory in the cache

Implement a function to get/create structural directories in the cache.
This is used for setting up a cache and creating volume substructures.  The
directory in memory are marked with the S_KERNEL_FILE inode flag whilst
they're in use to tell rmdir to reject attempts to remove them.

Changes
=======
ver #3:
 - Return an indication as to whether the directory was freshly created.

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/163819631182.215744.3322471539523262619.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163906933130.143852.962088616746509062.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/163967141952.1823006.7832985646370603833.stgit@warthog.procyon.org.uk/
Link: https://lore.kernel.org/r/164021542169.640689.18266858945694357839.stgit@warthog.procyon.org.uk/
fs/cachefiles/internal.h
fs/cachefiles/namei.c