[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a0d6j2KF+pSZQ5uM3jQ7=OZQXnc+ZjPb--52kdBV=k_vQ@mail.gmail.com>
Date: Wed, 16 May 2018 21:13:05 -0400
From: Arnd Bergmann <arnd@...db.de>
To: Deepa Dinamani <deepa.kernel@...il.com>
Cc: Kees Cook <keescook@...omium.org>,
Al Viro <viro@...iv.linux.org.uk>,
Thomas Gleixner <tglx@...utronix.de>,
LKML <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
y2038 Mailman List <y2038@...ts.linaro.org>,
anton@...era.com, Felipe Balbi <balbi@...nel.org>,
"J. Bruce Fields" <bfields@...ldses.org>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
David Howells <dhowells@...hat.com>,
David Sterba <dsterba@...e.com>,
David Woodhouse <dwmw2@...radead.org>,
Christoph Hellwig <hch@....de>,
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
Mike Marshall <hubcap@...ibond.com>, Jan Kara <jack@...e.com>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Jan Harkes <jaharkes@...cmu.edu>, Jiri Slaby <jslaby@...e.com>,
Mark Fasheh <mark@...heh.com>,
Miklos Szeredi <miklos@...redi.hu>,
Nicolas Pitre <nico@...aro.org>,
reiserfs-devel@...r.kernel.org,
Richard Weinberger <richard@....at>,
Sage Weil <sage@...hat.com>, Steve French <sfrench@...ba.org>,
Steven Whitehouse <swhiteho@...hat.com>,
Tejun Heo <tj@...nel.org>,
Trond Myklebust <trond.myklebust@...marydata.com>,
"Ted Ts'o" <tytso@....edu>
Subject: Re: [PATCH 6/6] vfs: change inode times to use struct timespec64
On Mon, May 14, 2018 at 2:23 PM, Deepa Dinamani <deepa.kernel@...il.com> wrote:
> On Mon, May 14, 2018 at 10:53 AM, Kees Cook <keescook@...omium.org> wrote:
>> On Mon, May 14, 2018 at 10:25 AM, Deepa Dinamani <deepa.kernel@...il.com> wrote:
>>> On Mon, May 14, 2018 at 9:30 AM, Kees Cook <keescook@...omium.org> 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
Powered by blists - more mailing lists