All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] Remove CURRENT_TIME and CURRENT_TIME_SEC - PART 1
@ 2016-02-03  6:07 Deepa Dinamani
  2016-02-03  6:07 ` [PATCH 01/10] fs: Add current_fs_time_sec() function Deepa Dinamani
                   ` (10 more replies)
  0 siblings, 11 replies; 33+ messages in thread
From: Deepa Dinamani @ 2016-02-03  6:07 UTC (permalink / raw)
  To: linux-fsdevel, y2038
  Cc: Arnd Bergmann, Dave Chinner, Theodore Ts'o, linux-kernel

Introduction

This patch series is aimed at getting rid of CURRENT_TIME and CURRENT_TIME_SEC
macros.

The idea for the series evolved from my discussions with Arnd Bergmann.

This was originally part of the RFC series[2]:
https://lkml.org/lkml/2016/1/7/20 (under discussion).

Dave Chinner suggested moving bug fixes out of the feature series to keep the
original series simple.

There are 354 occurrences of the the above macros in the kernel.
The series will be divided into 4 or 5 parts to keep the parts manageable
and so that each part could be reviewed and merged independently.
This is part 1 of the series. 

Motivation

The macros: CURRENT_TIME and CURRENT_TIME_SEC are primarily used for
filesystem timestamps.
But, they are not accurate as they do not perform clamping according to
filesystem timestamps ranges, nor do they truncate the nanoseconds value
to the granularity as required by the filesystem.

The series is also viewed as an ancillary to another upcoming series[2]
that attempts to transition file system timestamps to use 64 bit time to
make these y2038 safe.

There will also be another series[3] to add range checks and clamping to
filesystem time functions that are meant to substitute the above macros.

Solution

CURRENT_TIME macro has an equivalent function:

struct timespec current_fs_time(struct super_block *sb)

These will be the changes to the above function:
1. Function will return the type y2038 safe timespec64 in [2].
2. Function will use y2038 safe 64 bit functions in [2].
3. Function will be extended to perform range checks in [3].

A new function will be added to substitute for CURRENT_TIME_SEC macro
in the current series:

struct timespec current_fs_time_sec(void)

These will be the changes to the above function:
1. Function will return the type y2038 safe timespec64 in [2].
2. Function will use y2038 safe 64 bit functions in [2].
3. Function will be extended to perform range checks in [3].

Any use of these macros outside of filesystem timestamps will
be replaced by function calls to appropriate time functions.

Deepa Dinamani (10):
  fs: Add current_fs_time_sec() function
  vfs: Replace CURRENT_TIME by current_fs_time()
  fs: cifs: Replace CURRENT_TIME with current_fs_time()
  fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts()
  fs: cifs: Replace CURRENT_TIME by get_seconds
  fs: ext4: Replace CURRENT_TIME_SEC with current_fs_time_sec()
  fs: ext4: Replace CURRENT_TIME with ext4_current_time()
  fs: ceph: replace CURRENT_TIME by current_fs_time()
  fs: ceph: Replace CURRENT_TIME by ktime_get_real_ts()
  fs: btrfs: Replace CURRENT_TIME by current_fs_time()

 fs/btrfs/file.c        |  4 ++--
 fs/btrfs/inode.c       | 25 +++++++++++++------------
 fs/btrfs/ioctl.c       |  8 ++++----
 fs/btrfs/root-tree.c   |  2 +-
 fs/btrfs/transaction.c |  7 +++++--
 fs/btrfs/xattr.c       |  2 +-
 fs/ceph/file.c         |  4 ++--
 fs/ceph/inode.c        |  2 +-
 fs/ceph/mds_client.c   |  2 +-
 fs/ceph/xattr.c        |  4 ++--
 fs/cifs/cifsencrypt.c  |  4 +++-
 fs/cifs/cifssmb.c      | 10 +++++-----
 fs/cifs/inode.c        | 15 +++++++--------
 fs/ext4/ext4.h         |  2 +-
 fs/ext4/super.c        |  2 +-
 fs/libfs.c             | 21 +++++++++++++--------
 fs/nsfs.c              |  3 ++-
 fs/pipe.c              |  3 ++-
 fs/posix_acl.c         |  2 +-
 include/linux/fs.h     |  5 +++++
 20 files changed, 72 insertions(+), 55 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2016-02-08 15:09 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 08/10] fs: ceph: replace CURRENT_TIME by current_fs_time() Deepa Dinamani
2016-02-03  6:22   ` 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

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.