Message ID | 1456932710-10926-2-git-send-email-deepa.kernel@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wednesday 02 March 2016 07:31:49 Deepa Dinamani wrote: > This is in preparation for the series that transitions > filesystem timestamps to use 64 bit time and hence make > them y2038 safe. > > The function is meant to replace CURRENT_TIME_SEC macro. > The macro CURRENT_TIME_SEC does not represent filesystem times > correctly as it cannot perform range checks. > current_fs_time_sec() will be extended to include these. > > CURRENT_TIME_SEC is also not y2038 safe. current_fs_time_sec() > will be transitioned to use 64 bit time along with vfs in a > separate series. > > The function is inline for now to maintain similar performance > to that of the macro. > > The function takes super block as a parameter to allow for > future range checking of filesystem timestamps. > > Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> > Acked-by: Arnd Bergmann <arnd@arndb.de> -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1af4727..e0b29d4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1404,6 +1404,11 @@ struct super_block { extern struct timespec current_fs_time(struct super_block *sb); +static inline struct timespec current_fs_time_sec(struct super_block *sb) +{ + return (struct timespec) { get_seconds(), 0 }; +} + /* * Snapshotting support. */
This is in preparation for the series that transitions filesystem timestamps to use 64 bit time and hence make them y2038 safe. The function is meant to replace CURRENT_TIME_SEC macro. The macro CURRENT_TIME_SEC does not represent filesystem times correctly as it cannot perform range checks. current_fs_time_sec() will be extended to include these. CURRENT_TIME_SEC is also not y2038 safe. current_fs_time_sec() will be transitioned to use 64 bit time along with vfs in a separate series. The function is inline for now to maintain similar performance to that of the macro. The function takes super block as a parameter to allow for future range checking of filesystem timestamps. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> --- include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+)