lkml.org 
[lkml]   [2016]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [GIT PULL] y2038 changes for vfs
From
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

\
 
 \ /
  Last update: 2016-05-25 01:01    [W:2.829 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site