]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fuse: cache btime
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 10 Aug 2023 10:45:05 +0000 (12:45 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 21 Aug 2023 10:14:59 +0000 (12:14 +0200)
commit972f4c46d0a1bb7fde3ce0bd15775855b2d02c68
tree04408bbb3e7e60b02f6b642cbc9c7b432336314e
parentd3045530bdd29d91033eea437d8a961f4ee598b5
fuse: cache btime

Not all inode attributes are supported by all filesystems, but for the
basic stats (which are returned by stat(2) and friends) all of them will
have some value, even if that doesn't reflect a real attribute of the file.

Btime is different, in that filesystems are free to report or not report a
value in statx.  If the value is available, then STATX_BTIME bit is set in
stx_mask.

When caching the value of btime, remember the availability of the attribute
as well as the value (if available).  This is done by using the
FUSE_I_BTIME bit in fuse_inode->state to indicate availability, while using
fuse_inode->inval_mask & STATX_BTIME to indicate the state of the cache
itself (i.e. set if cache is invalid, and cleared if cache is valid).

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/dir.c
fs/fuse/fuse_i.h
fs/fuse/inode.c
fs/fuse/readdir.c