HomeFreeBSD

Simplify time handling logic in zfs_settattr

Description

Simplify time handling logic in zfs_settattr

Simplify time handling in zfs_setattr by mimicking the logic in
setattr_copy from the linux kernel. In order to achieve this
in the case when ZFS' log is being replayed it is necessary
to unconditionally set the ctime in zfs_replay_setattr.

Also use the timespec_trunc function when assigning values to the
generic inode struct. This is currently a noop since zfs sets
s_time_gran to 1, however in the future rules about precision might
change.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Closes #4916

Details

Provenance
Nikolay Borisov <n.borisov.lkml@gmail.com>Authored on Sep 12 2016, 7:35 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 13 2016, 7:00 PM
Parents
rG9f5f0019ab3c: Refactor generic inode time updating
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG87f9371aefca: Simplify time handling logic in zfs_settattr (authored by Nikolay Borisov <n.borisov.lkml@gmail.com>).Sep 13 2016, 7:00 PM