From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751928AbcBLJmn (ORCPT ); Fri, 12 Feb 2016 04:42:43 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:36547 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751027AbcBLJga (ORCPT ); Fri, 12 Feb 2016 04:36:30 -0500 From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: Arnd Bergmann , Dave Chinner , "Theodore Ts'o" , linux-kernel@vger.kernel.org Subject: [RFC v2a 01/12] vfs: Add vfs_time abstractions Date: Fri, 12 Feb 2016 01:35:55 -0800 Message-Id: <1455269766-2994-2-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455269766-2994-1-git-send-email-deepa.kernel@gmail.com> References: <20160212092153.GA2368@deepa-ubuntu> <1455269766-2994-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add vfs_time aliases to help convert vfs timestamps to use 64 bit times. These create an abstraction layer so that vfs inode times can be switched to use struct timespec64 instead of struct timespec. Use uapi exposed data types, timespec and timespec64 here to keep minimal timestamp data type conversions in API's interfacing with vfs. Signed-off-by: Deepa Dinamani --- include/linux/fs.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 4af612f..ec25603 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1412,6 +1412,25 @@ static inline struct timespec current_fs_time_sec(struct super_block *sb) return (struct timespec) { get_seconds(), 0 }; } +/* Place holder defines until it is safe to use timespec64 + * in the vfs layer. + * timespec64 data type and functions will be used at that + * time directly by all filesystems and these defines will be deleted. + */ +#define vfs_time timespec + +#define vfs_time_compare timespec_compare +#define vfs_time_equal timespec_equal +#define vfs_time_add timespec_add + +/* This returns current time in a timespec/seconds format to match vfs + * timestamp data type. + * This is for timestamps that use the same functions + * as vfs_time but have nothing to do with inode timestamps. + */ +#define vfs_get_real_ts ktime_get_real_ts +#define vfs_get_real_seconds get_seconds + /* * Snapshotting support. */ -- 1.9.1