From: Deepa Dinamani <deepa.kernel@gmail.com>
To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org
Cc: Arnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org
Subject: [PATCH 0/8] Remove CURRENT_TIME and CURRENT_TIME_SEC - PART 2
Date: Mon, 22 Feb 2016 07:17:46 -0800 [thread overview]
Message-ID: <1456154274-30487-1-git-send-email-deepa.kernel@gmail.com> (raw)
Introduction
This patch series is aimed at getting rid of CURRENT_TIME and CURRENT_TIME_SEC
macros.
The idea for the series evolved from my discussions with Arnd Bergmann.
This was originally part of the RFC series[2]:
https://lkml.org/lkml/2016/1/7/20 (under discussion).
Dave Chinner suggested moving bug fixes out of the feature series to keep the
original series simple.
There are 354 occurrences of the the above macros in the kernel.
The series will be divided into 4 or 5 parts to keep the parts manageable
and so that each part could be reviewed and merged independently.
This is part 2 of the series.
Motivation
The macros: CURRENT_TIME and CURRENT_TIME_SEC are primarily used for
filesystem timestamps.
But, they are not accurate as they do not perform clamping according to
filesystem timestamps ranges, nor do they truncate the nanoseconds value
to the granularity as required by the filesystem.
The series is also viewed as an ancillary to another upcoming series[2]
that attempts to transition file system timestamps to use 64 bit time to
make these y2038 safe.
There will also be another series[3] to add range checks and clamping to
filesystem time functions that are meant to substitute the above macros.
Solution
CURRENT_TIME macro has an equivalent function:
struct timespec current_fs_time(struct super_block *sb)
These will be the changes to the above function:
1. Function will return the type y2038 safe timespec64 in [2].
2. Function will use y2038 safe 64 bit functions in [2].
3. Function will be extended to perform range checks in [3].
A new function will be added to substitute for CURRENT_TIME_SEC macro
in the current series:
struct timespec current_fs_time_sec(struct super_block *sb)
These will be the changes to the above function:
1. Function will return the type y2038 safe timespec64 in [2].
2. Function will use y2038 safe 64 bit functions in [2].
3. Function will be extended to perform range checks in [3].
Any use of these macros outside of filesystem timestamps will
be replaced by function calls to appropriate time functions.
Deepa Dinamani (8):
fs: debugfs: Replace CURRENT_TIME by current_fs_time()
fs: logfs: Replace CURRENT_TIME by current_fs_time()
fs: devpts: Replace CURRENT_TIME by current_fs_time()
fs: configfs: Replace CURRENT_TIME by current_fs_time()
fs: proc: Replace CURRENT_TIME by current_fs_time()
fs: ramfs: Replace CURRENT_TIME by current_fs_time()
fs: kernfs: Replace CURRENT_TIME by current_fs_time()
net: sunrpc: Replace CURRENT_TIME by current_fs_time()
fs/configfs/inode.c | 8 +++++---
fs/debugfs/inode.c | 3 ++-
fs/devpts/inode.c | 9 ++++++---
fs/kernfs/dir.c | 8 +++++---
fs/kernfs/inode.c | 15 ++++++++++-----
fs/logfs/dir.c | 11 +++++++----
fs/logfs/file.c | 2 +-
fs/logfs/inode.c | 3 +--
fs/logfs/readwrite.c | 7 ++++---
fs/proc/base.c | 3 ++-
fs/proc/inode.c | 6 ++++--
fs/proc/proc_sysctl.c | 3 ++-
fs/proc/self.c | 3 ++-
fs/proc/thread_self.c | 3 ++-
fs/ramfs/inode.c | 13 ++++++++-----
net/sunrpc/rpc_pipe.c | 4 +++-
16 files changed, 64 insertions(+), 37 deletions(-)
--
1.9.1
next reply other threads:[~2016-02-22 15:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 15:17 Deepa Dinamani [this message]
2016-02-22 15:17 ` [PATCH 1/8] fs: debugfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani
2016-02-22 15:17 ` [PATCH 2/8] fs: logfs: " Deepa Dinamani
2016-02-22 15:17 ` [PATCH 3/8] fs: devpts: " Deepa Dinamani
2016-02-22 15:17 ` [PATCH 4/8] fs: configfs: " Deepa Dinamani
2016-02-24 9:02 ` Joel Becker
2016-02-26 9:45 ` stoph Hellwig
2016-02-22 15:17 ` [PATCH 5/8] fs: proc: " Deepa Dinamani
2016-02-22 15:17 ` [PATCH 6/8] fs: ramfs: " Deepa Dinamani
2016-02-22 15:17 ` [PATCH 7/8] fs: kernfs: " Deepa Dinamani
2016-02-22 15:17 ` [PATCH 8/8] net: sunrpc: " Deepa Dinamani
2016-02-22 15:34 ` Trond Myklebust
2016-02-22 15:47 ` Deepa Dinamani
2016-02-24 15:08 ` [Y2038] " Arnd Bergmann
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=1456154274-30487-1-git-send-email-deepa.kernel@gmail.com \
--to=deepa.kernel@gmail.com \
--cc=arnd@arndb.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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).