Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406499

Re: [GIT PULL] y2038 changes for vfs

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [GIT PULL] y2038 changes for vfs
Date 2016-05-25 00:50 +0200
Message-ID <rCtjc-Ur-23@gated-at.bofh.it> (permalink)
References <rCqY1-7Zt-7@gated-at.bofh.it> <rCsZQ-NP-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, May 24, 2016 at 3:23 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> Just as an example: code that does
>
>         dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC;
>
> could pretty mechanically be converted to
>
>         dir->i_mtime = dir->i_ctime = current_fs_time(sb);

Actually, looking at the users, most of them don't have the superblock
directly as a variable, so it might be better to just make
current_fs_time() take the inode pointer instead.

That would make the conversion simpler, and it can then do the
inode->i_sb thing when it is converted to actually take the filesystem
limits and time granularity into account.

I suspect you could do 95% with a fairly simply coccinelle script. Or
even just use 'sed', with something like

  sed 's/\([a-z]*\)->i_\([amc]\)time = CURRENT_TIME_SEC/\1->i_\2time =
current_fs_time(\1)/'

seems to get close.

Run that over the tree, fix up the few cases it doesn't catch, remove
the broken CURRENT_TIME_SEC thing, and voilá, you're pretty much done.

No?

                  Linus

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL] y2038 changes for vfs Arnd Bergmann <arnd@arndb.de> - 2016-05-24 22:20 +0200
  Re: [GIT PULL] y2038 changes for vfs Linus Torvalds <torvalds@linux-foundation.org> - 2016-05-25 00:30 +0200
    Re: [GIT PULL] y2038 changes for vfs Linus Torvalds <torvalds@linux-foundation.org> - 2016-05-25 00:50 +0200
      Re: [GIT PULL] y2038 changes for vfs Deepa Dinamani <deepa.kernel@gmail.com> - 2016-05-25 02:20 +0200
    Re: [GIT PULL] y2038 changes for vfs Arnd Bergmann <arnd@arndb.de> - 2016-05-25 18:10 +0200
      Re: [GIT PULL] y2038 changes for vfs Dave Chinner <david@fromorbit.com> - 2016-05-25 23:40 +0200

csiph-web