diff options
author | Ryan Jeffrey <ryan@ryanmj.xyz> | 2020-09-30 21:19:52 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-09-30 21:26:09 +0200 |
commit | da5b44eaf131c748caeedf59b3dc9e42b94c82f0 (patch) | |
tree | 12de42e27672510e59aa91100331c458ea3d135e /libdiskfs/diskfs.h | |
parent | 88d7363db23f8dba06ed260e10b5c7f40538565c (diff) | |
download | hurd-da5b44eaf131c748caeedf59b3dc9e42b94c82f0.tar.gz hurd-da5b44eaf131c748caeedf59b3dc9e42b94c82f0.tar.bz2 hurd-da5b44eaf131c748caeedf59b3dc9e42b94c82f0.zip |
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/diskfs.h')
-rw-r--r-- | libdiskfs/diskfs.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index dfccf880..2390c64d 100644 --- a/libdiskfs/diskfs.h +++ b/libdiskfs/diskfs.h @@ -1046,7 +1046,9 @@ error_t diskfs_init_dir (struct node *dp, struct node *pdp, struct protid *cred); /* If disk is not readonly and the noatime option is not enabled, set - NP->dn_set_atime. */ + NP->dn_set_atime. If relatime is enabled, only set NP->dn_set_atime + if the atime has not been updated today, or if ctime or mtime are + more recent than atime */ void diskfs_set_node_atime (struct node *np); /* If NP->dn_set_ctime is set, then modify NP->dn_stat.st_ctim |