diff options
author | Tim Chase <[email protected]> | 2014-01-18 13:00:53 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-01-29 15:50:44 -0800 |
commit | 6d111134c0d1eb9b179eb9fddf26a31d5d45ae22 (patch) | |
tree | 58b2ef03d95ddcc6721574651ea223e7150c1763 /lib | |
parent | 2278381ce2a820afe76dd9650298858d7037a01b (diff) |
Implement relatime.
Add the "relatime" property. When set to "on", a file's atime will only
be updated if the existing atime at least a day old or if the existing
ctime or mtime has been updated since the last access. This behavior
is compatible with the Linux "relatime" mount option.
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2064
Closes #1917
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 0acfa7923..e517e06bc 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1421,6 +1421,7 @@ zfs_is_namespace_prop(zfs_prop_t prop) switch (prop) { case ZFS_PROP_ATIME: + case ZFS_PROP_RELATIME: case ZFS_PROP_DEVICES: case ZFS_PROP_EXEC: case ZFS_PROP_SETUID: @@ -1756,6 +1757,11 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, mntopt_off = MNTOPT_NOATIME; break; + case ZFS_PROP_RELATIME: + mntopt_on = MNTOPT_RELATIME; + mntopt_off = MNTOPT_NORELATIME; + break; + case ZFS_PROP_DEVICES: mntopt_on = MNTOPT_DEVICES; mntopt_off = MNTOPT_NODEVICES; @@ -1816,6 +1822,7 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src, switch (prop) { case ZFS_PROP_ATIME: + case ZFS_PROP_RELATIME: case ZFS_PROP_DEVICES: case ZFS_PROP_EXEC: case ZFS_PROP_READONLY: |