]> git.proxmox.com Git - mirror_zfs.git/commit - module/zfs/zfs_vnops.c
Simplify time handling logic in zfs_settattr
authorNikolay Borisov <n.borisov.lkml@gmail.com>
Mon, 12 Sep 2016 19:35:56 +0000 (22:35 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 13 Sep 2016 19:00:18 +0000 (12:00 -0700)
commit87f9371aefca857e7091dfdee3ec2d36b0de54c4
tree8769eb3e29dd3fa77ca59e4552201f8e4ab1f355
parent9f5f0019ab3c03f59060d752b0be69290ec1abb9
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
module/zfs/zfs_replay.c
module/zfs/zfs_vnops.c
module/zfs/zpl_inode.c