linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: Kees Cook <keescook@chromium.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	y2038 Mailman List <y2038@lists.linaro.org>,
	anton@tuxera.com, Felipe Balbi <balbi@kernel.org>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	David Howells <dhowells@redhat.com>,
	David Sterba <dsterba@suse.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Christoph Hellwig <hch@lst.de>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Mike Marshall <hubcap@omnibond.com>, Jan Kara <jack@suse.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Jan Harkes <jaharkes@cs.cmu.edu>, Jiri Slaby <jslaby@suse.com>,
	Mark Fasheh <mark@fasheh.com>, Miklos Szeredi <miklos@szeredi.hu>,
	Nicolas Pitre <nico@linaro.org>,
	reiserfs-devel@vger.kernel.org,
	Richard Weinberger <richard@nod.at>, Sage Weil <sage@redhat.com>,
	Steve French <sfrench@samba.org>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Tejun Heo <tj@kernel.org>,
	Trond Myklebust <trond.myklebust@primarydata.com>,
	"Ted Ts'o" <tytso@mit.edu>
Subject: Re: [PATCH 6/6] vfs: change inode times to use struct timespec64
Date: Wed, 16 May 2018 21:13:05 -0400	[thread overview]
Message-ID: <CAK8P3a0d6j2KF+pSZQ5uM3jQ7=OZQXnc+ZjPb--52kdBV=k_vQ@mail.gmail.com> (raw)
In-Reply-To: <CABeXuvomY6EYxdPrbMymqBkw0fnYernvOhU0R9By0aKihHYTuA@mail.gmail.com>

On Mon, May 14, 2018 at 2:23 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> On Mon, May 14, 2018 at 10:53 AM, Kees Cook <keescook@chromium.org> wrote:
>> On Mon, May 14, 2018 at 10:25 AM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
>>> On Mon, May 14, 2018 at 9:30 AM, Kees Cook <keescook@chromium.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

      parent reply	other threads:[~2018-05-17  1:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-12  4:59 [PATCH 0/6] Transition vfs to 64-bit timestamps Deepa Dinamani
2018-05-12  4:59 ` [PATCH 1/6] fs: add timespec64_truncate() Deepa Dinamani
2018-05-12  4:59 ` [PATCH 2/6] lustre: Use long long type to print inode time Deepa Dinamani
2018-05-12  4:59 ` [PATCH 3/6] ceph: make inode time prints to be long long Deepa Dinamani
2018-05-12  4:59 ` [PATCH 4/6] fs: nfs: get rid of memcpys for inode times Deepa Dinamani
2018-05-12  4:59 ` [PATCH 5/6] udf: Simplify calls to udf_disk_stamp_to_time Deepa Dinamani
2018-05-14 13:57   ` Jan Kara
2018-05-15 17:48     ` Deepa Dinamani
2018-05-12  4:59 ` [PATCH 6/6] vfs: change inode times to use struct timespec64 Deepa Dinamani
2018-05-12  6:44   ` Kees Cook
2018-05-14  4:05     ` Deepa Dinamani
2018-05-14 16:30       ` Kees Cook
2018-05-14 17:25         ` Deepa Dinamani
2018-05-14 17:53           ` Kees Cook
2018-05-14 18:23             ` Deepa Dinamani
2018-05-14 18:28               ` Kees Cook
2018-05-17  1:13               ` Arnd Bergmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a0d6j2KF+pSZQ5uM3jQ7=OZQXnc+ZjPb--52kdBV=k_vQ@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=anton@tuxera.com \
    --cc=balbi@kernel.org \
    --cc=bfields@fieldses.org \
    --cc=darrick.wong@oracle.com \
    --cc=deepa.kernel@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dsterba@suse.com \
    --cc=dwmw2@infradead.org \
    --cc=hch@lst.de \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=hubcap@omnibond.com \
    --cc=jack@suse.com \
    --cc=jaegeuk@kernel.org \
    --cc=jaharkes@cs.cmu.edu \
    --cc=jslaby@suse.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=miklos@szeredi.hu \
    --cc=nico@linaro.org \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=sage@redhat.com \
    --cc=sfrench@samba.org \
    --cc=swhiteho@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=trond.myklebust@primarydata.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=y2038@lists.linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).