]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: Add timestamp_truncate() api
authorDeepa Dinamani <deepa.kernel@gmail.com>
Mon, 22 Jan 2018 02:04:25 +0000 (18:04 -0800)
committerDeepa Dinamani <deepa.kernel@gmail.com>
Fri, 30 Aug 2019 14:27:17 +0000 (07:27 -0700)
commita2eb9ce7ae7342c67ca513dd287b5857f1226ebd
treefd820b8e8992477f3fa474f152358ed8c09247fd
parent2bdb814a0d19e3ced5352b046b0a60f4335b31a4
vfs: Add timestamp_truncate() api

timespec_trunc() function is used to truncate a
filesystem timestamp to the right granularity.
But, the function does not clamp tv_sec part of the
timestamps according to the filesystem timestamp limits.

The replacement api: timestamp_truncate() also alters the
signature of the function to accommodate filesystem
timestamp clamping according to flesystem limits.

Note that the tv_nsec part is set to 0 if tv_sec is not within
the range supported for the filesystem.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
fs/inode.c
include/linux/fs.h