From da5b44eaf131c748caeedf59b3dc9e42b94c82f0 Mon Sep 17 00:00:00 2001 From: Ryan Jeffrey Date: Wed, 30 Sep 2020 21:19:52 +0200 Subject: libdiskfs: Add relatime support * doc/hurd.texi (diskfs_set_node_atime): Document relatime behavior. * libdiskfs/diskfs.h (diskfs_set_node_atime): Likewise. * libdiskfs/init-init.c (_diskfs_relatime): Add variable. * libdiskfs/file-statfs.c (ST_RELATIME): Define if not defined already. (diskfs_S_file_statfs): Report ST_RELATIME when _diskfs_relatime is set. * libdiskfs/node-times.c (atime_should_update): New function. (diskfs_set_node_atime): Document relatime behavior. Call atime_should_update instead of reading _diskfs_noatime. * libdiskfs/opts-common.c (diskfs_common_options): Add --strictatime and -R/--relatime options. * libdiskfs/opts-std-runtime.c (struct parse_hook): Add relatime field. (set_opts): Set _diskfs_relatime from relatime field. (parse_opt): Parse -R option. * libdiskfs/opts-std-startup.c (parse_startup_opt): Parse -R option. * libdiskfs/priv.h (_diskfs_relatime): Declare variable. (atime_should_update): Declare function. * libdiskfs/opts-append-std.c (diskfs_append_std_options): Add reporting --relatime option. * libdiskfs/conch-fetch.c (iohelp_fetch_shared_data): Call atime_should_update instead of reading _diskfs_noatime. * libdiskfs/rdwr-internal.c (_diskfs_rdwr_internal): Likewise. --- libdiskfs/file-statfs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libdiskfs/file-statfs.c') diff --git a/libdiskfs/file-statfs.c b/libdiskfs/file-statfs.c index c9fd6f1b..3cc60b4f 100644 --- a/libdiskfs/file-statfs.c +++ b/libdiskfs/file-statfs.c @@ -21,6 +21,10 @@ #include "priv.h" #include "fs_S.h" +#ifndef ST_RELATIME +# define ST_RELATIME 64 +#endif /* ST_RELATIME */ + /* Implement file_getcontrol as described in . */ kern_return_t diskfs_S_file_statfs (struct protid *file, @@ -43,6 +47,8 @@ diskfs_S_file_statfs (struct protid *file, statbuf->f_flag |= ST_SYNCHRONOUS; if (_diskfs_noatime) statbuf->f_flag |= ST_NOATIME; + else if (_diskfs_relatime) + statbuf->f_flag |= ST_RELATIME; diskfs_set_statfs (statbuf); -- cgit v1.2.3