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: Arnd Bergmann <arnd@arndb.de>, Dave Chinner <david@fromorbit.com>,
	"Theodore Ts'o" <tytso@mit.edu>,
	linux-kernel@vger.kernel.org, "Yan, Zheng" <zyan@redhat.com>,
	Sage Weil <sage@redhat.com>, Ilya Dryomov <idryomov@gmail.com>,
	ceph-devel@vger.kernel.org
Subject: [PATCH 08/10] fs: ceph: replace CURRENT_TIME by current_fs_time()
Date: Tue,  2 Feb 2016 22:07:48 -0800	[thread overview]
Message-ID: <1454479670-8204-9-git-send-email-deepa.kernel@gmail.com> (raw)
In-Reply-To: <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com>

CURRENT_TIME macro is not appropriate for filesystems as it
doesn't use the right granularity for filesystem timestamps.
Use current_fs_time() instead.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Sage Weil <sage@redhat.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: ceph-devel@vger.kernel.org
---
 fs/ceph/file.c  | 4 ++--
 fs/ceph/inode.c | 2 +-
 fs/ceph/xattr.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 86a9c38..9b338ff 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -783,7 +783,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,
 	int num_pages = 0;
 	int flags;
 	int ret;
-	struct timespec mtime = CURRENT_TIME;
+	struct timespec mtime = current_fs_time(inode->i_sb);
 	size_t count = iov_iter_count(iter);
 	loff_t pos = iocb->ki_pos;
 	bool write = iov_iter_rw(iter) == WRITE;
@@ -988,7 +988,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
 	int flags;
 	int check_caps = 0;
 	int ret;
-	struct timespec mtime = CURRENT_TIME;
+	struct timespec mtime = current_fs_time(inode->i_sb);
 	size_t count = iov_iter_count(from);
 
 	if (ceph_snap(file_inode(file)) != CEPH_NOSNAP)
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index fb4ba2e..63d0198 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1959,7 +1959,7 @@ int ceph_setattr(struct dentry *dentry, struct iattr *attr)
 	if (dirtied) {
 		inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied,
 							   &prealloc_cf);
-		inode->i_ctime = CURRENT_TIME;
+		inode->i_ctime = current_fs_time(inode->i_sb);
 	}
 
 	release &= issued;
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c
index 819163d..1e1c00a 100644
--- a/fs/ceph/xattr.c
+++ b/fs/ceph/xattr.c
@@ -999,7 +999,7 @@ retry:
 		dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL,
 					       &prealloc_cf);
 		ci->i_xattrs.dirty = true;
-		inode->i_ctime = CURRENT_TIME;
+		inode->i_ctime = current_fs_time(inode->i_sb);
 	}
 
 	spin_unlock(&ci->i_ceph_lock);
@@ -1136,7 +1136,7 @@ retry:
 	dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL,
 				       &prealloc_cf);
 	ci->i_xattrs.dirty = true;
-	inode->i_ctime = CURRENT_TIME;
+	inode->i_ctime = current_fs_time(inode->i_sb);
 	spin_unlock(&ci->i_ceph_lock);
 	if (lock_snap_rwsem)
 		up_read(&mdsc->snap_rwsem);
-- 
1.9.1

  parent reply	other threads:[~2016-02-03  6:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03  6:07 [PATCH 00/10] Remove CURRENT_TIME and CURRENT_TIME_SEC - PART 1 Deepa Dinamani
2016-02-03  6:07 ` [PATCH 01/10] fs: Add current_fs_time_sec() function Deepa Dinamani
2016-02-03  6:07 ` [PATCH 02/10] vfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani
2016-02-03  6:07 ` [PATCH 03/10] fs: cifs: Replace CURRENT_TIME with current_fs_time() Deepa Dinamani
2016-02-03  6:07 ` [PATCH 04/10] fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts() Deepa Dinamani
2016-02-03  6:07   ` Deepa Dinamani
2016-02-03  6:07 ` [PATCH 05/10] fs: cifs: Replace CURRENT_TIME by get_seconds Deepa Dinamani
2016-02-03  6:07 ` [PATCH 06/10] fs: ext4: Replace CURRENT_TIME_SEC with current_fs_time_sec() Deepa Dinamani
2016-02-03  6:07 ` [PATCH 07/10] fs: ext4: Replace CURRENT_TIME with ext4_current_time() Deepa Dinamani
2016-02-03  6:07 ` Deepa Dinamani [this message]
2016-02-03  6:22   ` [PATCH 08/10] fs: ceph: replace CURRENT_TIME by current_fs_time() Yan, Zheng
2016-02-03  6:22     ` Yan, Zheng
2016-02-03  6:07 ` [PATCH 09/10] fs: ceph: Replace CURRENT_TIME by ktime_get_real_ts() Deepa Dinamani
2016-02-03  6:07   ` Deepa Dinamani
2016-02-03 14:34   ` Yan, Zheng
2016-02-03 14:58     ` Ilya Dryomov
2016-02-03 16:17     ` Deepa Dinamani
2016-02-03 21:27       ` Arnd Bergmann
2016-02-04  2:00         ` Yan, Zheng
2016-02-04  2:00           ` Yan, Zheng
2016-02-04  8:30           ` Arnd Bergmann
2016-02-04  9:01             ` Ilya Dryomov
2016-02-04 13:31               ` Arnd Bergmann
2016-02-04 15:26                 ` Gregory Farnum
2016-02-04 21:02                   ` [Y2038] " Arnd Bergmann
2016-02-04 21:02                     ` Arnd Bergmann
2016-02-03  6:07 ` [PATCH 10/10] fs: btrfs: Replace CURRENT_TIME by current_fs_time() Deepa Dinamani
2016-02-04 14:14   ` David Sterba
2016-02-05 11:39     ` Deepa Dinamani
2016-02-07  7:57       ` [PATCH v2 " Deepa Dinamani
2016-02-08 15:08         ` David Sterba
2016-02-03 21:30 ` [Y2038] [PATCH 00/10] Remove CURRENT_TIME and CURRENT_TIME_SEC - PART 1 Arnd Bergmann
2016-02-04  4:56   ` 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=1454479670-8204-9-git-send-email-deepa.kernel@gmail.com \
    --to=deepa.kernel@gmail.com \
    --cc=arnd@arndb.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=david@fromorbit.com \
    --cc=idryomov@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sage@redhat.com \
    --cc=tytso@mit.edu \
    --cc=y2038@lists.linaro.org \
    --cc=zyan@redhat.com \
    /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.