public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, torvalds@linux-foundation.org, tytso@mit.edu,
	viro@zeniv.linux.org.uk, y2038@lists.linaro.org,
	Artem Bityutskiy <dedekind1@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-mtd@lists.infradead.org
Subject: Re: [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time
Date: Wed, 22 Jun 2016 15:47:56 +0200	[thread overview]
Message-ID: <5694616.oYyysJP9uD@wuerfel> (raw)
In-Reply-To: <1466382443-11063-8-git-send-email-deepa.kernel@gmail.com>

On Sunday, June 19, 2016 5:27:06 PM CEST Deepa Dinamani wrote:
> @@ -84,6 +84,8 @@ static int create_default_filesystem(struct ubifs_info *c)
>         int min_leb_cnt = UBIFS_MIN_LEB_CNT;
>         long long tmp64, main_bytes;
>         __le64 tmp_le64;
> +       __le32 tmp_le32;
> +       struct timespec ts;
>  
>         /* Some functions called from here depend on the @c->key_len filed */
>         c->key_len = UBIFS_SK_LEN;
> @@ -297,13 +299,17 @@ static int create_default_filesystem(struct ubifs_info *c)
>         ino->ch.node_type = UBIFS_INO_NODE;
>         ino->creat_sqnum = cpu_to_le64(++c->max_sqnum);
>         ino->nlink = cpu_to_le32(2);
> -       tmp_le64 = cpu_to_le64(CURRENT_TIME_SEC.tv_sec);
> +
> +       ktime_get_real_ts(&ts);
> +       ts = timespec_trunc(ts, DEFAULT_TIME_GRAN);
> +       tmp_le64 = cpu_to_le64(ts.tv_sec);
>         ino->atime_sec   = tmp_le64;
>         ino->ctime_sec   = tmp_le64;
>         ino->mtime_sec   = tmp_le64;
> -       ino->atime_nsec  = 0;
> -       ino->ctime_nsec  = 0;
> -       ino->mtime_nsec  = 0;
> +       tmp_le32 = cpu_to_le32(ts.tv_nsec);
> +       ino->atime_nsec  = tmp_le32;
> +       ino->ctime_nsec  = tmp_le32;
> +       ino->mtime_nsec  = tmp_le32;

This part of the patch seems independent of the rest, as you don't actually
use current_time() here, or assign the timespec to an inode.

I'd suggest either leaving this part out of the patch series for now,
or making it a separate patch that uses timespec64 directly.

	Arnd

  reply	other threads:[~2016-06-22 13:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  0:26 [PATCH v2 00/24] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani
2016-06-20  0:27 ` [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time Deepa Dinamani
2016-06-22 13:47   ` Arnd Bergmann [this message]
2016-06-24 21:05     ` Deepa Dinamani
2016-06-24 21:14       ` [Y2038] " Arnd Bergmann
2016-06-20 18:03 ` [PATCH v2 00/24] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Linus Torvalds
2016-06-20 18:58   ` Deepa Dinamani
2016-06-21 15:00   ` [Y2038] " Arnd Bergmann
2016-06-22 15:49 ` 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=5694616.oYyysJP9uD@wuerfel \
    --to=arnd@arndb.de \
    --cc=adrian.hunter@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=deepa.kernel@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox