Centos-kernel-stream-9/fs/cachefiles
Jeffrey Layton 10e10b9ba6 cachefiles: Implement backing file wrangling
Bugzilla: http://bugzilla.redhat.com/1229736

commit 1f08c925e7a38002bde509e66f6f891468848511
Author: David Howells <dhowells@redhat.com>
Date:   Thu Oct 21 08:50:10 2021 +0100

    cachefiles: Implement backing file wrangling

    Implement the wrangling of backing files, including the following pieces:

     (1) Lookup and creation of a file on disk, using a tmpfile if the file
         isn't yet present.  The file is then opened, sized for DIO and the
         file handle is attached to the cachefiles_object struct.  The inode is
         marked to indicate that it's in use by a kernel service.

     (2) Invalidation of an object, creating a tmpfile and switching the file
         pointer in the cachefiles object.

     (3) Committing a file to disk, including setting the coherency xattr on it
         and, if necessary, creating a hard link to it.

         Note that this would be a good place to use Omar Sandoval's vfs_link()
         with AT_LINK_REPLACE[1] as I may have to unlink an old file before I
         can link a tmpfile into place.

     (4) Withdrawal of open objects when a cache is being withdrawn or a cookie
         is relinquished.  This involves committing or discarding the file.

    Changes
    =======
    ver #2:
     - Fix logging of wrong error[1].

    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/20211203094950.GA2480@kili/ [1]
    Link: https://lore.kernel.org/r/163819644097.215744.4505389616742411239.stgit@warthog.procyon.org.uk/ # v1
    Link: https://lore.kernel.org/r/163906949512.143852.14222856795032602080.stgit@warthog.procyon.org.uk/ # v2
    Link: https://lore.kernel.org/r/163967158526.1823006.17482695321424642675.stgit@warthog.procyon.org.uk/ # v3
    Link: https://lore.kernel.org/r/164021557060.640689.16373541458119269871.stgit@warthog.procyon.org.uk/ # v4

Signed-off-by: Jeffrey Layton <jlayton@redhat.com>
2022-08-22 12:31:36 -04:00
..
Kconfig cachefiles: Add some error injection support 2022-08-22 12:31:34 -04:00
Makefile cachefiles: Implement metadata/coherency data storage in xattrs 2022-08-22 12:31:35 -04:00
cache.c cachefiles: Implement backing file wrangling 2022-08-22 12:31:36 -04:00
daemon.c cachefiles: Implement backing file wrangling 2022-08-22 12:31:36 -04:00
error_inject.c cachefiles: Add some error injection support 2022-08-22 12:31:34 -04:00
interface.c cachefiles: Implement backing file wrangling 2022-08-22 12:31:36 -04:00
internal.h cachefiles: Implement backing file wrangling 2022-08-22 12:31:36 -04:00
key.c cachefiles: Implement key to filename encoding 2022-08-22 12:31:35 -04:00
main.c cachefiles: Implement object lifecycle funcs 2022-08-22 12:31:35 -04:00
namei.c cachefiles: Implement backing file wrangling 2022-08-22 12:31:36 -04:00
security.c cachefiles: Add security derivation 2022-08-22 12:31:35 -04:00
volume.c cachefiles: Implement volume support 2022-08-22 12:31:35 -04:00
xattr.c cachefiles: Implement metadata/coherency data storage in xattrs 2022-08-22 12:31:35 -04:00