mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + fs-ocfs2-use-time64_t-to-represent-orphan-scan-times.patch added to -mm tree
@ 2016-11-30 23:06 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-11-30 23:06 UTC (permalink / raw)
  To: deepa.kernel, arnd, jiangqi903, jlbec, junxiao.bi, mfasheh, mm-commits


The patch titled
     Subject: ocfs2: use time64_t to represent orphan scan times
has been added to the -mm tree.  Its filename is
     fs-ocfs2-use-time64_t-to-represent-orphan-scan-times.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fs-ocfs2-use-time64_t-to-represent-orphan-scan-times.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/fs-ocfs2-use-time64_t-to-represent-orphan-scan-times.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Deepa Dinamani <deepa.kernel@gmail.com>
Subject: ocfs2: use time64_t to represent orphan scan times

struct timespec is not y2038 safe.  Use time64_t which is y2038 safe to
represent orphan scan times.  time64_t is sufficient here as only the
seconds delta times are relevant.

Also use appropriate time functions that return time in time64_t format. 
Time functions now return monotonic time instead of real time as only
delta scan times are relevant and these values are not persistent across
reboots.

The format string for the debug print is still using long as this is only
the time elapsed since the last scan and long is sufficient to represent
this value.

Link: http://lkml.kernel.org/r/1475365138-20567-1-git-send-email-deepa.kernel@gmail.com
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ocfs2/journal.c |    4 ++--
 fs/ocfs2/ocfs2.h   |    2 +-
 fs/ocfs2/super.c   |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff -puN fs/ocfs2/journal.c~fs-ocfs2-use-time64_t-to-represent-orphan-scan-times fs/ocfs2/journal.c
--- a/fs/ocfs2/journal.c~fs-ocfs2-use-time64_t-to-represent-orphan-scan-times
+++ a/fs/ocfs2/journal.c
@@ -1947,7 +1947,7 @@ static void ocfs2_queue_orphan_scan(stru
 	 */
 	seqno++;
 	os->os_count++;
-	os->os_scantime = CURRENT_TIME;
+	os->os_scantime = ktime_get_seconds();
 unlock:
 	ocfs2_orphan_scan_unlock(osb, seqno);
 out:
@@ -2004,7 +2004,7 @@ void ocfs2_orphan_scan_start(struct ocfs
 	struct ocfs2_orphan_scan *os;
 
 	os = &osb->osb_orphan_scan;
-	os->os_scantime = CURRENT_TIME;
+	os->os_scantime = ktime_get_seconds();
 	if (ocfs2_is_hard_readonly(osb) || ocfs2_mount_local(osb))
 		atomic_set(&os->os_state, ORPHAN_SCAN_INACTIVE);
 	else {
diff -puN fs/ocfs2/ocfs2.h~fs-ocfs2-use-time64_t-to-represent-orphan-scan-times fs/ocfs2/ocfs2.h
--- a/fs/ocfs2/ocfs2.h~fs-ocfs2-use-time64_t-to-represent-orphan-scan-times
+++ a/fs/ocfs2/ocfs2.h
@@ -224,7 +224,7 @@ struct ocfs2_orphan_scan {
 	struct ocfs2_super 	*os_osb;
 	struct ocfs2_lock_res 	os_lockres;     /* lock to synchronize scans */
 	struct delayed_work 	os_orphan_scan_work;
-	struct timespec		os_scantime;  /* time this node ran the scan */
+	time64_t		os_scantime;  /* time this node ran the scan */
 	u32			os_count;      /* tracks node specific scans */
 	u32  			os_seqno;       /* tracks cluster wide scans */
 	atomic_t		os_state;              /* ACTIVE or INACTIVE */
diff -puN fs/ocfs2/super.c~fs-ocfs2-use-time64_t-to-represent-orphan-scan-times fs/ocfs2/super.c
--- a/fs/ocfs2/super.c~fs-ocfs2-use-time64_t-to-represent-orphan-scan-times
+++ a/fs/ocfs2/super.c
@@ -337,7 +337,7 @@ static int ocfs2_osb_dump(struct ocfs2_s
 		out += snprintf(buf + out, len - out, "Disabled\n");
 	else
 		out += snprintf(buf + out, len - out, "%lu seconds ago\n",
-				(get_seconds() - os->os_scantime.tv_sec));
+				(unsigned long)(ktime_get_seconds() - os->os_scantime));
 
 	out += snprintf(buf + out, len - out, "%10s => %3s  %10s\n",
 			"Slots", "Num", "RecoGen");
_

Patches currently in -mm which might be from deepa.kernel@gmail.com are

fs-ocfs2-use-time64_t-to-represent-orphan-scan-times.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-30 23:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-30 23:06 + fs-ocfs2-use-time64_t-to-represent-orphan-scan-times.patch added to -mm tree akpm

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).