summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2018-01-22 05:04:25 +0300
committerDeepa Dinamani <deepa.kernel@gmail.com>2019-08-30 17:27:17 +0300
commit50e17c000c467fbc927fc001df99beb4027a5323 (patch)
treefd820b8e8992477f3fa474f152358ed8c09247fd /include
parent188d20bcd1ebd8277d9b8a79525bd66b66d40a2a (diff)
downloadlinux-50e17c000c467fbc927fc001df99beb4027a5323.tar.xz
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4b349851b00c..7e6be3bf0ce0 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -726,6 +726,8 @@ struct inode {
void *i_private; /* fs or device private pointer */
} __randomize_layout;
+struct timespec64 timestamp_truncate(struct timespec64 t, struct inode *inode);
+
static inline unsigned int i_blocksize(const struct inode *node)
{
return (1 << node->i_blkbits);