Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1428811

Re: [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time
Date 2016-06-22 15:50 +0200
Message-ID <rMQHv-47X-23@gated-at.bofh.it> (permalink)
References <rLVgd-11C-1@gated-at.bofh.it> <rLVgd-11C-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/24] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:30 +0200
  [PATCH v2 10/24] fs: cifs: Replace CURRENT_TIME by current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:30 +0200
  [PATCH v2 09/24] fs: udf: Replace CURRENT_TIME with current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:30 +0200
    Re: [Y2038] [PATCH v2 09/24] fs: udf: Replace CURRENT_TIME with current_time() Arnd Bergmann <arnd@arndb.de> - 2016-06-22 16:10 +0200
      Re: [Y2038] [PATCH v2 09/24] fs: udf: Replace CURRENT_TIME with current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-23 04:00 +0200
  [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:30 +0200
    Re: [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time Arnd Bergmann <arnd@arndb.de> - 2016-06-22 15:50 +0200
  [PATCH v2 01/24] vfs: Add current_time() api Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:30 +0200
  [PATCH v2 06/24] fs: ext4: Use current_time() for inode timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:30 +0200
    Re: [PATCH v2 06/24] fs: ext4: Use current_time() for inode timestamps Arnd Bergmann <arnd@arndb.de> - 2016-06-22 15:40 +0200
  [PATCH v2 11/24] fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:40 +0200
  [PATCH v2 05/24] fs: jfs: Replace CURRENT_TIME_SEC by current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:40 +0200
    Re: [Jfs-discussion] [PATCH v2 05/24] fs: jfs: Replace  CURRENT_TIME_SEC by current_time() Dave Kleikamp <dave.kleikamp@oracle.com> - 2016-06-20 21:20 +0200
  [PATCH v2 24/24] time: Delete current_fs_time() function Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:40 +0200
  [PATCH v2 23/24] time: Delete CURRENT_TIME_SEC and CURRENT_TIME macro Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:40 +0200
    Re: [PATCH v2 23/24] time: Delete CURRENT_TIME_SEC and CURRENT_TIME macro Arnd Bergmann <arnd@arndb.de> - 2016-06-22 17:50 +0200
  [PATCH v2 08/24] fs: btrfs: Use ktime_get_real_ts for root ctime Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:40 +0200
    Re: [PATCH v2 08/24] fs: btrfs: Use ktime_get_real_ts for root ctime David Sterba <dsterba@suse.cz> - 2016-06-20 11:50 +0200
  [PATCH v2 04/24] fs: Replace current_fs_time() with current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:40 +0200
  [PATCH v2 18/24] fs: nfs: Make nfs boot time y2038 safe Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:50 +0200
  [PATCH v2 16/24] fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:50 +0200
  [PATCH v2 22/24] fs: ceph: Replace current_fs_time for request stamp Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:50 +0200
  [PATCH v2 17/24] audit: Use timespec64 to represent audit timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 02:50 +0200
    Re: [PATCH v2 17/24] audit: Use timespec64 to represent audit  timestamps Richard Guy Briggs <rgb@redhat.com> - 2016-06-20 17:20 +0200
  [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 03:30 +0200
    Re: [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps Arnd Bergmann <arnd@arndb.de> - 2016-06-22 16:10 +0200
      Re: [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-23 04:00 +0200
  [PATCH v2 13/24] fs: f2fs: Use ktime_get_real_seconds for sit_info times Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 03:30 +0200
  [PATCH v2 14/24] drivers: staging: lustre: Replace CURRENT_TIME with current_time() Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 03:40 +0200
  [PATCH v2 15/24] fs: ocfs2: Use time64_t to represent orphan scan times Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 03:40 +0200
  [PATCH v2 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 03:40 +0200
  [PATCH v2 12/24] fs: cifs: Replace CURRENT_TIME by get_seconds Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 03:40 +0200
  [PATCH v2 20/24] block: Replace CURRENT_TIME with ktime_get_real_ts Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 04:40 +0200
  Re: [PATCH v2 00/24] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Linus Torvalds <torvalds@linux-foundation.org> - 2016-06-20 20:10 +0200
    Re: [PATCH v2 00/24] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani <deepa.kernel@gmail.com> - 2016-06-20 21:00 +0200
    Re: [Y2038] [PATCH v2 00/24] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Arnd Bergmann <arnd@arndb.de> - 2016-06-21 17:10 +0200
  Re: [Y2038] [PATCH v2 00/24] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Arnd Bergmann <arnd@arndb.de> - 2016-06-22 18:00 +0200

csiph-web