From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f196.google.com ([209.85.220.196]:40762 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751312AbeEQBNH (ORCPT ); Wed, 16 May 2018 21:13:07 -0400 MIME-Version: 1.0 In-Reply-To: References: <20180512045921.18311-1-deepa.kernel@gmail.com> <20180512045921.18311-7-deepa.kernel@gmail.com> From: Arnd Bergmann Date: Wed, 16 May 2018 21:13:05 -0400 Message-ID: Subject: Re: [PATCH 6/6] vfs: change inode times to use struct timespec64 To: Deepa Dinamani Cc: Kees Cook , Al Viro , Thomas Gleixner , LKML , "linux-fsdevel@vger.kernel.org" , y2038 Mailman List , anton@tuxera.com, Felipe Balbi , "J. Bruce Fields" , "Darrick J. Wong" , David Howells , David Sterba , David Woodhouse , Christoph Hellwig , OGAWA Hirofumi , Mike Marshall , Jan Kara , Jaegeuk Kim , Jan Harkes , Jiri Slaby , Mark Fasheh , Miklos Szeredi , Nicolas Pitre , reiserfs-devel@vger.kernel.org, Richard Weinberger , Sage Weil , Steve French , Steven Whitehouse , Tejun Heo , Trond Myklebust , "Ted Ts'o" Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, May 14, 2018 at 2:23 PM, Deepa Dinamani wrote: > On Mon, May 14, 2018 at 10:53 AM, Kees Cook wrote: >> On Mon, May 14, 2018 at 10:25 AM, Deepa Dinamani wrote: >>> On Mon, May 14, 2018 at 9:30 AM, Kees Cook wrote: >> >> Can we do something like: >> >> #if __BITS_PER_LONG == 64 >> # define TVSEC_FMT "%ld" >> #else >> # define TVSEC_FMT "%lld" >> #endif >> >> so we can do stuff like: sprintf(buf, "seconds: " KTIME_FMT, time->tv_sec) >> >> ? It seems easier to clean up than casts. > > We have already introduced these casts in many places now. > It would be easier to do the clean up if they all follow a similar > pattern. ( I could probably write a coccinelle script that is not very > long). > But, it would be not much trouble if you wanted to follow this for pstore. > > We also contemplated adding a format specifier for time. But, I think > we deferred it until we have a uniform way of using time internally. I have recently submitted a patch to completely remove the hack that leads to 'timespec64' and 'timespec' being aliases for the same type on 64-bit architectures. Once that goes in, we can just remove the type casts that got added over time, and won't need a format macro. Arnd