All of lore.kernel.org
 help / color / mirror / Atom feed
From: Deepa Dinamani <deepa.kernel@gmail.com>
To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org
Cc: tglx@linutronix.de, arnd@arndb.de, viro@zeniv.linux.org.uk
Subject: [PATCH 1/2] fs: Add current_fs_time_sec() function
Date: Fri,  8 Apr 2016 08:47:10 -0700	[thread overview]
Message-ID: <1460130431-7865-2-git-send-email-deepa.kernel@gmail.com> (raw)
In-Reply-To: <1460130431-7865-1-git-send-email-deepa.kernel@gmail.com>

This is in preparation for the series that transitions
filesystem timestamps to use 64 bit time and hence make
them y2038 safe.

The function is meant to replace CURRENT_TIME_SEC macro.
The macro CURRENT_TIME_SEC does not represent filesystem times
correctly as it cannot perform range checks.
current_fs_time_sec() will be extended to include these.

CURRENT_TIME_SEC is also not y2038 safe. current_fs_time_sec()
will be transitioned to use 64 bit time along with vfs in a
separate series.

The function is inline for now to maintain similar performance
to that of the macro.

The function takes super block as a parameter to allow for
future range checking of filesystem timestamps.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/fs.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index e3c0b7e..fc09058 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1435,6 +1435,11 @@ struct super_block {
 
 extern struct timespec current_fs_time(struct super_block *sb);
 
+static inline struct timespec current_fs_time_sec(struct super_block *sb)
+{
+	return (struct timespec) { get_seconds(), 0 };
+}
+
 /*
  * Snapshotting support.
  */
-- 
1.9.1


  reply	other threads:[~2016-04-08 15:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 15:47 [PATCH 0/2] Add infrastructure to support vfs 64 bit timestamps Deepa Dinamani
2016-04-08 15:47 ` Deepa Dinamani [this message]
2016-04-09  1:16   ` [PATCH 1/2] fs: Add current_fs_time_sec() function Arnd Bergmann
2016-04-08 15:47 ` [PATCH 2/2] vfs: Add vfs_time accessors Deepa Dinamani
2016-04-09  1:17   ` Arnd Bergmann
2016-04-08 15:49 ` [PATCH 0/2] Add infrastructure to support vfs 64 bit timestamps Thomas Gleixner
2016-04-17 22:39   ` [Y2038] " Arnd Bergmann
2016-04-26 16:15   ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2016-03-02 15:31 [PATCH 0/2] Add infrastructure to support vfs 64 bit times Deepa Dinamani
2016-03-02 15:31 ` [PATCH 1/2] fs: Add current_fs_time_sec() function Deepa Dinamani

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=1460130431-7865-2-git-send-email-deepa.kernel@gmail.com \
    --to=deepa.kernel@gmail.com \
    --cc=arnd@arndb.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.