summaryrefslogtreecommitdiff
path: root/libdiskfs/opts-common.c
diff options
context:
space:
mode:
authorRyan Jeffrey <ryan@ryanmj.xyz>2020-09-30 21:19:52 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-09-30 21:26:09 +0200
commitda5b44eaf131c748caeedf59b3dc9e42b94c82f0 (patch)
tree12de42e27672510e59aa91100331c458ea3d135e /libdiskfs/opts-common.c
parent88d7363db23f8dba06ed260e10b5c7f40538565c (diff)
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.
Diffstat (limited to 'libdiskfs/opts-common.c')
-rw-r--r--libdiskfs/opts-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libdiskfs/opts-common.c b/libdiskfs/opts-common.c
index d37c2868..841f13c3 100644
--- a/libdiskfs/opts-common.c
+++ b/libdiskfs/opts-common.c
@@ -47,6 +47,7 @@ const struct argp_option diskfs_common_options[] =
"Do not update file access times on disk for reads"},
{"noatime", 0, 0, OPTION_ALIAS | OPTION_HIDDEN},
{"atime", OPT_ATIME, 0, 0, "Do update file access times for reads normally"},
+ {"strictatime", 0, 0, OPTION_ALIAS | OPTION_HIDDEN},
{"no-inherit-dir-group", OPT_NO_INHERIT_DIR_GROUP, 0, 0,
"Create new nodes with gid of the process"},
{"nogrpid", 0, 0, OPTION_ALIAS | OPTION_HIDDEN},
@@ -55,5 +56,8 @@ const struct argp_option diskfs_common_options[] =
"Create new nodes with gid of parent dir (default)"},
{"grpid", 0, 0, OPTION_ALIAS | OPTION_HIDDEN},
{"bsdgroups", 0, 0, OPTION_ALIAS | OPTION_HIDDEN},
+ {"relatime", 'R', 0, 0,
+ "Only update access times once daily or if older than change time "
+ "or modification time."},
{0, 0}
};