]> xenbits.xensource.com Git - people/royger/freebsd.git/commit
fusefs: update atime on reads when using cached attributes
authorAlan Somers <asomers@FreeBSD.org>
Mon, 29 Nov 2021 01:53:31 +0000 (18:53 -0700)
committerAlan Somers <asomers@FreeBSD.org>
Mon, 29 Nov 2021 01:53:31 +0000 (18:53 -0700)
commit91972cfcddf950d7a9c33df5a9171ada1805a144
tree3e43bef60ba0fa81bac758a66939529b698e237f
parent65d70b3bae0c70798b0a2b8ed129bc146fed1cce
fusefs: update atime on reads when using cached attributes

When using cached attributes, whether or not the data cache is enabled,
fusefs must update a file's atime whenever it reads from it, so long as
it wasn't mounted with -o noatime.  Update it in-kernel, and flush it to
the server on close or during the next setattr operation.

The downside is that close() will now frequently trigger a FUSE_SETATTR
upcall.  But if you care about performance, you should be using
-o noatime anyway.

MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33145
12 files changed:
sys/fs/fuse/fuse_internal.c
sys/fs/fuse/fuse_io.c
sys/fs/fuse/fuse_node.c
sys/fs/fuse/fuse_node.h
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/cache.cc
tests/sys/fs/fusefs/io.cc
tests/sys/fs/fusefs/mockfs.cc
tests/sys/fs/fusefs/mockfs.hh
tests/sys/fs/fusefs/read.cc
tests/sys/fs/fusefs/utils.cc
tests/sys/fs/fusefs/utils.hh