Delete CURRENT_TIME and CURRENT_TIME_SEC macros
Subsystems (62)
v2 cover Delete CURRENT_TIME and CURRENT_TIME_SEC macros
The series is aimed at getting rid of CURRENT_TIME and CURRENT_TIME_SEC macros. The macros are not y2038 safe. There is no plan to transition them into being y2038 safe.
ktime_get_* api's can be used in their place. And, these are y2038 safe.
Thanks to Arnd Bergmann for all the guidance and discussions.
Patches 2-4 were mostly generated using coccinelle scripts.
All filesystem timestamps use current_fs_time() for right granularity as mentioned in the respective commit texts of patches. This has a changed signature, renamed to current_time() and moved to the fs/inode.c.
This series also serves as a preparatory series to transition vfs to 64 bit timestamps as outlined here: https://lkml.org/lkml/2016/2/12/104 .
As per Linus's suggestion in https://lkml.org/lkml/2016/5/24/663 , all the inode timestamp changes have been squashed into a single patch. Also, current_time() now is used as a single generic vfs filesystem timestamp api. It also takes struct inode* as argument instead of struct super_block*. Posting all patches together in a bigger series so that the big picture is clear.
As per the suggestion in https://lwn.net/Articles/672598/, CURRENT_TIME macro bug fixes are being handled in a series separate from transitioning vfs to use.
Changes from v1:
* Change current_fs_time(struct super_block *) to current_time(struct inode *)
* Note that change to add time64_to_tm() is already part of John's kernel tree: https://lkml.org/lkml/2016/6/17/875 .
Deepa Dinamani (24):
vfs: Add current_time() api
fs: Replace CURRENT_TIME with current_time() for inode timestamps
fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
fs: Replace current_fs_time() with current_time()
fs: jfs: Replace CURRENT_TIME_SEC by current_time()
fs: ext4: Use current_time() for inode timestamps
fs: ubifs: Replace CURRENT_TIME_SEC with current_time
fs: btrfs: Use ktime_get_real_ts for root ctime
fs: udf: Replace CURRENT_TIME with current_time()
fs: cifs: Replace CURRENT_TIME by current_time()
fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts()
fs: cifs: Replace CURRENT_TIME by get_seconds
fs: f2fs: Use ktime_get_real_seconds for sit_info times
drivers: staging: lustre: Replace CURRENT_TIME with current_time()
fs: ocfs2: Use time64_t to represent orphan scan times
fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds()
audit: Use timespec64 to represent audit timestamps
fs: nfs: Make nfs boot time y2038 safe
fnic: Use time64_t to represent trace timestamps
block: Replace CURRENT_TIME with ktime_get_real_ts
libceph: Replace CURRENT_TIME with ktime_get_real_ts
fs: ceph: Replace current_fs_time for request stamp
time: Delete CURRENT_TIME_SEC and CURRENT_TIME macro
time: Delete current_fs_time() function
arch/powerpc/platforms/cell/spufs/inode.c | 2 +- arch/s390/hypfs/inode.c | 4 ++-- drivers/block/rbd.c | 2 +- drivers/char/sonypi.c | 2 +- drivers/infiniband/hw/qib/qib_fs.c | 2 +- drivers/misc/ibmasm/ibmasmfs.c | 2 +- drivers/oprofile/oprofilefs.c | 2 +- drivers/platform/x86/sony-laptop.c | 2 +- drivers/scsi/fnic/fnic_trace.c | 4 ++-- drivers/scsi/fnic/fnic_trace.h | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 16 ++++++------- drivers/staging/lustre/lustre/llite/namei.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 6 ++--- .../lustre/lustre/obdclass/linux/linux-obdo.c | 6 ++--- drivers/staging/lustre/lustre/obdclass/obdo.c | 6 ++--- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- drivers/usb/core/devio.c | 18 +++++++------- drivers/usb/gadget/function/f_fs.c | 8 +++---- drivers/usb/gadget/legacy/inode.c | 2 +- fs/9p/vfs_inode.c | 2 +- fs/adfs/inode.c | 2 +- fs/affs/amigaffs.c | 6 ++--- fs/affs/inode.c | 2 +- fs/attr.c | 2 +- fs/autofs4/inode.c | 2 +- fs/autofs4/root.c | 6 ++--- fs/bad_inode.c | 2 +- fs/bfs/dir.c | 14 +++++------ fs/binfmt_misc.c | 2 +- fs/btrfs/file.c | 6 ++--- fs/btrfs/inode.c | 22 ++++++++--------- fs/btrfs/ioctl.c | 8 +++---- fs/btrfs/root-tree.c | 3 ++- fs/btrfs/transaction.c | 4 ++-- fs/btrfs/xattr.c | 2 +- fs/ceph/file.c | 4 ++-- fs/ceph/inode.c | 2 +- fs/ceph/mds_client.c | 4 +++- fs/ceph/xattr.c | 2 +- fs/cifs/cifsencrypt.c | 4 +++- fs/cifs/cifssmb.c | 10 ++++---- fs/cifs/file.c | 4 ++-- fs/cifs/inode.c | 28 ++++++++++++---------- fs/coda/dir.c | 2 +- fs/coda/file.c | 2 +- fs/coda/inode.c | 2 +- fs/configfs/inode.c | 6 ++--- fs/debugfs/inode.c | 2 +- fs/devpts/inode.c | 6 ++--- fs/efivarfs/inode.c | 2 +- fs/exofs/dir.c | 6 ++--- fs/exofs/inode.c | 4 ++-- fs/exofs/namei.c | 6 ++--- fs/ext2/acl.c | 2 +- fs/ext2/dir.c | 6 ++--- fs/ext2/ialloc.c | 2 +- fs/ext2/inode.c | 4 ++-- fs/ext2/ioctl.c | 4 ++-- fs/ext2/namei.c | 6 ++--- fs/ext2/super.c | 2 +- fs/ext2/xattr.c | 2 +- fs/ext4/acl.c | 2 +- fs/ext4/ext4.h | 6 ----- fs/ext4/extents.c | 10 ++++---- fs/ext4/ialloc.c | 2 +- fs/ext4/inline.c | 4 ++-- fs/ext4/inode.c | 6 ++--- fs/ext4/ioctl.c | 8 +++---- fs/ext4/namei.c | 24 ++++++++++--------- fs/ext4/super.c | 2 +- fs/ext4/xattr.c | 2 +- fs/f2fs/dir.c | 8 +++---- fs/f2fs/file.c | 8 +++---- fs/f2fs/inline.c | 2 +- fs/f2fs/namei.c | 12 +++++----- fs/f2fs/segment.c | 2 +- fs/f2fs/segment.h | 5 ++-- fs/f2fs/xattr.c | 2 +- fs/fat/dir.c | 2 +- fs/fat/file.c | 6 ++--- fs/fat/inode.c | 2 +- fs/fat/namei_msdos.c | 12 +++++----- fs/fat/namei_vfat.c | 10 ++++---- fs/fuse/control.c | 2 +- fs/fuse/dir.c | 2 +- fs/gfs2/bmap.c | 8 +++---- fs/gfs2/dir.c | 12 +++++----- fs/gfs2/inode.c | 8 +++---- fs/gfs2/quota.c | 2 +- fs/gfs2/xattr.c | 8 +++---- fs/hfs/catalog.c | 8 +++---- fs/hfs/dir.c | 2 +- fs/hfs/inode.c | 2 +- fs/hfsplus/catalog.c | 8 +++---- fs/hfsplus/dir.c | 6 ++--- fs/hfsplus/inode.c | 2 +- fs/hfsplus/ioctl.c | 2 +- fs/hugetlbfs/inode.c | 10 ++++---- fs/inode.c | 21 +++++++++++++--- fs/jffs2/acl.c | 2 +- fs/jffs2/fs.c | 2 +- fs/jfs/acl.c | 2 +- fs/jfs/inode.c | 2 +- fs/jfs/ioctl.c | 2 +- fs/jfs/jfs_inode.c | 2 +- fs/jfs/namei.c | 24 +++++++++---------- fs/jfs/super.c | 2 +- fs/jfs/xattr.c | 2 +- fs/kernfs/inode.c | 2 +- fs/libfs.c | 14 +++++------ fs/locks.c | 2 +- fs/logfs/dir.c | 6 ++--- fs/logfs/file.c | 2 +- fs/logfs/inode.c | 4 ++-- fs/logfs/readwrite.c | 4 ++-- fs/minix/bitmap.c | 2 +- fs/minix/dir.c | 6 ++--- fs/minix/itree_common.c | 4 ++-- fs/minix/namei.c | 4 ++-- fs/nfs/client.c | 2 +- fs/nfs/netns.h | 2 +- fs/nfs/nfs4proc.c | 10 ++++---- fs/nfs/nfs4xdr.c | 2 +- fs/nfsd/blocklayout.c | 2 +- fs/nilfs2/dir.c | 6 ++--- fs/nilfs2/inode.c | 4 ++-- fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/namei.c | 6 ++--- fs/nsfs.c | 2 +- fs/ntfs/inode.c | 2 +- fs/ntfs/mft.c | 2 +- fs/ocfs2/acl.c | 2 +- fs/ocfs2/alloc.c | 2 +- fs/ocfs2/aops.c | 2 +- fs/ocfs2/cluster/heartbeat.c | 2 +- fs/ocfs2/dir.c | 4 ++-- fs/ocfs2/dlmfs/dlmfs.c | 4 ++-- fs/ocfs2/file.c | 12 +++++----- fs/ocfs2/inode.c | 2 +- fs/ocfs2/journal.c | 4 ++-- fs/ocfs2/move_extents.c | 2 +- fs/ocfs2/namei.c | 16 +++++++------ fs/ocfs2/ocfs2.h | 2 +- fs/ocfs2/refcounttree.c | 4 ++-- fs/ocfs2/super.c | 2 +- fs/ocfs2/xattr.c | 2 +- fs/omfs/dir.c | 4 ++-- fs/omfs/inode.c | 2 +- fs/openpromfs/inode.c | 2 +- fs/orangefs/file.c | 2 +- fs/orangefs/inode.c | 2 +- fs/orangefs/namei.c | 10 ++++---- fs/pipe.c | 2 +- fs/posix_acl.c | 2 +- fs/proc/base.c | 2 +- fs/proc/inode.c | 4 ++-- fs/proc/proc_sysctl.c | 2 +- fs/proc/self.c | 2 +- fs/proc/thread_self.c | 2 +- fs/pstore/inode.c | 2 +- fs/ramfs/inode.c | 6 ++--- fs/reiserfs/inode.c | 2 +- fs/reiserfs/ioctl.c | 4 ++-- fs/reiserfs/namei.c | 12 +++++----- fs/reiserfs/stree.c | 8 +++---- fs/reiserfs/super.c | 2 +- fs/reiserfs/xattr.c | 6 ++--- fs/reiserfs/xattr_acl.c | 2 +- fs/sysv/dir.c | 6 ++--- fs/sysv/ialloc.c | 2 +- fs/sysv/itree.c | 4 ++-- fs/sysv/namei.c | 4 ++-- fs/tracefs/inode.c | 2 +- fs/ubifs/dir.c | 10 ++++---- fs/ubifs/file.c | 12 +++++----- fs/ubifs/ioctl.c | 2 +- fs/ubifs/misc.h | 10 -------- fs/ubifs/sb.c | 14 +++++++---- fs/ubifs/xattr.c | 6 ++--- fs/udf/ialloc.c | 2 +- fs/udf/inode.c | 4 ++-- fs/udf/namei.c | 20 ++++++++-------- fs/udf/super.c | 9 +++++-- fs/ufs/dir.c | 6 ++--- fs/ufs/ialloc.c | 8 ++++--- fs/ufs/inode.c | 6 ++--- fs/ufs/namei.c | 6 ++--- fs/xfs/xfs_acl.c | 2 +- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_trans_inode.c | 2 +- include/linux/audit.h | 4 ++-- include/linux/fs.h | 2 +- include/linux/time.h | 3 --- ipc/mqueue.c | 18 +++++++------- kernel/audit.c | 10 ++++---- kernel/audit.h | 2 +- kernel/auditsc.c | 6 ++--- kernel/bpf/inode.c | 2 +- kernel/time/time.c | 14 ----------- mm/shmem.c | 20 ++++++++-------- net/ceph/messenger.c | 6 +++-- net/ceph/osd_client.c | 4 ++-- net/sunrpc/rpc_pipe.c | 2 +- security/inode.c | 2 +- security/selinux/selinuxfs.c | 2 +- 206 files changed, 533 insertions(+), 522 deletions(-)
Signature · 41 lines
1.9.1 Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: dsterba-IBi9RG/[email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: jack-IBi9RG/[email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: linux-f2fs-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: mfasheh-IBi9RG/[email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: trond.myklebust-7I+n7zu2hftEKMMhf/[email protected] Cc: [email protected]
PATCH v2 1/24 vfs: Add current_time() api
current_fs_time() is used for inode timestamps.
Change the signature of the function to take inode pointer instead of superblock as per Linus's suggestion.
Also, move the api under vfs as per the discussion on the
thread: https://lkml.org/lkml/2016/6/9/36 . As per Arnd's suggestion on the thread, changing the function name.
current_fs_time() will be deleted after all the references to it are replaced by current_time().
Note that timespec_trunc() will also be moved to fs/inode.c in a separate patch when this will need to be revamped for bounds checking purposes.
--- fs/inode.c | 15 +++++++++++++++ include/linux/fs.h | 1 + 2 files changed, 16 insertions(+)
fs/inode.c +15 -0
@@ -2041,3 +2041,18 @@ void inode_nohighmem(struct inode *inode)mapping_set_gfp_mask (inode->i_mapping,GFP_USER ); }EXPORT_SYMBOL (inode_nohighmem); + +/** +* current_time - Return FS time +* @inode: inode. +* +* Return the current time truncated to the time granularity supported by +* the fs. +*/ +struct timespec current_time (struct inode *inode) +{ +struct timespec now =current_kernel_time (); + +return timespec_trunc (now, inode->i_sb->s_time_gran); +} +EXPORT_SYMBOL (current_time);
include/linux/fs.h +1 -0
@@ -1461,6 +1461,7 @@ struct super_block { };extern struct timespec current_fs_time (struct super_block *sb); +extern struct timespec current_time (struct inode *inode);static inline struct timespec current_fs_time_sec (struct super_block *sb) {
Signature · 1 line
1.9.1
PATCH v2 2/24 fs: Replace CURRENT_TIME with current_time() for inode timestamps
In reply to Deepa DinamaniCURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_time() instead.
CURRENT_TIME is also not y2038 safe.
This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. As part of the effort current_time() will be extended to do range checks. Hence, it is necessary for all file system timestamps to use current_time(). Also, current_time() will be transitioned along with vfs to be y2038 safe.
Note that whenever a single call to current_time() is used to change timestamps in different inodes, it is because they share the same time granularity.
--- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- arch/s390/hypfs/inode.c | 4 ++-- drivers/infiniband/hw/qib/qib_fs.c | 2 +- drivers/misc/ibmasm/ibmasmfs.c | 2 +- drivers/oprofile/oprofilefs.c | 2 +- drivers/usb/core/devio.c | 18 +++++++++--------- drivers/usb/gadget/function/f_fs.c | 8 ++++---- drivers/usb/gadget/legacy/inode.c | 2 +- fs/9p/vfs_inode.c | 2 +- fs/adfs/inode.c | 2 +- fs/autofs4/inode.c | 2 +- fs/autofs4/root.c | 6 +++--- fs/btrfs/inode.c | 2 +- fs/devpts/inode.c | 6 +++--- fs/efivarfs/inode.c | 2 +- fs/exofs/dir.c | 6 +++--- fs/exofs/inode.c | 4 ++-- fs/exofs/namei.c | 6 +++--- fs/ext2/super.c | 2 +- fs/ext4/super.c | 2 +- fs/f2fs/dir.c | 8 ++++---- fs/f2fs/file.c | 8 ++++---- fs/f2fs/inline.c | 2 +- fs/f2fs/namei.c | 12 ++++++------ fs/f2fs/xattr.c | 2 +- fs/fuse/control.c | 2 +- fs/gfs2/bmap.c | 8 ++++---- fs/gfs2/dir.c | 12 ++++++------ fs/gfs2/inode.c | 8 ++++---- fs/gfs2/quota.c | 2 +- fs/gfs2/xattr.c | 8 ++++---- fs/hugetlbfs/inode.c | 10 +++++----- fs/jfs/acl.c | 2 +- fs/jfs/inode.c | 2 +- fs/jfs/jfs_inode.c | 2 +- fs/jfs/namei.c | 22 +++++++++++----------- fs/jfs/super.c | 2 +- fs/jfs/xattr.c | 2 +- fs/libfs.c | 14 +++++++------- fs/logfs/dir.c | 6 +++--- fs/logfs/file.c | 2 +- fs/logfs/inode.c | 4 ++-- fs/logfs/readwrite.c | 4 ++-- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 4 ++-- fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/namei.c | 6 +++--- fs/nsfs.c | 2 +- fs/ocfs2/acl.c | 2 +- fs/ocfs2/alloc.c | 2 +- fs/ocfs2/aops.c | 2 +- fs/ocfs2/dir.c | 4 ++-- fs/ocfs2/dlmfs/dlmfs.c | 4 ++-- fs/ocfs2/file.c | 12 ++++++------ fs/ocfs2/move_extents.c | 2 +- fs/ocfs2/namei.c | 16 +++++++++------- fs/ocfs2/refcounttree.c | 4 ++-- fs/ocfs2/xattr.c | 2 +- fs/omfs/inode.c | 2 +- fs/openpromfs/inode.c | 2 +- fs/orangefs/file.c | 2 +- fs/orangefs/inode.c | 2 +- fs/orangefs/namei.c | 2 +- fs/pipe.c | 2 +- fs/posix_acl.c | 2 +- fs/proc/base.c | 2 +- fs/proc/inode.c | 4 ++-- fs/proc/proc_sysctl.c | 2 +- fs/proc/self.c | 2 +- fs/proc/thread_self.c | 2 +- fs/pstore/inode.c | 2 +- fs/ramfs/inode.c | 6 +++--- fs/reiserfs/super.c | 2 +- fs/tracefs/inode.c | 2 +- fs/ufs/ialloc.c | 6 ++++-- ipc/mqueue.c | 18 +++++++++--------- kernel/bpf/inode.c | 2 +- mm/shmem.c | 20 ++++++++++---------- net/sunrpc/rpc_pipe.c | 2 +- security/inode.c | 2 +- security/selinux/selinuxfs.c | 2 +- 81 files changed, 195 insertions(+), 191 deletions(-)
arch/powerpc/platforms/cell/spufs/inode.c +1 -1
@@ -103,7 +103,7 @@ spufs_new_inode(struct super_block *sb, umode_t mode) inode->i_mode = mode; inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid (); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); out:return inode; }
arch/s390/hypfs/inode.c +2 -2
@@ -51,7 +51,7 @@ static void hypfs_update_update(struct super_block *sb)struct inode *inode =d_inode (sb_info->update_file); sb_info->last_update =get_seconds (); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); }/* directory tree removal functions */
@@ -99,7 +99,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode) ret->i_mode = mode; ret->i_uid = hypfs_info->uid; ret->i_gid = hypfs_info->gid; - ret->i_atime = ret->i_mtime = ret->i_ctime =CURRENT_TIME ; + ret->i_atime = ret->i_mtime = ret->i_ctime =current_time (ret);if (S_ISDIR (mode))set_nlink (ret,2 ); }
drivers/infiniband/hw/qib/qib_fs.c +1 -1
@@ -64,7 +64,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry, inode->i_uid =GLOBAL_ROOT_UID ; inode->i_gid =GLOBAL_ROOT_GID ; inode->i_blocks =0 ; - inode->i_atime =CURRENT_TIME ; + inode->i_atime =current_time (inode); inode->i_mtime = inode->i_atime; inode->i_ctime = inode->i_atime; inode->i_private = data;
drivers/misc/ibmasm/ibmasmfs.c +1 -1
@@ -144,7 +144,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode)if (ret) { ret->i_ino =get_next_ino (); ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime =CURRENT_TIME ; + ret->i_atime = ret->i_mtime = ret->i_ctime =current_time (ret); }return ret; }
drivers/oprofile/oprofilefs.c +1 -1
@@ -30,7 +30,7 @@ static struct inode *oprofilefs_get_inode(struct super_block *sb, int mode)if (inode) { inode->i_ino =get_next_ino (); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); }return inode; }
drivers/usb/core/devio.c +9 -9
@@ -2402,21 +2402,21 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,snoop (&dev->dev,"%s: CONTROL\n" , __func__); ret =proc_control (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;case USBDEVFS_BULK :snoop (&dev->dev,"%s: BULK\n" , __func__); ret =proc_bulk (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;case USBDEVFS_RESETEP :snoop (&dev->dev,"%s: RESETEP\n" , __func__); ret =proc_resetep (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;case USBDEVFS_RESET :
@@ -2428,7 +2428,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,snoop (&dev->dev,"%s: CLEAR_HALT\n" , __func__); ret =proc_clearhalt (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;case USBDEVFS_GETDRIVER :
@@ -2455,7 +2455,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,snoop (&dev->dev,"%s: SUBMITURB\n" , __func__); ret =proc_submiturb (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;#ifdef CONFIG_COMPAT
@@ -2463,14 +2463,14 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,snoop (&dev->dev,"%s: CONTROL32\n" , __func__); ret =proc_control_compat (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;case USBDEVFS_BULK32 :snoop (&dev->dev,"%s: BULK32\n" , __func__); ret =proc_bulk_compat (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;case USBDEVFS_DISCSIGNAL32 :
@@ -2482,7 +2482,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd,snoop (&dev->dev,"%s: SUBMITURB32\n" , __func__); ret =proc_submiturb_compat (ps, p);if (ret >=0 ) - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);break ;case USBDEVFS_IOCTL32 :
@@ -2545,7 +2545,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, done:usb_unlock_device (dev);if (ret >=0 ) - inode->i_atime =CURRENT_TIME ; + inode->i_atime =current_time (inode);return ret; }
drivers/usb/gadget/function/f_fs.c +4 -4
@@ -1077,15 +1077,15 @@ ffs_sb_make_inode(struct super_block *sb, void *data, inode =new_inode (sb);if (likely (inode)) { -struct timespec current_time =CURRENT_TIME ; +struct timespec ts =current_time (inode); inode->i_ino =get_next_ino (); inode->i_mode = perms->mode; inode->i_uid = perms->uid; inode->i_gid = perms->gid; - inode->i_atime = current_time; - inode->i_mtime = current_time; - inode->i_ctime = current_time; + inode->i_atime = ts; + inode->i_mtime = ts; + inode->i_ctime = ts; inode->i_private = data;if (fops) inode->i_fop = fops;
drivers/usb/gadget/legacy/inode.c +1 -1
@@ -1913,7 +1913,7 @@ gadgetfs_make_inode (struct super_block *sb, inode->i_uid =make_kuid (&init_user_ns, default_uid); inode->i_gid =make_kgid (&init_user_ns, default_gid); inode->i_atime = inode->i_mtime = inode->i_ctime - =CURRENT_TIME ; + =current_time (inode); inode->i_private = data; inode->i_fop = fops; }
fs/9p/vfs_inode.c +1 -1
@@ -276,7 +276,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses,inode_init_owner (inode,NULL , mode); inode->i_blocks =0 ; inode->i_rdev = rdev; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_mapping->a_ops = &v9fs_addr_operations;switch (mode &S_IFMT ) {
fs/adfs/inode.c +1 -1
@@ -199,7 +199,7 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode)return ; cur_time: - *tv =CURRENT_TIME ; + *tv =current_time (inode);return ; too_early:
fs/autofs4/inode.c +1 -1
@@ -359,7 +359,7 @@ struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode) inode->i_uid =d_inode (sb->s_root)->i_uid; inode->i_gid =d_inode (sb->s_root)->i_gid; } - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_ino =get_next_ino ();if (S_ISDIR (mode)) {
fs/autofs4/root.c +3 -3
@@ -591,7 +591,7 @@ static int autofs4_dir_symlink(struct inode *dir,if (p_ino && !IS_ROOT (dentry))atomic_inc (&p_ino->count); - dir->i_mtime =CURRENT_TIME ; + dir->i_mtime =current_time (dir);return 0 ; }
@@ -631,7 +631,7 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)d_inode (dentry)->i_size =0 ;clear_nlink (d_inode (dentry)); - dir->i_mtime =CURRENT_TIME ; + dir->i_mtime =current_time (dir);spin_lock (&sbi->lookup_lock);__autofs4_add_expiring (dentry);
@@ -762,7 +762,7 @@ static int autofs4_dir_mkdir(struct inode *dir,if (p_ino && !IS_ROOT (dentry))atomic_inc (&p_ino->count);inc_nlink (dir); - dir->i_mtime =CURRENT_TIME ; + dir->i_mtime =current_time (dir);return 0 ; }
fs/btrfs/inode.c +1 -1
@@ -9464,7 +9464,7 @@ static int btrfs_rename_exchange(struct inode *old_dir,struct btrfs_root *dest =BTRFS_I (new_dir)->root;struct inode *new_inode = new_dentry->d_inode;struct inode *old_inode = old_dentry->d_inode; -struct timespec ctime =CURRENT_TIME ; +struct timespec ctime =current_time (old_inode);struct dentry *parent;u64 old_ino =btrfs_ino (old_inode);u64 new_ino =btrfs_ino (new_inode);
fs/devpts/inode.c +3 -3
@@ -305,7 +305,7 @@ static int mknod_ptmx(struct super_block *sb) } inode->i_ino =2 ; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); mode =S_IFCHR |opts->ptmxmode;init_special_inode (inode, mode,MKDEV (TTYAUX_MAJOR ,2 ));
@@ -410,7 +410,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent)if (!inode) goto fail; inode->i_ino =1 ; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_mode =S_IFDIR |S_IRUGO |S_IXUGO |S_IWUSR ; inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations;
@@ -558,7 +558,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) inode->i_ino = index +3 ; inode->i_uid = opts->setuid ? opts->uid :current_fsuid (); inode->i_gid = opts->setgid ? opts->gid :current_fsgid (); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);init_special_inode (inode,S_IFCHR |opts->mode,MKDEV (UNIX98_PTY_SLAVE_MAJOR , index));sprintf (s,"%d" , index);
fs/efivarfs/inode.c +1 -1
@@ -24,7 +24,7 @@ struct inode *efivarfs_get_inode(struct super_block *sb,if (inode) { inode->i_ino =get_next_ino (); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_flags = is_removable ?0 :S_IMMUTABLE ;switch (mode &S_IFMT ) {case S_IFREG :
fs/exofs/dir.c +3 -3
@@ -416,7 +416,7 @@ int exofs_set_link(struct inode *dir, struct exofs_dir_entry *de,if (likely (!err)) err =exofs_commit_chunk (page, pos, len);exofs_put_page (page); - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir);return err; }
@@ -503,7 +503,7 @@ got_it: de->inode_no =cpu_to_le64 (inode->i_ino);exofs_set_de_type (de, inode); err =exofs_commit_chunk (page, pos, rec_len); - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir); sbi->s_numfiles++;
@@ -554,7 +554,7 @@ int exofs_delete_entry(struct exofs_dir_entry *dir, struct page *page) dir->inode_no =0 ;if (likely (!err)) err =exofs_commit_chunk (page, pos, to - from); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode);mark_inode_dirty (inode); sbi->s_numfiles--; out:
fs/exofs/inode.c +2 -2
@@ -1007,7 +1007,7 @@ static int _do_truncate(struct inode *inode, loff_t newsize)struct exofs_sb_info *sbi = inode->i_sb->s_fs_info;int ret; - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode); ret =ore_truncate (&sbi->layout, &oi->oc, (u64 )newsize);if (likely (!ret))
@@ -1313,7 +1313,7 @@ struct inode *exofs_new_inode(struct inode *dir, umode_t mode)inode_init_owner (inode, dir, mode); inode->i_ino = sbi->s_nextid++; inode->i_blkbits =EXOFS_BLKSHIFT ; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); oi->i_commit_size = inode->i_size =0 ;spin_lock (&sbi->s_next_gen_lock); inode->i_generation = sbi->s_next_generation++;
fs/exofs/namei.c +3 -3
@@ -142,7 +142,7 @@ static int exofs_link(struct dentry *old_dentry, struct inode *dir, {struct inode *inode =d_inode (old_dentry); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);inode_inc_link_count (inode);ihold (inode);
@@ -261,7 +261,7 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry,if (!new_de) goto out_dir; err =exofs_set_link (new_dir, new_de, new_page, old_inode); - new_inode->i_ctime =CURRENT_TIME ; + new_inode->i_ctime =current_time (new_inode);if (dir_de)drop_nlink (new_inode);inode_dec_link_count (new_inode);
@@ -275,7 +275,7 @@ static int exofs_rename(struct inode *old_dir, struct dentry *old_dentry,inode_inc_link_count (new_dir); } - old_inode->i_ctime =CURRENT_TIME ; + old_inode->i_ctime =current_time (old_inode);exofs_delete_entry (old_de, old_page);mark_inode_dirty (old_inode);
fs/ext2/super.c +1 -1
@@ -1543,7 +1543,7 @@ out:if (inode->i_size < off+len-towrite)i_size_write (inode, off+len-towrite); inode->i_version++; - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty (inode);return len - towrite; }
fs/ext4/super.c +1 -1
@@ -5165,7 +5165,7 @@ static int ext4_quota_off(struct super_block *sb, int type) handle =ext4_journal_start (inode,EXT4_HT_QUOTA ,1 );if (IS_ERR (handle)) goto out; - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode);ext4_mark_inode_dirty (handle, inode);ext4_journal_stop (handle);
fs/f2fs/dir.c +4 -4
@@ -299,7 +299,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,f2fs_dentry_kunmap (dir, page);set_page_dirty (page); - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty_sync (dir);f2fs_put_page (page,1 ); }
@@ -451,7 +451,7 @@ void update_parent_metadata(struct inode *dir, struct inode *inode,f2fs_i_links_write (dir, true);clear_inode_flag (inode,FI_NEW_INODE ); } - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty_sync (dir);if (F2FS_I (dir)->i_current_depth != current_depth)
@@ -656,7 +656,7 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode)if (S_ISDIR (inode->i_mode))f2fs_i_links_write (dir, false); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);f2fs_i_links_write (inode, false);if (S_ISDIR (inode->i_mode)) {
@@ -703,7 +703,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,kunmap (page);/* kunmap - pair of f2fs_find_entry */ set_page_dirty (page); - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty_sync (dir);if (inode)
fs/f2fs/file.c +4 -4
@@ -629,7 +629,7 @@ int f2fs_truncate(struct inode *inode)if (err)return err; - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty_sync (inode);return 0 ; }
@@ -706,7 +706,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)if (err)return err; } - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode); } }
@@ -1274,7 +1274,7 @@ static long f2fs_fallocate(struct file *file, int mode, }if (!ret) { - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty_sync (inode);f2fs_update_time (F2FS_I_SB (inode),REQ_TIME ); }
@@ -1366,7 +1366,7 @@ static int f2fs_ioc_setflags(struct file *filp, unsigned long arg) fi->i_flags = flags;inode_unlock (inode); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);f2fs_set_inode_flags (inode); out:mnt_drop_write_file (filp);
fs/f2fs/inline.c +1 -1
@@ -566,7 +566,7 @@ void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page,set_page_dirty (page);f2fs_put_page (page,1 ); - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty_sync (dir);if (inode)
fs/f2fs/namei.c +6 -6
@@ -46,7 +46,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) inode->i_ino = ino; inode->i_blocks =0 ; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_generation = sbi->s_next_generation++; err =insert_inode_locked (inode);
@@ -177,7 +177,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,f2fs_balance_fs (sbi, true); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);ihold (inode);set_inode_flag (inode,FI_INC_LINK );
@@ -704,7 +704,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,f2fs_set_link (new_dir, new_entry, new_page, old_inode); - new_inode->i_ctime =CURRENT_TIME ; + new_inode->i_ctime =current_time (new_inode);down_write (&F2FS_I (new_inode)->i_sem);if (old_dir_entry)f2fs_i_links_write (new_inode, false);
@@ -756,7 +756,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,file_set_enc_name (old_inode);up_write (&F2FS_I (old_inode)->i_sem); - old_inode->i_ctime =CURRENT_TIME ; + old_inode->i_ctime =current_time (old_inode);mark_inode_dirty_sync (old_inode);f2fs_delete_entry (old_entry, old_page, old_dir,NULL );
@@ -903,7 +903,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,file_lost_pino (old_inode);up_write (&F2FS_I (old_inode)->i_sem); - old_dir->i_ctime =CURRENT_TIME ; + old_dir->i_ctime =current_time (old_dir);if (old_nlink) {down_write (&F2FS_I (old_dir)->i_sem);f2fs_i_links_write (old_dir, old_nlink >0 );
@@ -918,7 +918,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry,file_lost_pino (new_inode);up_write (&F2FS_I (new_inode)->i_sem); - new_dir->i_ctime =CURRENT_TIME ; + new_dir->i_ctime =current_time (new_dir);if (new_nlink) {down_write (&F2FS_I (new_dir)->i_sem);f2fs_i_links_write (new_dir, new_nlink >0 );
fs/f2fs/xattr.c +1 -1
@@ -541,7 +541,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,if (is_inode_flag_set (inode,FI_ACL_MODE )) { inode->i_mode =F2FS_I (inode)->i_acl_mode; - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);clear_inode_flag (inode,FI_ACL_MODE ); } if (index == F2FS_XATTR_INDEX_ENCRYPTION &&
fs/fuse/control.c +1 -1
@@ -220,7 +220,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, inode->i_mode = mode; inode->i_uid = fc->user_id; inode->i_gid = fc->group_id; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);/* setting ->i_op to NULL is not allowed */ if (iop) inode->i_op = iop;
fs/gfs2/bmap.c +4 -4
@@ -835,7 +835,7 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh,gfs2_quota_change (ip, -(s64 )btotal, ip->i_inode.i_uid, ip->i_inode.i_gid); - ip->i_inode.i_mtime = ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_mtime = ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_dinode_out (ip, dibh->b_data);
@@ -1062,7 +1062,7 @@ static int trunc_start(struct inode *inode, u64 oldsize, u64 newsize) }i_size_write (inode, newsize); - ip->i_inode.i_mtime = ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_mtime = ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_dinode_out (ip, dibh->b_data);if (journaled)
@@ -1141,7 +1141,7 @@ static int trunc_end(struct gfs2_inode *ip)gfs2_buffer_clear_tail (dibh,sizeof (struct gfs2_dinode ));gfs2_ordered_del_inode (ip); } - ip->i_inode.i_mtime = ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_mtime = ip->i_inode.i_ctime =current_time (&ip->i_inode); ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG ;gfs2_trans_add_meta (ip->i_gl, dibh);
@@ -1251,7 +1251,7 @@ static int do_grow(struct inode *inode, u64 size) goto do_end_trans;i_size_write (inode, size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_mtime = ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_trans_add_meta (ip->i_gl, dibh);gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
fs/gfs2/dir.c +6 -6
@@ -135,7 +135,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf,memcpy (dibh->b_data + offset +sizeof (struct gfs2_dinode ), buf, size);if (ip->i_inode.i_size < offset + size)i_size_write (&ip->i_inode, offset + size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_mtime = ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
@@ -233,7 +233,7 @@ out:if (ip->i_inode.i_size < offset + copied)i_size_write (&ip->i_inode, offset + copied); - ip->i_inode.i_mtime = ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_mtime = ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_trans_add_meta (ip->i_gl, dibh);gfs2_dinode_out (ip, dibh->b_data);
@@ -872,7 +872,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh,struct gfs2_leaf *leaf;struct gfs2_dirent *dent;struct qstr name = { .name ="" }; -struct timespec tv =CURRENT_TIME ; +struct timespec tv =current_time (inode); error =gfs2_alloc_blocks (ip, &bn, &n,0 ,NULL );if (error)
@@ -1815,7 +1815,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name,gfs2_inum_out (nip, dent); dent->de_type =cpu_to_be16 (IF2DT (nip->i_inode.i_mode)); dent->de_rahead =cpu_to_be16 (gfs2_inode_ra_len (nip)); - tv =CURRENT_TIME ; + tv =current_time (&ip->i_inode);if (ip->i_diskflags &GFS2_DIF_EXHASH ) { leaf = (struct gfs2_leaf *)bh->b_data;be16_add_cpu (&leaf->lf_entries,1 );
@@ -1877,7 +1877,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry)const struct qstr *name = &dentry->d_name;struct gfs2_dirent *dent, *prev =NULL ;struct buffer_head *bh; -struct timespec tv =CURRENT_TIME ; +struct timespec tv =current_time (&dip->i_inode);/* Returns _either_ the entry (if its first in block) or the previous entry otherwise */
@@ -1959,7 +1959,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,gfs2_trans_add_meta (dip->i_gl, bh); } - dip->i_inode.i_mtime = dip->i_inode.i_ctime =CURRENT_TIME ; + dip->i_inode.i_mtime = dip->i_inode.i_ctime =current_time (&dip->i_inode);gfs2_dinode_out (dip, bh->b_data);brelse (bh);return 0 ;
fs/gfs2/inode.c +4 -4
@@ -609,7 +609,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,set_nlink (inode,S_ISDIR (mode) ?2 :1 ); inode->i_rdev = dev; inode->i_size = size; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);gfs2_set_inode_blocks (inode,1 );munge_mode_uid_gid (dip, inode);check_and_update_goal (dip);
@@ -936,7 +936,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,gfs2_trans_add_meta (ip->i_gl, dibh);inc_nlink (&ip->i_inode); - ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_ctime =current_time (&ip->i_inode);ihold (inode);d_instantiate (dentry, inode);mark_inode_dirty (inode);
@@ -1020,7 +1020,7 @@ static int gfs2_unlink_inode(struct gfs2_inode *dip,return error; ip->i_entries =0 ; - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);if (S_ISDIR (inode->i_mode))clear_nlink (inode);else
@@ -1283,7 +1283,7 @@ static int update_moved_ino(struct gfs2_inode *ip, struct gfs2_inode *ndip, error =gfs2_meta_inode_buffer (ip, &dibh);if (error)return error; - ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_trans_add_meta (ip->i_gl, dibh);gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
fs/gfs2/quota.c +1 -1
@@ -854,7 +854,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, size = loc +sizeof (struct gfs2_quota );if (size > inode->i_size)i_size_write (inode, size); - inode->i_mtime = inode->i_atime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime =current_time (inode);mark_inode_dirty (inode);set_bit (QDF_REFRESH , &qd->qd_flags); }
fs/gfs2/xattr.c +4 -4
@@ -309,7 +309,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) { - ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_trans_add_meta (ip->i_gl, dibh);gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
@@ -775,7 +775,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er, error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) { - ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_trans_add_meta (ip->i_gl, dibh);gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
@@ -910,7 +910,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh, error =gfs2_meta_inode_buffer (ip, &dibh);if (error) goto out; - ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_trans_add_meta (ip->i_gl, dibh);gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
@@ -1133,7 +1133,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el) error =gfs2_meta_inode_buffer (ip, &dibh);if (!error) { - ip->i_inode.i_ctime =CURRENT_TIME ; + ip->i_inode.i_ctime =current_time (&ip->i_inode);gfs2_trans_add_meta (ip->i_gl, dibh);gfs2_dinode_out (ip, dibh->b_data);brelse (dibh);
fs/hugetlbfs/inode.c +5 -5
@@ -657,7 +657,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,if (!(mode &FALLOC_FL_KEEP_SIZE ) && offset + len > inode->i_size)i_size_write (inode, offset + len); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode); out:inode_unlock (inode);return error;
@@ -702,7 +702,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, inode->i_mode =S_IFDIR | config->mode; inode->i_uid = config->uid; inode->i_gid = config->gid; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); info =HUGETLBFS_I (inode);mpol_shared_policy_init (&info->policy,NULL ); inode->i_op = &hugetlbfs_dir_inode_operations;
@@ -741,7 +741,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,lockdep_set_class (&inode->i_mapping->i_mmap_rwsem, &hugetlbfs_i_mmap_rwsem_key); inode->i_mapping->a_ops = &hugetlbfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_mapping->private_data = resv_map; info =HUGETLBFS_I (inode);/*
@@ -790,7 +790,7 @@ static int hugetlbfs_mknod(struct inode *dir, inode =hugetlbfs_get_inode (dir->i_sb, dir, mode, dev);if (inode) { - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);d_instantiate (dentry, inode);dget (dentry);/* Extra count - pin the dentry in core */ error =0 ;
@@ -827,7 +827,7 @@ static int hugetlbfs_symlink(struct inode *dir, }else iput (inode); } - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);return error; }
fs/jfs/acl.c +1 -1
@@ -81,7 +81,7 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type, rc =posix_acl_equiv_mode (acl, &inode->i_mode);if (rc <0 )return rc; - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode);if (rc ==0 ) acl =NULL ;
fs/jfs/inode.c +1 -1
@@ -403,7 +403,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length)break ; } - ip->i_mtime = ip->i_ctime =CURRENT_TIME ; + ip->i_mtime = ip->i_ctime =current_time (ip);mark_inode_dirty (ip);txCommit (tid,1 , &ip,0 );
fs/jfs/jfs_inode.c +1 -1
@@ -131,7 +131,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) jfs_inode->mode2 |= inode->i_mode; inode->i_blocks =0 ; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); jfs_inode->otime = inode->i_ctime.tv_sec; inode->i_generation =JFS_SBI (sb)->gengen++;
fs/jfs/namei.c +11 -11
@@ -162,7 +162,7 @@ static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode,mark_inode_dirty (ip); - dip->i_ctime = dip->i_mtime =CURRENT_TIME ; + dip->i_ctime = dip->i_mtime =current_time (dip);mark_inode_dirty (dip);
@@ -298,7 +298,7 @@ static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode)/* update parent directory inode */ inc_nlink (dip);/* for '..' from child directory */ - dip->i_ctime = dip->i_mtime =CURRENT_TIME ; + dip->i_ctime = dip->i_mtime =current_time (dip);mark_inode_dirty (dip); rc =txCommit (tid,2 , &iplist[0 ],0 );
@@ -406,7 +406,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry)/* update parent directory's link count corresponding * to ".." entry of the target directory deleted */ - dip->i_ctime = dip->i_mtime =CURRENT_TIME ; + dip->i_ctime = dip->i_mtime =current_time (dip);inode_dec_link_count (dip);/*
@@ -528,7 +528,7 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry)ASSERT (ip->i_nlink); - ip->i_ctime = dip->i_ctime = dip->i_mtime =CURRENT_TIME ; + ip->i_ctime = dip->i_ctime = dip->i_mtime =current_time (ip);mark_inode_dirty (dip);/* update target's inode */
@@ -838,8 +838,8 @@ static int jfs_link(struct dentry *old_dentry,/* update object inode */ inc_nlink (ip);/* for new link */ - ip->i_ctime =CURRENT_TIME ; - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + ip->i_ctime =current_time (ip); + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty (dir);ihold (ip);
@@ -1039,7 +1039,7 @@ static int jfs_symlink(struct inode *dip, struct dentry *dentry,mark_inode_dirty (ip); - dip->i_ctime = dip->i_mtime =CURRENT_TIME ; + dip->i_ctime = dip->i_mtime =current_time (dip);mark_inode_dirty (dip);/* * commit update of parent directory and link object
@@ -1215,7 +1215,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, tblk->xflag |=COMMIT_DELETE ; tblk->u.ip = new_ip; }else { - new_ip->i_ctime =CURRENT_TIME ; + new_ip->i_ctime =current_time (new_ip);mark_inode_dirty (new_ip); } }else {
@@ -1278,7 +1278,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,/* * Update ctime on changed/moved inodes & mark dirty */ - old_ip->i_ctime =CURRENT_TIME ; + old_ip->i_ctime =current_time (old_ip);mark_inode_dirty (old_ip); new_dir->i_ctime = new_dir->i_mtime =current_fs_time (new_dir->i_sb);
@@ -1293,7 +1293,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,if (old_dir != new_dir) { iplist[ipcount++] = new_dir; - old_dir->i_ctime = old_dir->i_mtime =CURRENT_TIME ; + old_dir->i_ctime = old_dir->i_mtime =current_time (old_dir);mark_inode_dirty (old_dir); }
@@ -1426,7 +1426,7 @@ static int jfs_mknod(struct inode *dir, struct dentry *dentry,mark_inode_dirty (ip); - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty (dir);
fs/jfs/super.c +1 -1
@@ -830,7 +830,7 @@ out:if (inode->i_size < off+len-towrite)i_size_write (inode, off+len-towrite); inode->i_version++; - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty (inode);inode_unlock (inode);return len - towrite;
fs/jfs/xattr.c +1 -1
@@ -658,7 +658,7 @@ static int ea_put(tid_t tid, struct inode *inode, struct ea_buffer *ea_buf,if (old_blocks)dquot_free_block (inode, old_blocks); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);return 0 ; }
fs/libfs.c +7 -7
@@ -234,7 +234,7 @@ struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,*/ root->i_ino =1 ; root->i_mode =S_IFDIR |S_IRUSR |S_IWUSR ; - root->i_atime = root->i_mtime = root->i_ctime =CURRENT_TIME ; + root->i_atime = root->i_mtime = root->i_ctime =current_time (root); dentry =__d_alloc (s, &d_name);if (!dentry) {iput (root);
@@ -264,7 +264,7 @@ int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *den {struct inode *inode =d_inode (old_dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (inode);inc_nlink (inode);ihold (inode);dget (dentry);
@@ -298,7 +298,7 @@ int simple_unlink(struct inode *dir, struct dentry *dentry) {struct inode *inode =d_inode (dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (inode);drop_nlink (inode);dput (dentry);return 0 ;
@@ -338,7 +338,7 @@ int simple_rename(struct inode *old_dir, struct dentry *old_dentry, } old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = - new_dir->i_mtime = inode->i_ctime =CURRENT_TIME ; + new_dir->i_mtime = inode->i_ctime =current_time (old_dir);return 0 ; }
@@ -489,7 +489,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic,*/ inode->i_ino =1 ; inode->i_mode =S_IFDIR |0755 ; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations;set_nlink (inode,2 );
@@ -515,7 +515,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic, goto out; } inode->i_mode =S_IFREG | files->mode; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_fop = files->ops; inode->i_ino = i;d_add (dentry, inode);
@@ -1061,7 +1061,7 @@ struct inode *alloc_anon_inode(struct super_block *s) inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid (); inode->i_flags |=S_PRIVATE ; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);return inode; }EXPORT_SYMBOL (alloc_anon_inode);
fs/logfs/dir.c +3 -3
@@ -226,7 +226,7 @@ static int logfs_unlink(struct inode *dir, struct dentry *dentry) ta->state =UNLINK_1 ; ta->ino = inode->i_ino; - inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (inode); page =logfs_get_dd_page (dir, dentry);if (!page) {
@@ -540,7 +540,7 @@ static int logfs_link(struct dentry *old_dentry, struct inode *dir, {struct inode *inode =d_inode (old_dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (inode);ihold (inode);inc_nlink (inode);mark_inode_dirty_sync (inode);
@@ -573,7 +573,7 @@ static int logfs_delete_dd(struct inode *dir, loff_t pos)* (crc-protected) journal. */ BUG_ON (beyond_eof (dir, pos)); - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);log_dir (" Delete dentry (%lx, %llx)\n" , dir->i_ino, pos);return logfs_delete (dir, pos,NULL ); }
fs/logfs/file.c +1 -1
@@ -211,7 +211,7 @@ long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) li->li_flags = flags;inode_unlock (inode); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);mark_inode_dirty_sync (inode);return 0 ;
fs/logfs/inode.c +2 -2
@@ -213,8 +213,8 @@ static void logfs_init_inode(struct super_block *sb, struct inode *inode)i_gid_write (inode,0 ); inode->i_size =0 ; inode->i_blocks =0 ; - inode->i_ctime =CURRENT_TIME ; - inode->i_mtime =CURRENT_TIME ; + inode->i_ctime =current_time (inode); + inode->i_mtime =current_time (inode); li->li_refcount =1 ;INIT_LIST_HEAD (&li->li_freeing_list);
fs/logfs/readwrite.c +2 -2
@@ -1546,7 +1546,7 @@ static int __logfs_write_buf(struct inode *inode, struct page *page, long flags)int err; flags |=WF_WRITE |WF_DELETE ; - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode);logfs_unpack_index (index, &bix, &level);if (logfs_block (page) &&logfs_block (page)->reserved_bytes)
@@ -1578,7 +1578,7 @@ static int __logfs_delete(struct inode *inode, struct page *page)long flags =WF_DELETE ;int err; - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode);if (page->index <I0_BLOCKS )return logfs_write_direct (inode, page, flags);
fs/nilfs2/dir.c +3 -3
@@ -438,7 +438,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de,nilfs_set_de_type (de, inode);nilfs_commit_chunk (page, mapping, from, to);nilfs_put_page (page); - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir); }/*
@@ -528,7 +528,7 @@ got_it: de->inode =cpu_to_le64 (inode->i_ino);nilfs_set_de_type (de, inode);nilfs_commit_chunk (page, page->mapping, from, to); - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir);nilfs_mark_inode_dirty (dir);/* OFFSET_CACHE */ out_put:
@@ -576,7 +576,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) pde->rec_len =nilfs_rec_len_to_disk (to - from); dir->inode =0 ;nilfs_commit_chunk (page, mapping, from, to); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode); out:nilfs_put_page (page);return err;
fs/nilfs2/inode.c +2 -2
@@ -367,7 +367,7 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode)atomic64_inc (&root->inodes_count);inode_init_owner (inode, dir, mode); inode->i_ino = ino; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);if (S_ISREG (mode) ||S_ISDIR (mode) ||S_ISLNK (mode)) { err =nilfs_bmap_read (ii->i_bmap,NULL );
@@ -749,7 +749,7 @@ void nilfs_truncate(struct inode *inode)nilfs_truncate_bmap (ii, blkoff); - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode);if (IS_SYNC (inode))nilfs_set_transaction_flag (NILFS_TI_SYNC );
fs/nilfs2/ioctl.c +1 -1
@@ -174,7 +174,7 @@ static int nilfs_ioctl_setflags(struct inode *inode, struct file *filp, (flags &FS_FL_USER_MODIFIABLE );nilfs_set_inode_flags (inode); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);if (IS_SYNC (inode))nilfs_set_transaction_flag (NILFS_TI_SYNC );
fs/nilfs2/namei.c +3 -3
@@ -194,7 +194,7 @@ static int nilfs_link(struct dentry *old_dentry, struct inode *dir,if (err)return err; - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);inode_inc_link_count (inode);ihold (inode);
@@ -391,7 +391,7 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry, goto out_dir;nilfs_set_link (new_dir, new_de, new_page, old_inode);nilfs_mark_inode_dirty (new_dir); - new_inode->i_ctime =CURRENT_TIME ; + new_inode->i_ctime =current_time (new_inode);if (dir_de)drop_nlink (new_inode);drop_nlink (new_inode);
@@ -410,7 +410,7 @@ static int nilfs_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime =CURRENT_TIME ; + old_inode->i_ctime =current_time (old_inode);nilfs_delete_entry (old_de, old_page);
fs/nsfs.c +1 -1
@@ -82,7 +82,7 @@ slow:return ERR_PTR (-ENOMEM ); } inode->i_ino = ns->inum; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_flags |=S_IMMUTABLE ; inode->i_mode =S_IFREG |S_IRUGO ; inode->i_fop = &ns_file_operations;
fs/ocfs2/acl.c +1 -1
@@ -201,7 +201,7 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, } inode->i_mode = new_mode; - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode); di->i_mode =cpu_to_le16 (inode->i_mode); di->i_ctime =cpu_to_le64 (inode->i_ctime.tv_sec); di->i_ctime_nsec =cpu_to_le32 (inode->i_ctime.tv_nsec);
fs/ocfs2/alloc.c +1 -1
@@ -7274,7 +7274,7 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, } inode->i_blocks =ocfs2_inode_sector_count (inode); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode); di->i_ctime = di->i_mtime =cpu_to_le64 (inode->i_ctime.tv_sec); di->i_ctime_nsec = di->i_mtime_nsec =cpu_to_le32 (inode->i_ctime.tv_nsec);
fs/ocfs2/aops.c +1 -1
@@ -2057,7 +2057,7 @@ out_write_size: } inode->i_blocks =ocfs2_inode_sector_count (inode); di->i_size =cpu_to_le64 ((u64 )i_size_read (inode)); - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode); di->i_mtime = di->i_ctime =cpu_to_le64 (inode->i_mtime.tv_sec); di->i_mtime_nsec = di->i_ctime_nsec =cpu_to_le32 (inode->i_mtime.tv_nsec);ocfs2_update_inode_fsync_trans (handle, inode,1 );
fs/ocfs2/dir.c +2 -2
@@ -1677,7 +1677,7 @@ int __ocfs2_add_entry(handle_t *handle, offset, ocfs2_dir_trailer_blk_off(dir->i_sb));if (ocfs2_dirent_would_fit (de, rec_len)) { - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir); retval =ocfs2_mark_inode_dirty (handle, dir, parent_fe_bh);if (retval <0 ) {mlog_errno (retval);
@@ -2990,7 +2990,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,ocfs2_dinode_new_extent_list (dir, di);i_size_write (dir, sb->s_blocksize); - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir); di->i_size =cpu_to_le64 (sb->s_blocksize); di->i_ctime = di->i_mtime =cpu_to_le64 (dir->i_ctime.tv_sec);
fs/ocfs2/dlmfs/dlmfs.c +2 -2
@@ -398,7 +398,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb)if (inode) { inode->i_ino =get_next_ino ();inode_init_owner (inode,NULL , mode); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);inc_nlink (inode); inode->i_fop = &simple_dir_operations;
@@ -421,7 +421,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent, inode->i_ino =get_next_ino ();inode_init_owner (inode, parent, mode); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); ip =DLMFS_I (inode); ip->ip_conn =DLMFS_I (parent)->ip_conn;
fs/ocfs2/file.c +6 -6
@@ -253,7 +253,7 @@ int ocfs2_should_update_atime(struct inode *inode,return 0 ; } - now =CURRENT_TIME ; + now =current_time (inode);if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum))return 0 ;else
@@ -287,7 +287,7 @@ int ocfs2_update_inode_atime(struct inode *inode,* have i_mutex to guard against concurrent changes to other * inode fields. */ - inode->i_atime =CURRENT_TIME ; + inode->i_atime =current_time (inode); di->i_atime =cpu_to_le64 (inode->i_atime.tv_sec); di->i_atime_nsec =cpu_to_le32 (inode->i_atime.tv_nsec);ocfs2_update_inode_fsync_trans (handle, inode,0 );
@@ -308,7 +308,7 @@ int ocfs2_set_inode_size(handle_t *handle,i_size_write (inode, new_i_size); inode->i_blocks =ocfs2_inode_sector_count (inode); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode); status =ocfs2_mark_inode_dirty (handle, inode, fe_bh);if (status <0 ) {
@@ -429,7 +429,7 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, }i_size_write (inode, new_i_size); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode); di = (struct ocfs2_dinode *) fe_bh->b_data; di->i_size =cpu_to_le64 (new_i_size);
@@ -840,7 +840,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,i_size_write (inode, abs_to); inode->i_blocks =ocfs2_inode_sector_count (inode); di->i_size =cpu_to_le64 ((u64 )i_size_read (inode)); - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode); di->i_mtime = di->i_ctime =cpu_to_le64 (inode->i_mtime.tv_sec); di->i_ctime_nsec =cpu_to_le32 (inode->i_mtime.tv_nsec); di->i_mtime_nsec = di->i_ctime_nsec;
@@ -1936,7 +1936,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,if (change_size &&i_size_read (inode) < size)i_size_write (inode, size); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode); ret =ocfs2_mark_inode_dirty (handle, inode, di_bh);if (ret <0 )mlog_errno (ret);
fs/ocfs2/move_extents.c +1 -1
@@ -953,7 +953,7 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context) } di = (struct ocfs2_dinode *)di_bh->b_data; - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode); di->i_ctime =cpu_to_le64 (inode->i_ctime.tv_sec); di->i_ctime_nsec =cpu_to_le32 (inode->i_ctime.tv_nsec);ocfs2_update_inode_fsync_trans (handle, inode,0 );
fs/ocfs2/namei.c +9 -7
@@ -516,6 +516,7 @@ static int __ocfs2_mknod_locked(struct inode *dir,struct ocfs2_extent_list *fel;u16 feat;struct ocfs2_inode_info *oi =OCFS2_I (inode); +struct timespec ts; *new_fe_bh =NULL ;
@@ -564,10 +565,11 @@ static int __ocfs2_mknod_locked(struct inode *dir, fe->i_last_eb_blk =0 ;strcpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); fe->i_flags |=cpu_to_le32 (OCFS2_VALID_FL ); + ts =current_time (inode); fe->i_atime = fe->i_ctime = fe->i_mtime = -cpu_to_le64 (CURRENT_TIME .tv_sec); +cpu_to_le64 (ts.tv_sec); fe->i_mtime_nsec = fe->i_ctime_nsec = fe->i_atime_nsec = -cpu_to_le32 (CURRENT_TIME .tv_nsec); +cpu_to_le32 (ts.tv_nsec); fe->i_dtime =0 ;/*
@@ -798,7 +800,7 @@ static int ocfs2_link(struct dentry *old_dentry, }inc_nlink (inode); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);ocfs2_set_links_count (fe, inode->i_nlink); fe->i_ctime =cpu_to_le64 (inode->i_ctime.tv_sec); fe->i_ctime_nsec =cpu_to_le32 (inode->i_ctime.tv_nsec);
@@ -1000,7 +1002,7 @@ static int ocfs2_unlink(struct inode *dir,ocfs2_set_links_count (fe, inode->i_nlink);ocfs2_journal_dirty (handle, fe_bh); - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);if (S_ISDIR (inode->i_mode))drop_nlink (dir);
@@ -1537,7 +1539,7 @@ static int ocfs2_rename(struct inode *old_dir, new_dir_bh, &target_insert); } - old_inode->i_ctime =CURRENT_TIME ; + old_inode->i_ctime =current_time (old_inode);mark_inode_dirty (old_inode); status = ocfs2_journal_access_di(handle, INODE_CACHE(old_inode),
@@ -1586,9 +1588,9 @@ static int ocfs2_rename(struct inode *old_dir,if (new_inode) {drop_nlink (new_inode); - new_inode->i_ctime =CURRENT_TIME ; + new_inode->i_ctime =current_time (new_inode); } - old_dir->i_ctime = old_dir->i_mtime =CURRENT_TIME ; + old_dir->i_ctime = old_dir->i_mtime =current_time (old_dir);if (update_dot_dot) { status = ocfs2_update_entry(old_inode, handle,
fs/ocfs2/refcounttree.c +2 -2
@@ -3778,7 +3778,7 @@ static int ocfs2_change_ctime(struct inode *inode, goto out_commit; } - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode); di->i_ctime =cpu_to_le64 (inode->i_ctime.tv_sec); di->i_ctime_nsec =cpu_to_le32 (inode->i_ctime.tv_nsec);
@@ -4094,7 +4094,7 @@ static int ocfs2_complete_reflink(struct inode *s_inode,* we want mtime to appear identical to the source and * update ctime. */ - t_inode->i_ctime =CURRENT_TIME ; + t_inode->i_ctime =current_time (t_inode); di->i_ctime =cpu_to_le64 (t_inode->i_ctime.tv_sec); di->i_ctime_nsec =cpu_to_le32 (t_inode->i_ctime.tv_nsec);
fs/ocfs2/xattr.c +1 -1
@@ -3431,7 +3431,7 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, goto out; } - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode); di->i_ctime =cpu_to_le64 (inode->i_ctime.tv_sec); di->i_ctime_nsec =cpu_to_le32 (inode->i_ctime.tv_nsec);ocfs2_journal_dirty (ctxt->handle, xis->inode_bh);
fs/omfs/inode.c +1 -1
@@ -49,7 +49,7 @@ struct inode *omfs_new_inode(struct inode *dir, umode_t mode)inode_init_owner (inode,NULL , mode); inode->i_mapping->a_ops = &omfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);switch (mode &S_IFMT ) {case S_IFDIR : inode->i_op = &omfs_dir_inops;
fs/openpromfs/inode.c +1 -1
@@ -355,7 +355,7 @@ static struct inode *openprom_iget(struct super_block *sb, ino_t ino)if (!inode)return ERR_PTR (-ENOMEM );if (inode->i_state &I_NEW ) { - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);if (inode->i_ino ==OPENPROM_ROOT_INO ) { inode->i_op = &openprom_inode_operations; inode->i_fop = &openprom_operations;
fs/orangefs/file.c +1 -1
@@ -358,7 +358,7 @@ out:file_accessed (file); }else {SetMtimeFlag (orangefs_inode); - inode->i_mtime =CURRENT_TIME ; + inode->i_mtime =current_time (inode);mark_inode_dirty_sync (inode); } }
fs/orangefs/inode.c +1 -1
@@ -441,7 +441,7 @@ struct inode *orangefs_new_inode(struct super_block *sb, struct inode *dir, inode->i_mode = mode; inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid (); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_size =PAGE_SIZE ; inode->i_rdev = dev;
fs/orangefs/namei.c +1 -1
@@ -435,7 +435,7 @@ static int orangefs_rename(struct inode *old_dir, ret);if (new_dentry->d_inode) - new_dentry->d_inode->i_ctime =CURRENT_TIME ; + new_dentry->d_inode->i_ctime =current_time (new_dentry->d_inode);op_release (new_op);return ret;
fs/pipe.c +1 -1
@@ -718,7 +718,7 @@ static struct inode * get_pipe_inode(void) inode->i_mode =S_IFIFO |S_IRUSR |S_IWUSR ; inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid (); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);return inode;
fs/posix_acl.c +1 -1
@@ -893,7 +893,7 @@ int simple_set_acl(struct inode *inode, struct posix_acl *acl, int type) acl =NULL ; } - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode);set_cached_acl (inode, type, acl);return 0 ; }
fs/proc/base.c +1 -1
@@ -1662,7 +1662,7 @@ struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *t/* Common stuff */ ei =PROC_I (inode); inode->i_ino =get_next_ino (); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_op = &proc_def_inode_operations;/*
fs/proc/inode.c +2 -2
@@ -68,7 +68,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb) ei->sysctl_entry =NULL ; ei->ns_ops =NULL ; inode = &ei->vfs_inode; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);return inode; }
@@ -421,7 +421,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)if (inode) { inode->i_ino = de->low_ino; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);PROC_I (inode)->pde = de;if (is_empty_pde (de)) {
fs/proc/proc_sysctl.c +1 -1
@@ -444,7 +444,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, ei->sysctl = head; ei->sysctl_entry = table; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_mode = table->mode;if (!S_ISDIR (table->mode)) { inode->i_mode |=S_IFREG ;
fs/proc/self.c +1 -1
@@ -56,7 +56,7 @@ int proc_setup_self(struct super_block *s)struct inode *inode =new_inode_pseudo (s);if (inode) { inode->i_ino = self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_mode =S_IFLNK |S_IRWXUGO ; inode->i_uid =GLOBAL_ROOT_UID ; inode->i_gid =GLOBAL_ROOT_GID ;
fs/proc/thread_self.c +1 -1
@@ -58,7 +58,7 @@ int proc_setup_thread_self(struct super_block *s)struct inode *inode =new_inode_pseudo (s);if (inode) { inode->i_ino = thread_self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_mode =S_IFLNK |S_IRWXUGO ; inode->i_uid =GLOBAL_ROOT_UID ; inode->i_gid =GLOBAL_ROOT_GID ;
fs/pstore/inode.c +1 -1
@@ -230,7 +230,7 @@ static struct inode *pstore_get_inode(struct super_block *sb)struct inode *inode =new_inode (sb);if (inode) { inode->i_ino =get_next_ino (); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); }return inode; }
fs/ramfs/inode.c +3 -3
@@ -61,7 +61,7 @@ struct inode *ramfs_get_inode(struct super_block *sb, inode->i_mapping->a_ops = &ramfs_aops;mapping_set_gfp_mask (inode->i_mapping,GFP_HIGHUSER );mapping_set_unevictable (inode->i_mapping); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);switch (mode &S_IFMT ) {default :init_special_inode (inode, mode, dev);
@@ -100,7 +100,7 @@ ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev)d_instantiate (dentry, inode);dget (dentry);/* Extra count - pin the dentry in core */ error =0 ; - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir); }return error; }
@@ -130,7 +130,7 @@ static int ramfs_symlink(struct inode * dir, struct dentry *dentry, const char *if (!error) {d_instantiate (dentry, inode);dget (dentry); - dir->i_mtime = dir->i_ctime =CURRENT_TIME ; + dir->i_mtime = dir->i_ctime =current_time (dir); }else iput (inode); }
fs/reiserfs/super.c +1 -1
@@ -2512,7 +2512,7 @@ out:if (inode->i_size < off + len - towrite)i_size_write (inode, off + len - towrite); inode->i_version++; - inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty (inode);return len - towrite; }
fs/tracefs/inode.c +1 -1
@@ -133,7 +133,7 @@ static struct inode *tracefs_get_inode(struct super_block *sb)struct inode *inode =new_inode (sb);if (inode) { inode->i_ino =get_next_ino (); - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); }return inode; }
fs/ufs/ialloc.c +4 -2
@@ -176,6 +176,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode)struct ufs_cg_private_info * ucpi;struct ufs_cylinder_group * ucg;struct inode * inode; +struct timespec ts;unsigned cg, bit, i, j, start;struct ufs_inode_info *ufsi;int err = -ENOSPC ;
@@ -323,8 +324,9 @@ cg_found:lock_buffer (bh); ufs2_inode = (struct ufs2_inode *)bh->b_data; ufs2_inode +=ufs_inotofsbo (inode->i_ino); - ufs2_inode->ui_birthtime =cpu_to_fs64 (sb,CURRENT_TIME .tv_sec); - ufs2_inode->ui_birthnsec =cpu_to_fs32 (sb,CURRENT_TIME .tv_nsec); + ts =current_time (inode); + ufs2_inode->ui_birthtime =cpu_to_fs64 (sb, ts.tv_sec); + ufs2_inode->ui_birthnsec =cpu_to_fs32 (sb, ts.tv_nsec);mark_buffer_dirty (bh);unlock_buffer (bh);if (sb->s_flags &MS_SYNCHRONOUS )
ipc/mqueue.c +9 -9
@@ -225,7 +225,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, inode->i_mode = mode; inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid (); - inode->i_mtime = inode->i_ctime = inode->i_atime =CURRENT_TIME ; + inode->i_mtime = inode->i_ctime = inode->i_atime =current_time (inode);if (S_ISREG (mode)) {struct mqueue_inode_info *info;
@@ -448,7 +448,7 @@ static int mqueue_create(struct inode *dir, struct dentry *dentry,put_ipc_ns (ipc_ns); dir->i_size +=DIRENT_SIZE ; - dir->i_ctime = dir->i_mtime = dir->i_atime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime = dir->i_atime =current_time (dir);d_instantiate (dentry, inode);dget (dentry);
@@ -464,7 +464,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) {struct inode *inode =d_inode (dentry); - dir->i_ctime = dir->i_mtime = dir->i_atime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime = dir->i_atime =current_time (dir); dir->i_size -=DIRENT_SIZE ;drop_nlink (inode);dput (dentry);
@@ -502,7 +502,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data,if (ret <=0 )return ret; -file_inode (filp)->i_atime =file_inode (filp)->i_ctime =CURRENT_TIME ; +file_inode (filp)->i_atime =file_inode (filp)->i_ctime =current_time (file_inode (filp));return ret; }
@@ -1062,7 +1062,7 @@ SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr,__do_notify (info); } inode->i_atime = inode->i_mtime = inode->i_ctime = -CURRENT_TIME ; +current_time (inode); } out_unlock:spin_unlock (&info->lock);
@@ -1158,7 +1158,7 @@ SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, msg_ptr =msg_get (info); inode->i_atime = inode->i_mtime = inode->i_ctime = -CURRENT_TIME ; +current_time (inode);/* There is now free space in queue. */ pipelined_receive (&wake_q, info);
@@ -1279,7 +1279,7 @@ retry:if (u_notification ==NULL ) {if (info->notify_owner ==task_tgid (current)) {remove_notification (info); - inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_ctime =current_time (inode); } }else if (info->notify_owner !=NULL ) { ret = -EBUSY ;
@@ -1304,7 +1304,7 @@ retry: info->notify_owner =get_pid (task_tgid (current)); info->notify_user_ns =get_user_ns (current_user_ns ()); - inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_ctime =current_time (inode); }spin_unlock (&info->lock); out_fput:
@@ -1361,7 +1361,7 @@ SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, f.file->f_flags &= ~O_NONBLOCK ;spin_unlock (&f.file->f_lock); - inode->i_atime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_ctime =current_time (inode); }spin_unlock (&info->lock);
kernel/bpf/inode.c +1 -1
@@ -97,7 +97,7 @@ static struct inode *bpf_get_inode(struct super_block *sb,return ERR_PTR (-ENOSPC ); inode->i_ino =get_next_ino (); - inode->i_atime =CURRENT_TIME ; + inode->i_atime =current_time (inode); inode->i_mtime = inode->i_atime; inode->i_ctime = inode->i_atime;
mm/shmem.c +10 -10
@@ -616,7 +616,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,void shmem_truncate_range (struct inode *inode,loff_t lstart,loff_t lend) {shmem_undo_range (inode, lstart, lend, false); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode); }EXPORT_SYMBOL_GPL (shmem_truncate_range);
@@ -660,7 +660,7 @@ static int shmem_setattr(struct dentry *dentry, struct iattr *attr)if (error)return error;i_size_write (inode, newsize); - inode->i_ctime = inode->i_mtime =CURRENT_TIME ; + inode->i_ctime = inode->i_mtime =current_time (inode); }if (newsize <= oldsize) {loff_t holebegin =round_up (newsize,PAGE_SIZE );
@@ -1497,7 +1497,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode inode->i_ino =get_next_ino ();inode_init_owner (inode, dir, mode); inode->i_blocks =0 ; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_generation =get_seconds (); info =SHMEM_I (inode);memset (info,0 , (char *)inode - (char *)info);
@@ -2254,7 +2254,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,if (!(mode &FALLOC_FL_KEEP_SIZE ) && offset + len > inode->i_size)i_size_write (inode, offset + len); - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (inode); undone:spin_lock (&inode->i_lock); inode->i_private =NULL ;
@@ -2307,7 +2307,7 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) error =0 ; dir->i_size +=BOGO_DIRENT_SIZE ; - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);d_instantiate (dentry, inode);dget (dentry);/* Extra count - pin the dentry in core */ }
@@ -2375,7 +2375,7 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr goto out; dir->i_size +=BOGO_DIRENT_SIZE ; - inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (inode);inc_nlink (inode);ihold (inode);/* New dentry reference */ dget (dentry);/* Extra pinning count for the created dentry */
@@ -2392,7 +2392,7 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry)shmem_free_inode (inode->i_sb); dir->i_size -=BOGO_DIRENT_SIZE ; - inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (inode);drop_nlink (inode);dput (dentry);/* Undo the count from "create" - this does all the work */ return 0 ;
@@ -2425,7 +2425,7 @@ static int shmem_exchange(struct inode *old_dir, struct dentry *old_dentry, stru old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = new_dir->i_mtime =d_inode (old_dentry)->i_ctime = -d_inode (new_dentry)->i_ctime =CURRENT_TIME ; +d_inode (new_dentry)->i_ctime =current_time (old_dir);return 0 ; }
@@ -2499,7 +2499,7 @@ static int shmem_rename2(struct inode *old_dir, struct dentry *old_dentry, struc new_dir->i_size +=BOGO_DIRENT_SIZE ; old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = new_dir->i_mtime = - inode->i_ctime =CURRENT_TIME ; + inode->i_ctime =current_time (old_dir);return 0 ; }
@@ -2554,7 +2554,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *sput_page (page); } dir->i_size +=BOGO_DIRENT_SIZE ; - dir->i_ctime = dir->i_mtime =CURRENT_TIME ; + dir->i_ctime = dir->i_mtime =current_time (dir);d_instantiate (dentry, inode);dget (dentry);return 0 ;
net/sunrpc/rpc_pipe.c +1 -1
@@ -477,7 +477,7 @@ rpc_get_inode(struct super_block *sb, umode_t mode)return NULL ; inode->i_ino =get_next_ino (); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode);switch (mode &S_IFMT ) {case S_IFDIR : inode->i_fop = &simple_dir_operations;
security/inode.c +1 -1
@@ -117,7 +117,7 @@ struct dentry *securityfs_create_file(const char *name, umode_t mode, inode->i_ino =get_next_ino (); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime =CURRENT_TIME ; + inode->i_atime = inode->i_mtime = inode->i_ctime =current_time (inode); inode->i_private = data;if (is_dir) { inode->i_op = &simple_dir_inode_operations;
security/selinux/selinuxfs.c +1 -1
@@ -1089,7 +1089,7 @@ static struct inode *sel_make_inode(struct super_block *sb, int mode)if (ret) { ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime =CURRENT_TIME ; + ret->i_atime = ret->i_mtime = ret->i_ctime =current_time (ret); }return ret; }
Signature · 1 line
1.9.1
PATCH v2 3/24 fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps
In reply to Deepa DinamaniCURRENT_TIME_SEC is not y2038 safe. current_time() will be transitioned to use 64 bit time along with vfs in a separate patch.
There is no plan to transistion CURRENT_TIME_SEC to use y2038 safe time interfaces.
current_time() will also be extended to use superblock range checking parameters when range checking is introduced.
This works because alloc_super() fills in the the s_time_gran in super block to NSEC_PER_SEC.
Also note that filesystem specific times like the birthtime, creation time that were using same interfaces to obtain time retain same logistics.
--- fs/affs/amigaffs.c | 6 +++--- fs/affs/inode.c | 2 +- fs/bfs/dir.c | 14 +++++++------- fs/coda/dir.c | 2 +- fs/coda/file.c | 2 +- fs/coda/inode.c | 2 +- fs/ext2/acl.c | 2 +- fs/ext2/dir.c | 6 +++--- fs/ext2/ialloc.c | 2 +- fs/ext2/inode.c | 4 ++-- fs/ext2/ioctl.c | 4 ++-- fs/ext2/namei.c | 6 +++--- fs/ext2/xattr.c | 2 +- fs/fat/dir.c | 2 +- fs/fat/file.c | 4 ++-- fs/fat/inode.c | 2 +- fs/fat/namei_msdos.c | 12 ++++++------ fs/fat/namei_vfat.c | 10 +++++----- fs/hfs/catalog.c | 8 ++++---- fs/hfs/dir.c | 2 +- fs/hfs/inode.c | 2 +- fs/hfsplus/catalog.c | 8 ++++---- fs/hfsplus/dir.c | 6 +++--- fs/hfsplus/inode.c | 2 +- fs/hfsplus/ioctl.c | 2 +- fs/jffs2/acl.c | 2 +- fs/jffs2/fs.c | 2 +- fs/minix/bitmap.c | 2 +- fs/minix/dir.c | 6 +++--- fs/minix/itree_common.c | 4 ++-- fs/minix/namei.c | 4 ++-- fs/omfs/dir.c | 4 ++-- fs/reiserfs/inode.c | 2 +- fs/reiserfs/ioctl.c | 4 ++-- fs/reiserfs/namei.c | 12 ++++++------ fs/reiserfs/stree.c | 8 ++++---- fs/reiserfs/xattr.c | 2 +- fs/reiserfs/xattr_acl.c | 2 +- fs/sysv/dir.c | 6 +++--- fs/sysv/ialloc.c | 2 +- fs/sysv/itree.c | 4 ++-- fs/sysv/namei.c | 4 ++-- fs/ufs/dir.c | 6 +++--- fs/ufs/ialloc.c | 2 +- fs/ufs/inode.c | 6 +++--- fs/ufs/namei.c | 6 +++--- 46 files changed, 102 insertions(+), 102 deletions(-)
fs/affs/amigaffs.c +3 -3
@@ -58,7 +58,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh)mark_buffer_dirty_inode (dir_bh, dir);affs_brelse (dir_bh); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir); dir->i_version++;mark_inode_dirty (dir);
@@ -112,7 +112,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)affs_brelse (bh); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir); dir->i_version++;mark_inode_dirty (dir);
@@ -313,7 +313,7 @@ affs_remove_header(struct dentry *dentry)else clear_nlink (inode);affs_unlock_link (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); done:
fs/affs/inode.c +1 -1
@@ -309,7 +309,7 @@ affs_new_inode(struct inode *dir) inode->i_gid =current_fsgid (); inode->i_ino = block;set_nlink (inode,1 ); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);atomic_set (&AFFS_I (inode)->i_opencnt,0 );AFFS_I (inode)->i_blkcnt =0 ;AFFS_I (inode)->i_lc =NULL ;
fs/bfs/dir.c +7 -7
@@ -97,7 +97,7 @@ static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,set_bit (ino, info->si_imap); info->si_freei--;inode_init_owner (inode, dir, mode); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_blocks =0 ; inode->i_op = &bfs_file_inops; inode->i_fop = &bfs_file_operations;
@@ -165,7 +165,7 @@ static int bfs_link(struct dentry *old, struct inode *dir,return err; }inc_nlink (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode);ihold (inode);d_instantiate (new, inode);
@@ -194,7 +194,7 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry) } de->ino =0 ;mark_buffer_dirty_inode (bh, dir); - dir->i_ctime = dir->i_mtime =CURRENT_TIME_SEC ; + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty (dir); inode->i_ctime = dir->i_ctime;inode_dec_link_count (inode);
@@ -249,10 +249,10 @@ static int bfs_rename(struct inode *old_dir, struct dentry *old_dentry, goto end_rename; } old_de->ino =0 ; - old_dir->i_ctime = old_dir->i_mtime =CURRENT_TIME_SEC ; + old_dir->i_ctime = old_dir->i_mtime =current_time (old_dir);mark_inode_dirty (old_dir);if (new_inode) { - new_inode->i_ctime =CURRENT_TIME_SEC ; + new_inode->i_ctime =current_time (new_inode);inode_dec_link_count (new_inode); }mark_buffer_dirty_inode (old_bh, old_dir);
@@ -300,9 +300,9 @@ static int bfs_add_entry(struct inode *dir, const unsigned char *name, pos = (block - sblock) *BFS_BSIZE + off;if (pos >= dir->i_size) { dir->i_size +=BFS_DIRENT_SIZE ; - dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_ctime =current_time (dir); } - dir->i_mtime =CURRENT_TIME_SEC ; + dir->i_mtime =current_time (dir);mark_inode_dirty (dir); de->ino =cpu_to_le16 ((u16 )ino);for (i =0 ; i <BFS_NAMELEN ; i++)
fs/coda/dir.c +1 -1
@@ -109,7 +109,7 @@ static inline void coda_dir_update_mtime(struct inode *dir)/* optimistically we can also act as if our nose bleeds. The * granularity of the mtime is coarse anyways so we might actually be * right most of the time. Note: we only do this for directories. */ - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);#endif }
fs/coda/file.c +1 -1
@@ -75,7 +75,7 @@ coda_file_write_iter(struct kiocb *iocb, struct iov_iter *to) ret =vfs_iter_write (cfi->cfi_container, to, &iocb->ki_pos); coda_inode->i_size =file_inode (host_file)->i_size; coda_inode->i_blocks = (coda_inode->i_size +511 ) >>9 ; - coda_inode->i_mtime = coda_inode->i_ctime =CURRENT_TIME_SEC ; + coda_inode->i_mtime = coda_inode->i_ctime =current_time (coda_inode);inode_unlock (coda_inode);file_end_write (host_file);return ret;
fs/coda/inode.c +1 -1
@@ -271,7 +271,7 @@ int coda_setattr(struct dentry *de, struct iattr *iattr)memset (&vattr,0 ,sizeof (vattr)); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);coda_iattr_to_vattr (iattr, &vattr); vattr.va_type =C_VNON ;/* cannot set type */
fs/ext2/acl.c +1 -1
@@ -194,7 +194,7 @@ ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type)if (error <0 )return error;else { - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode);if (error ==0 ) acl =NULL ;
fs/ext2/dir.c +3 -3
@@ -471,7 +471,7 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, err =ext2_commit_chunk (page, pos, len);ext2_put_page (page);if (update_times) - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);EXT2_I (dir)->i_flags &= ~EXT2_BTREE_FL ;mark_inode_dirty (dir); }
@@ -561,7 +561,7 @@ got_it: de->inode =cpu_to_le32 (inode->i_ino);ext2_set_de_type (de, inode); err =ext2_commit_chunk (page, pos, rec_len); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);EXT2_I (dir)->i_flags &= ~EXT2_BTREE_FL ;mark_inode_dirty (dir);/* OFFSET_CACHE */
@@ -610,7 +610,7 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) pde->rec_len =ext2_rec_len_to_disk (to - from); dir->inode =0 ; err =ext2_commit_chunk (page, pos, to - from); - inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; + inode->i_ctime = inode->i_mtime =current_time (inode);EXT2_I (inode)->i_flags &= ~EXT2_BTREE_FL ;mark_inode_dirty (inode); out:
fs/ext2/ialloc.c +1 -1
@@ -551,7 +551,7 @@ got: inode->i_ino = ino; inode->i_blocks =0 ; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);memset (ei->i_data,0 ,sizeof (ei->i_data)); ei->i_flags =ext2_mask_flags (mode,EXT2_I (dir)->i_flags &EXT2_FL_INHERITED );
fs/ext2/inode.c +2 -2
@@ -594,7 +594,7 @@ static void ext2_splice_branch(struct inode *inode,if (where->bh)mark_buffer_dirty_inode (where->bh, inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); }
@@ -1236,7 +1236,7 @@ static int ext2_setsize(struct inode *inode, loff_t newsize)__ext2_truncate_blocks (inode, newsize);dax_sem_up_write (EXT2_I (inode)); - inode->i_mtime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_ctime =current_time (inode);if (inode_needs_sync (inode)) {sync_mapping_buffers (inode->i_mapping);sync_inode_metadata (inode,1 );
fs/ext2/ioctl.c +2 -2
@@ -79,7 +79,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ei->i_flags = flags;ext2_set_inode_flags (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);inode_unlock (inode);mark_inode_dirty (inode);
@@ -103,7 +103,7 @@ setflags_out: }inode_lock (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode); inode->i_generation = generation;inode_unlock (inode);
fs/ext2/namei.c +3 -3
@@ -221,7 +221,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,if (err)return err; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);inode_inc_link_count (inode);ihold (inode);
@@ -372,7 +372,7 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,if (!new_de) goto out_dir;ext2_set_link (new_dir, new_de, new_page, old_inode,1 ); - new_inode->i_ctime =CURRENT_TIME_SEC ; + new_inode->i_ctime =current_time (new_inode);if (dir_de)drop_nlink (new_inode);inode_dec_link_count (new_inode);
@@ -388,7 +388,7 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,* Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime =CURRENT_TIME_SEC ; + old_inode->i_ctime =current_time (old_inode);mark_inode_dirty (old_inode);ext2_delete_entry (old_de, old_page);
fs/ext2/xattr.c +1 -1
@@ -691,7 +691,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,/* Update the inode. */ EXT2_I (inode)->i_file_acl = new_bh ? new_bh->b_blocknr :0 ; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);if (IS_SYNC (inode)) { error =sync_inode_metadata (inode,1 );/* In case sync failed due to ENOSPC the inode was actually
fs/fat/dir.c +1 -1
@@ -1071,7 +1071,7 @@ int fat_remove_entries(struct inode *dir, struct fat_slot_info *sinfo) } } - dir->i_mtime = dir->i_atime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_atime =current_time (dir);if (IS_DIRSYNC (dir)) (void )fat_sync_inode (dir);else
fs/fat/file.c +2 -2
@@ -194,7 +194,7 @@ static int fat_cont_expand(struct inode *inode, loff_t size)if (err) goto out; - inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; + inode->i_ctime = inode->i_mtime =current_time (inode);mark_inode_dirty (inode);if (IS_SYNC (inode)) {int err2;
@@ -297,7 +297,7 @@ static int fat_free(struct inode *inode, int skip)MSDOS_I (inode)->i_logstart =0 ; }MSDOS_I (inode)->i_attrs |=ATTR_ARCH ; - inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; + inode->i_ctime = inode->i_mtime =current_time (inode);if (wait) { err =fat_sync_inode (inode);if (err) {
fs/fat/inode.c +1 -1
@@ -237,7 +237,7 @@ static int fat_write_end(struct file *file, struct address_space *mapping,if (err < len)fat_write_failed (mapping, pos + len);if (!(err <0 ) && !(MSDOS_I (inode)->i_attrs &ATTR_ARCH )) { - inode->i_mtime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_ctime =current_time (inode);MSDOS_I (inode)->i_attrs |=ATTR_ARCH ;mark_inode_dirty (inode); }
fs/fat/namei_msdos.c +6 -6
@@ -283,7 +283,7 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode, goto out; } - ts =CURRENT_TIME_SEC ; + ts =current_time (dir); err =msdos_add_entry (dir, msdos_name,0 , is_hid,0 , &ts, &sinfo);if (err) goto out;
@@ -330,7 +330,7 @@ static int msdos_rmdir(struct inode *dir, struct dentry *dentry)drop_nlink (dir);clear_nlink (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);fat_detach (inode); out:mutex_unlock (&MSDOS_SB (sb)->s_lock);
@@ -364,7 +364,7 @@ static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) goto out; } - ts =CURRENT_TIME_SEC ; + ts =current_time (dir); cluster =fat_alloc_new_dir (dir, &ts);if (cluster <0 ) { err = cluster;
@@ -416,7 +416,7 @@ static int msdos_unlink(struct inode *dir, struct dentry *dentry)if (err) goto out;clear_nlink (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);fat_detach (inode); out:mutex_unlock (&MSDOS_SB (sb)->s_lock);
@@ -481,7 +481,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,mark_inode_dirty (old_inode); old_dir->i_version++; - old_dir->i_ctime = old_dir->i_mtime =CURRENT_TIME_SEC ; + old_dir->i_ctime = old_dir->i_mtime =current_time (old_dir);if (IS_DIRSYNC (old_dir)) (void )fat_sync_inode (old_dir);else
@@ -490,7 +490,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, } } - ts =CURRENT_TIME_SEC ; + ts =current_time (old_inode);if (new_inode) {if (err) goto out;
fs/fat/namei_vfat.c +5 -5
@@ -777,7 +777,7 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,mutex_lock (&MSDOS_SB (sb)->s_lock); - ts =CURRENT_TIME_SEC ; + ts =current_time (dir); err =vfat_add_entry (dir, &dentry->d_name,0 ,0 , &ts, &sinfo);if (err) goto out;
@@ -821,7 +821,7 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry)drop_nlink (dir);clear_nlink (inode); - inode->i_mtime = inode->i_atime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime =current_time (inode);fat_detach (inode); dentry->d_time = dir->i_version; out:
@@ -847,7 +847,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry)if (err) goto out;clear_nlink (inode); - inode->i_mtime = inode->i_atime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime =current_time (inode);fat_detach (inode); dentry->d_time = dir->i_version; out:
@@ -866,7 +866,7 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)mutex_lock (&MSDOS_SB (sb)->s_lock); - ts =CURRENT_TIME_SEC ; + ts =current_time (dir); cluster =fat_alloc_new_dir (dir, &ts);if (cluster <0 ) { err = cluster;
@@ -931,7 +931,7 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, } } - ts =CURRENT_TIME_SEC ; + ts =current_time (old_dir);if (new_inode) {if (is_dir) { err =fat_dir_empty (new_inode);
fs/hfs/catalog.c +4 -4
@@ -125,7 +125,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode * goto err1; dir->i_size++; - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir);hfs_find_exit (&fd);return 0 ;
@@ -261,7 +261,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str) } dir->i_size--; - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir); res =0 ; out:
@@ -321,7 +321,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name,if (err) goto out; dst_dir->i_size++; - dst_dir->i_mtime = dst_dir->i_ctime =CURRENT_TIME_SEC ; + dst_dir->i_mtime = dst_dir->i_ctime =current_time (dst_dir);mark_inode_dirty (dst_dir);/* finally remove the old entry */
@@ -333,7 +333,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name,if (err) goto out; src_dir->i_size--; - src_dir->i_mtime = src_dir->i_ctime =CURRENT_TIME_SEC ; + src_dir->i_mtime = src_dir->i_ctime =current_time (src_dir);mark_inode_dirty (src_dir); type = entry.type;
fs/hfs/dir.c +1 -1
@@ -268,7 +268,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry)if (res)return res;clear_nlink (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);hfs_delete_inode (inode);mark_inode_dirty (inode);return 0 ;
fs/hfs/inode.c +1 -1
@@ -193,7 +193,7 @@ struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode) inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid ();set_nlink (inode,1 ); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode);HFS_I (inode)->flags =0 ;HFS_I (inode)->rsrc_inode =NULL ;HFS_I (inode)->fs_blocks =0 ;
fs/hfsplus/catalog.c +4 -4
@@ -303,7 +303,7 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir, dir->i_size++;if (S_ISDIR (inode->i_mode))hfsplus_subfolders_inc (dir); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);hfsplus_mark_inode_dirty (dir,HFSPLUS_I_CAT_DIRTY );hfs_find_exit (&fd);
@@ -400,7 +400,7 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str) dir->i_size--;if (type ==HFSPLUS_FOLDER )hfsplus_subfolders_dec (dir); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);hfsplus_mark_inode_dirty (dir,HFSPLUS_I_CAT_DIRTY );if (type ==HFSPLUS_FILE || type ==HFSPLUS_FOLDER ) {
@@ -469,7 +469,7 @@ int hfsplus_rename_cat(u32 cnid, dst_dir->i_size++;if (type ==HFSPLUS_FOLDER )hfsplus_subfolders_inc (dst_dir); - dst_dir->i_mtime = dst_dir->i_ctime =CURRENT_TIME_SEC ; + dst_dir->i_mtime = dst_dir->i_ctime =current_time (dst_dir);/* finally remove the old entry */ err = hfsplus_cat_build_key(sb, src_fd.search_key,
@@ -486,7 +486,7 @@ int hfsplus_rename_cat(u32 cnid, src_dir->i_size--;if (type ==HFSPLUS_FOLDER )hfsplus_subfolders_dec (src_dir); - src_dir->i_mtime = src_dir->i_ctime =CURRENT_TIME_SEC ; + src_dir->i_mtime = src_dir->i_ctime =current_time (src_dir);/* remove old thread entry */ hfsplus_cat_build_key_with_cnid (sb, src_fd.search_key, cnid);
fs/hfsplus/dir.c +3 -3
@@ -347,7 +347,7 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir,inc_nlink (inode);hfsplus_instantiate (dst_dentry, inode, cnid);ihold (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); sbi->file_count++;hfsplus_mark_mdb_dirty (dst_dir->i_sb);
@@ -406,7 +406,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)hfsplus_delete_inode (inode); }else sbi->file_count--; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); out:mutex_unlock (&sbi->vh_mutex);
@@ -427,7 +427,7 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry)if (res) goto out;clear_nlink (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);hfsplus_delete_inode (inode);mark_inode_dirty (inode); out:
fs/hfsplus/inode.c +1 -1
@@ -369,7 +369,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, umode_t mode) inode->i_uid =current_fsuid (); inode->i_gid =current_fsgid ();set_nlink (inode,1 ); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); hip =HFSPLUS_I (inode);INIT_LIST_HEAD (&hip->open_dir_list);
fs/hfsplus/ioctl.c +1 -1
@@ -122,7 +122,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags)else hip->userflags &= ~HFSPLUS_FLG_NODUMP ; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); out_unlock_inode:
fs/jffs2/acl.c +1 -1
@@ -242,7 +242,7 @@ int jffs2_set_acl(struct inode *inode, struct posix_acl *acl, int type) attr.ia_valid =ATTR_MODE |ATTR_CTIME ; attr.ia_mode = mode; - attr.ia_ctime =CURRENT_TIME_SEC ; + attr.ia_ctime =current_time (inode); rc =jffs2_do_setattr (inode, &attr);if (rc <0 )return rc;
fs/jffs2/fs.c +1 -1
@@ -472,7 +472,7 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r inode->i_mode =jemode_to_cpu (ri->mode);i_gid_write (inode,je16_to_cpu (ri->gid));i_uid_write (inode,je16_to_cpu (ri->uid)); - inode->i_atime = inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; + inode->i_atime = inode->i_ctime = inode->i_mtime =current_time (inode); ri->atime = ri->mtime = ri->ctime =cpu_to_je32 (I_SEC (inode->i_mtime)); inode->i_blocks =0 ;
fs/minix/bitmap.c +1 -1
@@ -253,7 +253,7 @@ struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error) }inode_init_owner (inode, dir, mode); inode->i_ino = j; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_blocks =0 ;memset (&minix_i (inode)->u,0 ,sizeof (minix_i (inode)->u));insert_inode_hash (inode);
fs/minix/dir.c +3 -3
@@ -274,7 +274,7 @@ got_it: de->inode = inode->i_ino; } err =dir_commit_chunk (page, pos, sbi->s_dirsize); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir); out_put:dir_put_page (page);
@@ -306,7 +306,7 @@ int minix_delete_entry(struct minix_dir_entry *de, struct page *page)unlock_page (page); }dir_put_page (page); - inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; + inode->i_ctime = inode->i_mtime =current_time (inode);mark_inode_dirty (inode);return err; }
@@ -430,7 +430,7 @@ void minix_set_link(struct minix_dir_entry *de, struct page *page,unlock_page (page); }dir_put_page (page); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir); }
fs/minix/itree_common.c +2 -2
@@ -124,7 +124,7 @@ static inline int splice_branch(struct inode *inode,/* We are done with atomic stuff, now do the rest of housekeeping */ - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);/* had we spliced it onto indirect block? */ if (where->bh)
@@ -343,7 +343,7 @@ do_indirects: } first_whole++; } - inode->i_mtime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty (inode); }
fs/minix/namei.c +2 -2
@@ -106,7 +106,7 @@ static int minix_link(struct dentry * old_dentry, struct inode * dir, {struct inode *inode =d_inode (old_dentry); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);inode_inc_link_count (inode);ihold (inode);return add_nondir (dentry, inode);
@@ -219,7 +219,7 @@ static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,if (!new_de) goto out_dir;minix_set_link (new_de, new_page, old_inode); - new_inode->i_ctime =CURRENT_TIME_SEC ; + new_inode->i_ctime =current_time (new_inode);if (dir_de)drop_nlink (new_inode);inode_dec_link_count (new_inode);
fs/omfs/dir.c +2 -2
@@ -143,7 +143,7 @@ static int omfs_add_link(struct dentry *dentry, struct inode *inode)mark_buffer_dirty (bh);brelse (bh); - dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_ctime =current_time (dir);/* mark affected inodes dirty to rebuild checksums */ mark_inode_dirty (dir);
@@ -395,7 +395,7 @@ static int omfs_rename(struct inode *old_dir, struct dentry *old_dentry,if (err) goto out; - old_inode->i_ctime =CURRENT_TIME_SEC ; + old_inode->i_ctime =current_time (old_inode);mark_inode_dirty (old_inode); out:return err;
fs/reiserfs/inode.c +1 -1
@@ -2005,7 +2005,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,if (S_ISLNK (inode->i_mode)) inode->i_flags &= ~(S_IMMUTABLE |S_APPEND ); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_size = i_size; inode->i_blocks =0 ; inode->i_bytes =0 ;
fs/reiserfs/ioctl.c +2 -2
@@ -94,7 +94,7 @@ long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) }sd_attrs_to_i_attrs (flags, inode);REISERFS_I (inode)->i_attrs = flags; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); setflags_out:mnt_drop_write_file (filp);
@@ -115,7 +115,7 @@ setflags_out: err = -EFAULT ; goto setversion_out; } - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); setversion_out:mnt_drop_write_file (filp);
fs/reiserfs/namei.c +6 -6
@@ -570,7 +570,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, } dir->i_size += paste_size; - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);if (!S_ISDIR (inode->i_mode) && visible)/* reiserfs_mkdir or reiserfs_rename will do that by itself */ reiserfs_update_sd (th, dir);
@@ -963,7 +963,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) inode->i_nlink);clear_nlink (inode); - inode->i_ctime = dir->i_ctime = dir->i_mtime =CURRENT_TIME_SEC ; + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (dir);reiserfs_update_sd (&th, inode);DEC_DIR_INODE_NLINK (dir)
@@ -1067,11 +1067,11 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)inc_nlink (inode); goto end_unlink; } - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);reiserfs_update_sd (&th, inode); dir->i_size -= (de.de_entrylen +DEH_SIZE ); - dir->i_ctime = dir->i_mtime =CURRENT_TIME_SEC ; + dir->i_ctime = dir->i_mtime =current_time (dir);reiserfs_update_sd (&th, dir);if (!savelink)
@@ -1246,7 +1246,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir,return err ? err : retval; } - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);reiserfs_update_sd (&th, inode);ihold (inode);
@@ -1567,7 +1567,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,mark_de_hidden (old_de.de_deh + old_de.de_entry_num);journal_mark_dirty (&th, old_de.de_bh); - ctime =CURRENT_TIME_SEC ; + ctime =current_time (old_dir); old_dir->i_ctime = old_dir->i_mtime = ctime; new_dir->i_ctime = new_dir->i_mtime = ctime;/*
fs/reiserfs/stree.c +4 -4
@@ -1987,8 +1987,8 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th,pathrelse (&s_search_path);if (update_timestamps) { - inode->i_mtime =CURRENT_TIME_SEC ; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime =current_time (inode); + inode->i_ctime =current_time (inode); }reiserfs_update_sd (th, inode);
@@ -2012,8 +2012,8 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, update_and_out:if (update_timestamps) {/* this is truncate, not file closing */ - inode->i_mtime =CURRENT_TIME_SEC ; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime =current_time (inode); + inode->i_ctime =current_time (inode); }reiserfs_update_sd (th, inode);
fs/reiserfs/xattr.c +1 -1
@@ -456,7 +456,7 @@ static void update_ctime(struct inode *inode) timespec_equal(&inode->i_ctime, &now))return ; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); }
fs/reiserfs/xattr_acl.c +1 -1
@@ -277,7 +277,7 @@ __reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode,if (error == -ENODATA ) { error =0 ;if (type ==ACL_TYPE_ACCESS ) { - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); } }
fs/sysv/dir.c +3 -3
@@ -215,7 +215,7 @@ got_it:memset (de->name + namelen,0 ,SYSV_DIRSIZE - namelen -2 ); de->inode =cpu_to_fs16 (SYSV_SB (inode->i_sb), inode->i_ino); err =dir_commit_chunk (page, pos,SYSV_DIRSIZE ); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir); out_page:dir_put_page (page);
@@ -239,7 +239,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de, struct page *page) de->inode =0 ; err =dir_commit_chunk (page, pos,SYSV_DIRSIZE );dir_put_page (page); - inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; + inode->i_ctime = inode->i_mtime =current_time (inode);mark_inode_dirty (inode);return err; }
@@ -337,7 +337,7 @@ void sysv_set_link(struct sysv_dir_entry *de, struct page *page, de->inode =cpu_to_fs16 (SYSV_SB (inode->i_sb), inode->i_ino); err =dir_commit_chunk (page, pos,SYSV_DIRSIZE );dir_put_page (page); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir); }
fs/sysv/ialloc.c +1 -1
@@ -164,7 +164,7 @@ struct inode * sysv_new_inode(const struct inode * dir, umode_t mode)dirty_sb (sb);inode_init_owner (inode, dir, mode); inode->i_ino =fs16_to_cpu (sbi, ino); - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); inode->i_blocks =0 ;memset (SYSV_I (inode)->i_data,0 ,sizeof (SYSV_I (inode)->i_data));SYSV_I (inode)->i_dir_start_lookup =0 ;
fs/sysv/itree.c +2 -2
@@ -178,7 +178,7 @@ static inline int splice_branch(struct inode *inode, *where->p = where->key;write_unlock (&pointers_lock); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);/* had we spliced it onto indirect block? */ if (where->bh)
@@ -418,7 +418,7 @@ do_indirects: } n++; } - inode->i_mtime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_ctime =current_time (inode);if (IS_SYNC (inode))sysv_sync_inode (inode);else
fs/sysv/namei.c +2 -2
@@ -120,7 +120,7 @@ static int sysv_link(struct dentry * old_dentry, struct inode * dir, {struct inode *inode =d_inode (old_dentry); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);inode_inc_link_count (inode);ihold (inode);
@@ -240,7 +240,7 @@ static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry,if (!new_de) goto out_dir;sysv_set_link (new_de, new_page, old_inode); - new_inode->i_ctime =CURRENT_TIME_SEC ; + new_inode->i_ctime =current_time (new_inode);if (dir_de)drop_nlink (new_inode);inode_dec_link_count (new_inode);
fs/ufs/dir.c +3 -3
@@ -100,7 +100,7 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, err =ufs_commit_chunk (page, pos, len);ufs_put_page (page);if (update_times) - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir); }
@@ -395,7 +395,7 @@ got_it:ufs_set_de_type (sb, de, inode->i_mode); err =ufs_commit_chunk (page, pos, rec_len); - dir->i_mtime = dir->i_ctime =CURRENT_TIME_SEC ; + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty (dir);/* OFFSET_CACHE */
@@ -545,7 +545,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, pde->d_reclen =cpu_to_fs16 (sb, to - from); dir->d_ino =0 ; err =ufs_commit_chunk (page, pos, to - from); - inode->i_ctime = inode->i_mtime =CURRENT_TIME_SEC ; + inode->i_ctime = inode->i_mtime =current_time (inode);mark_inode_dirty (inode); out:ufs_put_page (page);
fs/ufs/ialloc.c +1 -1
@@ -291,7 +291,7 @@ cg_found:inode_init_owner (inode, dir, mode); inode->i_blocks =0 ; inode->i_generation =0 ; - inode->i_mtime = inode->i_atime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_atime = inode->i_ctime =current_time (inode); ufsi->i_flags =UFS_I (dir)->i_flags; ufsi->i_lastfrag =0 ; ufsi->i_shadow =0 ;
fs/ufs/inode.c +3 -3
@@ -293,7 +293,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned index,if (new) *new =1 ; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);if (IS_SYNC (inode))ufs_sync_inode (inode);mark_inode_dirty (inode);
@@ -375,7 +375,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block,mark_buffer_dirty (bh);if (IS_SYNC (inode))sync_dirty_buffer (bh); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); out:brelse (bh);
@@ -1185,7 +1185,7 @@ static int ufs_truncate(struct inode *inode, loff_t size)truncate_setsize (inode, size);__ufs_truncate_blocks (inode); - inode->i_mtime = inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_mtime = inode->i_ctime =current_time (inode);mark_inode_dirty (inode); out:UFSD ("EXIT: err %d\n" , err);
fs/ufs/namei.c +3 -3
@@ -153,7 +153,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir,struct inode *inode =d_inode (old_dentry);int error; - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);inode_inc_link_count (inode);ihold (inode);
@@ -279,7 +279,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,if (!new_de) goto out_dir;ufs_set_link (new_dir, new_de, new_page, old_inode,1 ); - new_inode->i_ctime =CURRENT_TIME_SEC ; + new_inode->i_ctime =current_time (new_inode);if (dir_de)drop_nlink (new_inode);inode_dec_link_count (new_inode);
@@ -295,7 +295,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime =CURRENT_TIME_SEC ; + old_inode->i_ctime =current_time (old_inode);ufs_delete_entry (old_dir, old_de, old_page);mark_inode_dirty (old_inode);
Signature · 1 line
1.9.1
PATCH v2 4/24 fs: Replace current_fs_time() with current_time()
In reply to Deepa Dinamanicurrent_fs_time() uses struct super_block* as an argument. As per Linus's suggestion, this is changed to take struct inode* as a parameter instead. This is because the function is primarily meant for vfs inode timestamps.
Also the function was renamed as per Arnd's suggestion.
Change all calls to current_fs_time() to use the new current_time() function instead. current_fs_time() will be deleted.
--- drivers/char/sonypi.c | 2 +- drivers/platform/x86/sony-laptop.c | 2 +- fs/attr.c | 2 +- fs/bad_inode.c | 2 +- fs/binfmt_misc.c | 2 +- fs/btrfs/file.c | 6 +++--- fs/btrfs/inode.c | 20 ++++++++++---------- fs/btrfs/ioctl.c | 8 ++++---- fs/btrfs/transaction.c | 4 ++-- fs/btrfs/xattr.c | 2 +- fs/ceph/file.c | 4 ++-- fs/ceph/inode.c | 2 +- fs/ceph/xattr.c | 2 +- fs/cifs/file.c | 4 ++-- fs/cifs/inode.c | 8 ++++---- fs/configfs/inode.c | 6 +++--- fs/debugfs/inode.c | 2 +- fs/fat/file.c | 2 +- fs/fuse/dir.c | 2 +- fs/inode.c | 6 +++--- fs/jfs/namei.c | 2 +- fs/kernfs/inode.c | 2 +- fs/locks.c | 2 +- fs/nfsd/blocklayout.c | 2 +- fs/ntfs/inode.c | 2 +- fs/ntfs/mft.c | 2 +- fs/orangefs/namei.c | 8 ++++---- fs/reiserfs/xattr.c | 4 ++-- fs/udf/ialloc.c | 2 +- fs/udf/inode.c | 4 ++-- fs/udf/namei.c | 20 ++++++++++---------- fs/xfs/xfs_acl.c | 2 +- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_iops.c | 2 +- fs/xfs/xfs_trans_inode.c | 2 +- 35 files changed, 73 insertions(+), 73 deletions(-)
drivers/char/sonypi.c +1 -1
@@ -934,7 +934,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,if (ret >0 ) {struct inode *inode =file_inode (file); - inode->i_atime =current_fs_time (inode->i_sb); + inode->i_atime =current_time (inode); }return ret;
drivers/platform/x86/sony-laptop.c +1 -1
@@ -4116,7 +4116,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf,if (ret >0 ) {struct inode *inode =file_inode (file); - inode->i_atime =current_fs_time (inode->i_sb); + inode->i_atime =current_time (inode); }return ret;
fs/attr.c +1 -1
@@ -209,7 +209,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de inode->i_flags &= ~S_NOSEC ; } - now =current_fs_time (inode->i_sb); + now =current_time (inode); attr->ia_ctime = now;if (!(ia_valid &ATTR_ATIME_SET ))
fs/bad_inode.c +1 -1
@@ -173,7 +173,7 @@ void make_bad_inode(struct inode *inode) inode->i_mode =S_IFREG ; inode->i_atime = inode->i_mtime = inode->i_ctime = -current_fs_time (inode->i_sb); +current_time (inode); inode->i_op = &bad_inode_ops; inode->i_fop = &bad_file_ops; }
fs/binfmt_misc.c +1 -1
@@ -567,7 +567,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) inode->i_ino =get_next_ino (); inode->i_mode = mode; inode->i_atime = inode->i_mtime = inode->i_ctime = -current_fs_time (inode->i_sb); +current_time (inode); }return inode; }
fs/btrfs/file.c +3 -3
@@ -1759,7 +1759,7 @@ static void update_time_for_write(struct inode *inode)if (IS_NOCMTIME (inode))return ; - now =current_fs_time (inode->i_sb); + now =current_time (inode);if (!timespec_equal (&inode->i_mtime, &now)) inode->i_mtime = now;
@@ -2572,7 +2572,7 @@ out_trans: goto out_free;inode_inc_iversion (inode); - inode->i_mtime = inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_mtime = inode->i_ctime =current_time (inode); trans->block_rsv = &root->fs_info->trans_block_rsv; ret =btrfs_update_inode (trans, root, inode);
@@ -2825,7 +2825,7 @@ static long btrfs_fallocate(struct file *file, int mode,if (IS_ERR (trans)) { ret =PTR_ERR (trans); }else { - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode);i_size_write (inode, actual_end);btrfs_ordered_update_i_size (inode, actual_end,NULL ); ret =btrfs_update_inode (trans, root, inode);
fs/btrfs/inode.c +10 -10
@@ -4042,7 +4042,7 @@ err:inode_inc_iversion (inode);inode_inc_iversion (dir); inode->i_ctime = dir->i_mtime = - dir->i_ctime =current_fs_time (inode->i_sb); + dir->i_ctime =current_time (inode); ret =btrfs_update_inode (trans, root, dir); out:return ret;
@@ -4185,7 +4185,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,btrfs_i_size_write (dir, dir->i_size - name_len *2 );inode_inc_iversion (dir); - dir->i_mtime = dir->i_ctime =current_fs_time (dir->i_sb); + dir->i_mtime = dir->i_ctime =current_time (dir); ret =btrfs_update_inode_fallback (trans, root, dir);if (ret)btrfs_abort_transaction (trans, root, ret);
@@ -4950,7 +4950,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)inode_inc_iversion (inode);if (!(mask & (ATTR_CTIME |ATTR_MTIME ))) inode->i_ctime = inode->i_mtime = -current_fs_time (inode->i_sb); +current_time (inode); }if (newsize > oldsize) {
@@ -5650,7 +5650,7 @@ static struct inode *new_simple_dir(struct super_block *s, inode->i_op = &btrfs_dir_ro_inode_operations; inode->i_fop = &simple_dir_operations; inode->i_mode =S_IFDIR |S_IRUGO |S_IWUSR |S_IXUGO ; - inode->i_mtime =current_fs_time (inode->i_sb); + inode->i_mtime =current_time (inode); inode->i_atime = inode->i_mtime; inode->i_ctime = inode->i_mtime;BTRFS_I (inode)->i_otime = inode->i_mtime;
@@ -6236,7 +6236,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,inode_init_owner (inode, dir, mode);inode_set_bytes (inode,0 ); - inode->i_mtime =current_fs_time (inode->i_sb); + inode->i_mtime =current_time (inode); inode->i_atime = inode->i_mtime; inode->i_ctime = inode->i_mtime;BTRFS_I (inode)->i_otime = inode->i_mtime;
@@ -6350,7 +6350,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, name_len * 2);inode_inc_iversion (parent_inode); parent_inode->i_mtime = parent_inode->i_ctime = -current_fs_time (parent_inode->i_sb); +current_time (parent_inode); ret =btrfs_update_inode (trans, root, parent_inode);if (ret)btrfs_abort_transaction (trans, root, ret);
@@ -6568,7 +6568,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,BTRFS_I (inode)->dir_index =0ULL ;inc_nlink (inode);inode_inc_iversion (inode); - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode);ihold (inode);set_bit (BTRFS_INODE_COPY_EVERYTHING , &BTRFS_I (inode)->runtime_flags);
@@ -9832,7 +9832,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,inode_inc_iversion (old_inode); old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = new_dir->i_mtime = - old_inode->i_ctime =current_fs_time (old_dir->i_sb); + old_inode->i_ctime =current_time (old_dir);if (old_dentry->d_parent != new_dentry->d_parent)btrfs_record_unlink_dir (trans, old_dir, old_inode,1 );
@@ -9857,7 +9857,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,if (new_inode) {inode_inc_iversion (new_inode); - new_inode->i_ctime =current_fs_time (new_inode->i_sb); + new_inode->i_ctime =current_time (new_inode);if (unlikely (btrfs_ino (new_inode) ==BTRFS_EMPTY_SUBVOL_DIR_OBJECTID )) { root_objectid =BTRFS_I (new_inode)->location.objectid;
@@ -10374,7 +10374,7 @@ next: *alloc_hint = ins.objectid + ins.offset;inode_inc_iversion (inode); - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode);BTRFS_I (inode)->flags |=BTRFS_INODE_PREALLOC ; if (!(mode & FALLOC_FL_KEEP_SIZE) && (actual_len > inode->i_size) &&
fs/btrfs/ioctl.c +4 -4
@@ -349,7 +349,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)btrfs_update_iflags (inode);inode_inc_iversion (inode); - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode); ret =btrfs_update_inode (trans, root, inode);btrfs_end_transaction (trans, root);
@@ -445,7 +445,7 @@ static noinline int create_subvol(struct inode *dir,struct btrfs_root *root =BTRFS_I (dir)->root;struct btrfs_root *new_root;struct btrfs_block_rsv block_rsv; -struct timespec cur_time =current_fs_time (dir->i_sb); +struct timespec cur_time =current_time (dir);struct inode *inode;int ret;int err;
@@ -3280,7 +3280,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans,inode_inc_iversion (inode);if (!no_time_update) - inode->i_mtime = inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_mtime = inode->i_ctime =current_time (inode);/* * We round up to the block size at eof when determining which * extents to clone above, but shouldn't round up the file size.
@@ -5098,7 +5098,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,struct btrfs_root *root =BTRFS_I (inode)->root;struct btrfs_root_item *root_item = &root->root_item;struct btrfs_trans_handle *trans; -struct timespec ct =current_fs_time (inode->i_sb); +struct timespec ct =current_time (inode);int ret =0 ;int received_uuid_changed;
fs/btrfs/transaction.c +2 -2
@@ -1477,7 +1477,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, parent_root =BTRFS_I (parent_inode)->root;record_root_in_trans (trans, parent_root,0 ); - cur_time =current_fs_time (parent_inode->i_sb); + cur_time =current_time (parent_inode);/* * insert the directory item
@@ -1633,7 +1633,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,btrfs_i_size_write (parent_inode, parent_inode->i_size + dentry->d_name.len *2 ); parent_inode->i_mtime = parent_inode->i_ctime = -current_fs_time (parent_inode->i_sb); +current_time (parent_inode); ret =btrfs_update_inode_fallback (trans, parent_root, parent_inode);if (ret) {btrfs_abort_transaction (trans, root, ret);
fs/btrfs/xattr.c +1 -1
@@ -252,7 +252,7 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans, goto out;inode_inc_iversion (inode); - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode);set_bit (BTRFS_INODE_COPY_EVERYTHING , &BTRFS_I (inode)->runtime_flags); ret =btrfs_update_inode (trans, root, inode);BUG_ON (ret);
fs/ceph/file.c +2 -2
@@ -838,7 +838,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter,int num_pages =0 ;int flags;int ret; -struct timespec mtime =current_fs_time (inode->i_sb); +struct timespec mtime =current_time (inode);size_t count =iov_iter_count (iter);loff_t pos = iocb->ki_pos;bool write =iov_iter_rw (iter) ==WRITE ;
@@ -1040,7 +1040,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_fs_time (inode->i_sb); +struct timespec mtime =current_time (inode);size_t count =iov_iter_count (from);if (ceph_snap (file_inode (file)) !=CEPH_NOSNAP )
fs/ceph/inode.c +1 -1
@@ -2056,7 +2056,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr)if (dirtied) { inode_dirty_flags =__ceph_mark_dirty_caps (ci, dirtied, &prealloc_cf); - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode); } release &= issued;
fs/ceph/xattr.c +1 -1
@@ -1013,7 +1013,7 @@ retry: dirty =__ceph_mark_dirty_caps (ci,CEPH_CAP_XATTR_EXCL , &prealloc_cf); ci->i_xattrs.dirty = true; - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode); }spin_unlock (&ci->i_ceph_lock);
fs/cifs/file.c +2 -2
@@ -1878,7 +1878,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) write_data, to - from, &offset);cifsFileInfo_put (open_file);/* Does mm or vfs already set times? */ - inode->i_atime = inode->i_mtime =current_fs_time (inode->i_sb); + inode->i_atime = inode->i_mtime =current_time (inode);if ((bytes_written >0 ) && (offset)) rc =0 ;else if (bytes_written <0 )
@@ -3571,7 +3571,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,cifs_dbg (FYI ,"Bytes read %d\n" , rc);file_inode (file)->i_atime = -current_fs_time (file_inode (file)->i_sb); +current_time (file_inode (file));if (PAGE_SIZE > rc)memset (read_data + rc,0 ,PAGE_SIZE - rc);
fs/cifs/inode.c +4 -4
@@ -1343,9 +1343,9 @@ out_reval: cifs_inode =CIFS_I (inode); cifs_inode->time =0 ;/* will force revalidate to get info when needed */ - inode->i_ctime =current_fs_time (sb); + inode->i_ctime =current_time (inode); } - dir->i_ctime = dir->i_mtime =current_fs_time (sb); + dir->i_ctime = dir->i_mtime =current_time (dir); cifs_inode =CIFS_I (dir);CIFS_I (dir)->time =0 ;/* force revalidate of dir as well */ unlink_out:
@@ -1613,7 +1613,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) cifsInode->time =0 ;d_inode (direntry)->i_ctime = inode->i_ctime = inode->i_mtime = -current_fs_time (inode->i_sb); +current_time (inode); rmdir_exit:kfree (full_path);
@@ -1786,7 +1786,7 @@ unlink_target:CIFS_I (source_dir)->time =CIFS_I (target_dir)->time =0 ; source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime = - target_dir->i_mtime =current_fs_time (source_dir->i_sb); + target_dir->i_mtime =current_time (source_dir); cifs_rename_exit:kfree (info_buf_source);
fs/configfs/inode.c +3 -3
@@ -76,7 +76,7 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) sd_iattr->ia_uid =GLOBAL_ROOT_UID ; sd_iattr->ia_gid =GLOBAL_ROOT_GID ; sd_iattr->ia_atime = sd_iattr->ia_mtime = - sd_iattr->ia_ctime =current_fs_time (inode->i_sb); + sd_iattr->ia_ctime =current_time (inode); sd->s_iattr = sd_iattr; }/* attributes were changed atleast once in past */
@@ -113,7 +113,7 @@ static inline void set_default_inode_attr(struct inode * inode, umode_t mode) { inode->i_mode = mode; inode->i_atime = inode->i_mtime = - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode); }static inline void set_inode_attr (struct inode * inode,struct iattr * iattr)
@@ -197,7 +197,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct inreturn -ENOMEM ; p_inode =d_inode (dentry->d_parent); - p_inode->i_mtime = p_inode->i_ctime =current_fs_time (p_inode->i_sb); + p_inode->i_mtime = p_inode->i_ctime =current_time (p_inode);configfs_set_inode_lock_class (sd, inode);init (inode);
fs/debugfs/inode.c +1 -1
@@ -45,7 +45,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb)if (inode) { inode->i_ino =get_next_ino (); inode->i_atime = inode->i_mtime = - inode->i_ctime =current_fs_time (sb); + inode->i_ctime =current_time (inode); }return inode; }
fs/fat/file.c +1 -1
@@ -63,7 +63,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr)/* Equivalent to a chmod() */ ia.ia_valid =ATTR_MODE |ATTR_CTIME ; - ia.ia_ctime =current_fs_time (inode->i_sb); + ia.ia_ctime =current_time (inode);if (is_dir) ia.ia_mode =fat_make_mode (sbi, attr,S_IRWXUGO );else {
fs/fuse/dir.c +1 -1
@@ -635,7 +635,7 @@ static int fuse_symlink(struct inode *dir, struct dentry *entry,static inline void fuse_update_ctime (struct inode *inode) {if (!IS_NOCMTIME (inode)) { - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode);mark_inode_dirty_sync (inode); } }
fs/inode.c +3 -3
@@ -1627,7 +1627,7 @@ bool atime_needs_update(const struct path *path, struct inode *inode)if ((mnt->mnt_flags &MNT_NODIRATIME ) &&S_ISDIR (inode->i_mode))return false; - now =current_fs_time (inode->i_sb); + now =current_time (inode);if (!relatime_need_update (mnt, inode, now))return false;
@@ -1661,7 +1661,7 @@ void touch_atime(const struct path *path)* We may also fail on filesystems that have the ability to make parts * of the fs read only, e.g. subvolumes in Btrfs. */ - now =current_fs_time (inode->i_sb); + now =current_time (inode);update_time (inode, &now,S_ATIME );__mnt_drop_write (mnt); skip_update:
@@ -1785,7 +1785,7 @@ int file_update_time(struct file *file)if (IS_NOCMTIME (inode))return 0 ; - now =current_fs_time (inode->i_sb); + now =current_time (inode);if (!timespec_equal (&inode->i_mtime, &now)) sync_it =S_MTIME ;
fs/jfs/namei.c +1 -1
@@ -1281,7 +1281,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, old_ip->i_ctime =current_time (old_ip);mark_inode_dirty (old_ip); - new_dir->i_ctime = new_dir->i_mtime =current_fs_time (new_dir->i_sb); + new_dir->i_ctime = new_dir->i_mtime =current_time (new_dir);mark_inode_dirty (new_dir);/* Build list of inodes modified by this transaction */
fs/kernfs/inode.c +1 -1
@@ -241,7 +241,7 @@ static inline void set_default_inode_attr(struct inode *inode, umode_t mode) { inode->i_mode = mode; inode->i_atime = inode->i_mtime = - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode); }static inline void set_inode_attr (struct inode *inode,struct iattr *iattr)
fs/locks.c +1 -1
@@ -1539,7 +1539,7 @@ void lease_get_mtime(struct inode *inode, struct timespec *time) }if (has_lease) - *time =current_fs_time (inode->i_sb); + *time =current_time (inode);else *time = inode->i_mtime; }
fs/nfsd/blocklayout.c +1 -1
@@ -122,7 +122,7 @@ nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp,if (lcp->lc_mtime.tv_nsec ==UTIME_NOW ||timespec_compare (&lcp->lc_mtime, &inode->i_mtime) <0 ) - lcp->lc_mtime =current_fs_time (inode->i_sb); + lcp->lc_mtime =current_time (inode); iattr.ia_valid |=ATTR_ATIME |ATTR_CTIME |ATTR_MTIME ; iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime;
fs/ntfs/inode.c +1 -1
@@ -2813,7 +2813,7 @@ done:* for real. */ if (!IS_NOCMTIME (VFS_I (base_ni)) && !IS_RDONLY (VFS_I (base_ni))) { -struct timespec now =current_fs_time (VFS_I (base_ni)->i_sb); +struct timespec now =current_time (VFS_I (base_ni));int sync_it =0 ; if (!timespec_equal(&VFS_I(base_ni)->i_mtime, &now) ||
fs/ntfs/mft.c +1 -1
@@ -2692,7 +2692,7 @@ mft_rec_already_initialized:/* Set the inode times to the current time. */ vi->i_atime = vi->i_mtime = vi->i_ctime = -current_fs_time (vi->i_sb); +current_time (vi);/* * Set the file size to 0, the ntfs inode sizes are set to 0 by * the call to ntfs_init_big_inode() below.
fs/orangefs/namei.c +4 -4
@@ -79,7 +79,7 @@ static int orangefs_create(struct inode *dir, dentry->d_name.name);SetMtimeFlag (parent); - dir->i_mtime = dir->i_ctime =current_fs_time (dir->i_sb); + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty_sync (dir); ret =0 ; out:
@@ -248,7 +248,7 @@ static int orangefs_unlink(struct inode *dir, struct dentry *dentry)drop_nlink (inode);SetMtimeFlag (parent); - dir->i_mtime = dir->i_ctime =current_fs_time (dir->i_sb); + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty_sync (dir); }return ret;
@@ -323,7 +323,7 @@ static int orangefs_symlink(struct inode *dir, dentry->d_name.name);SetMtimeFlag (parent); - dir->i_mtime = dir->i_ctime =current_fs_time (dir->i_sb); + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty_sync (dir); ret =0 ; out:
@@ -389,7 +389,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode* across clients; keep constant at 1. */ SetMtimeFlag (parent); - dir->i_mtime = dir->i_ctime =current_fs_time (dir->i_sb); + dir->i_mtime = dir->i_ctime =current_time (dir);mark_inode_dirty_sync (dir); out:op_release (new_op);
fs/reiserfs/xattr.c +2 -2
@@ -450,7 +450,7 @@ int reiserfs_commit_write(struct file *f, struct page *page,static void update_ctime (struct inode *inode) { -struct timespec now =current_fs_time (inode->i_sb); +struct timespec now =current_time (inode);if (inode_unhashed (inode) || !inode->i_nlink ||timespec_equal (&inode->i_ctime, &now))
@@ -575,7 +575,7 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th, new_size = buffer_size +sizeof (struct reiserfs_xattr_header );if (!err && new_size <i_size_read (d_inode (dentry))) {struct iattr newattrs = { - .ia_ctime =current_fs_time (inode->i_sb), + .ia_ctime =current_time (inode), .ia_size = new_size, .ia_valid =ATTR_SIZE |ATTR_CTIME , };
fs/udf/ialloc.c +1 -1
@@ -121,7 +121,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode)else iinfo->i_alloc_type =ICBTAG_FLAG_AD_LONG ; inode->i_mtime = inode->i_atime = inode->i_ctime = - iinfo->i_crtime =current_fs_time (inode->i_sb); + iinfo->i_crtime =current_time (inode);if (unlikely (insert_inode_locked (inode) <0 )) {make_bad_inode (inode);iput (inode);
fs/udf/inode.c +2 -2
@@ -886,7 +886,7 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, *new =1 ; iinfo->i_next_alloc_block = block; iinfo->i_next_alloc_goal = newblocknum; - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode);if (IS_SYNC (inode))udf_sync_inode (inode);
@@ -1268,7 +1268,7 @@ set_size:up_write (&iinfo->i_data_sem); } update_time: - inode->i_mtime = inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_mtime = inode->i_ctime =current_time (inode);if (IS_SYNC (inode))udf_sync_inode (inode);else
fs/udf/namei.c +10 -10
@@ -616,7 +616,7 @@ static int udf_add_nondir(struct dentry *dentry, struct inode *inode) *(__le32 *)((struct allocDescImpUse *)cfi.icb.impUse)->impUse =cpu_to_le32 (iinfo->i_unique &0x00000000FFFFFFFFUL );udf_write_fi (dir, &cfi, fi, &fibh,NULL ,NULL ); - dir->i_ctime = dir->i_mtime =current_fs_time (dir->i_sb); + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty (dir);if (fibh.sbh != fibh.ebh)brelse (fibh.ebh);
@@ -730,7 +730,7 @@ static int udf_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) cfi.fileCharacteristics |=FID_FILE_CHAR_DIRECTORY ;udf_write_fi (dir, &cfi, fi, &fibh,NULL ,NULL );inc_nlink (dir); - dir->i_ctime = dir->i_mtime =current_fs_time (dir->i_sb); + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty (dir);unlock_new_inode (inode);d_instantiate (dentry, inode);
@@ -845,7 +845,7 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) inode->i_size =0 ;inode_dec_link_count (dir); inode->i_ctime = dir->i_ctime = dir->i_mtime = -current_fs_time (dir->i_sb); +current_time (inode);mark_inode_dirty (dir); end_rmdir:
@@ -888,7 +888,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) retval =udf_delete_entry (dir, fi, &fibh, &cfi);if (retval) goto end_unlink; - dir->i_ctime = dir->i_mtime =current_fs_time (dir->i_sb); + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty (dir);inode_dec_link_count (inode); inode->i_ctime = dir->i_ctime;
@@ -1079,9 +1079,9 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir,brelse (fibh.ebh);brelse (fibh.sbh);inc_nlink (inode); - inode->i_ctime =current_fs_time (inode->i_sb); + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); - dir->i_ctime = dir->i_mtime =current_fs_time (dir->i_sb); + dir->i_ctime = dir->i_mtime =current_time (dir);mark_inode_dirty (dir);ihold (inode);d_instantiate (dentry, inode);
@@ -1172,7 +1172,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime =current_fs_time (old_inode->i_sb); + old_inode->i_ctime =current_time (old_inode);mark_inode_dirty (old_inode);/*
@@ -1188,11 +1188,11 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry,udf_delete_entry (old_dir, ofi, &ofibh, &ocfi);if (new_inode) { - new_inode->i_ctime =current_fs_time (new_inode->i_sb); + new_inode->i_ctime =current_time (new_inode);inode_dec_link_count (new_inode); } - old_dir->i_ctime = old_dir->i_mtime =current_fs_time (old_dir->i_sb); - new_dir->i_ctime = new_dir->i_mtime =current_fs_time (new_dir->i_sb); + old_dir->i_ctime = old_dir->i_mtime =current_time (old_dir); + new_dir->i_ctime = new_dir->i_mtime =current_time (new_dir);mark_inode_dirty (old_dir);mark_inode_dirty (new_dir);
fs/xfs/xfs_acl.c +1 -1
@@ -236,7 +236,7 @@ xfs_set_mode(struct inode *inode, umode_t mode) iattr.ia_valid =ATTR_MODE |ATTR_CTIME ; iattr.ia_mode = mode; - iattr.ia_ctime =current_fs_time (inode->i_sb); + iattr.ia_ctime =current_time (inode); error =xfs_setattr_nonsize (XFS_I (inode), &iattr,XFS_ATTR_NOACL ); }
fs/xfs/xfs_inode.c +1 -1
@@ -820,7 +820,7 @@ xfs_ialloc( ip->i_d.di_nextents =0 ;ASSERT (ip->i_d.di_nblocks ==0 ); - tv =current_fs_time (mp->m_super); + tv =current_time (inode); inode->i_mtime = tv; inode->i_atime = tv; inode->i_ctime = tv;
fs/xfs/xfs_iops.c +1 -1
@@ -881,7 +881,7 @@ xfs_setattr_size(if (newsize != oldsize && !(iattr->ia_valid & (ATTR_CTIME |ATTR_MTIME ))) { iattr->ia_ctime = iattr->ia_mtime = -current_fs_time (inode->i_sb); +current_time (inode); iattr->ia_valid |=ATTR_CTIME |ATTR_MTIME ; }
fs/xfs/xfs_trans_inode.c +1 -1
@@ -73,7 +73,7 @@ xfs_trans_ichgtime(ASSERT (tp);ASSERT (xfs_isilocked (ip,XFS_ILOCK_EXCL )); - tv =current_fs_time (inode->i_sb); + tv =current_time (inode);if (flags &XFS_ICHGTIME_MOD ) inode->i_mtime = tv;
Signature · 1 line
1.9.1
PATCH v2 5/24 fs: jfs: Replace CURRENT_TIME_SEC by current_time()
In reply to Deepa Dinamanijfs uses nanosecond granularity for filesystem timestamps. Only this assignemt is not using nanosecond granularity. Use current_time() to get the right granularity.
--- fs/jfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/ioctl.c +1 -1
@@ -121,7 +121,7 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)jfs_set_inode_flags (inode);inode_unlock (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); setflags_out:mnt_drop_write_file (filp);
Signature · 1 line
1.9.1
Re: [Jfs-discussion] [PATCH v2 05/24] fs: jfs: Replace CURRENT_TIME_SEC by current_time()
Quoted 6 lines · Deepa Dinamani
jfs uses nanosecond granularity for filesystem timestamps. Only this assignemt is not using nanosecond granularity. Use
current_time()to get the right granularity.Signed-off-by Deepa Dinamani <[email protected]>
Quoted 18 lines
--- fs/jfs/ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/jfs/ioctl.c +1
-1@@ -121,7 +121,7 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)jfs_set_inode_flags (inode);inode_unlock (inode); - inode->i_ctime =CURRENT_TIME_SEC ; + inode->i_ctime =current_time (inode);mark_inode_dirty (inode); setflags_out:mnt_drop_write_file (filp);
PATCH v2 6/24 fs: ext4: Use current_time() for inode timestamps
In reply to Deepa DinamaniCURRENT_TIME_SEC and CURRENT_TIME are not y2038 safe. current_time() will be transitioned to be y2038 safe along with vfs.
current_time() returns timestamps according to the granularities set in the super_block.
The granularity check in ext4_current_time() to call current_time() or CURRENT_TIME_SEC is not required. Use current_time() directly to obtain timestamps unconditionally, and remove ext4_current_time().
Quota files are assumed to be on the same filesystem. Hence, use current_time() for these files as well.
--- fs/ext4/acl.c | 2 +- fs/ext4/ext4.h | 6 ------ fs/ext4/extents.c | 10 +++++----- fs/ext4/ialloc.c | 2 +- fs/ext4/inline.c | 4 ++-- fs/ext4/inode.c | 6 +++--- fs/ext4/ioctl.c | 8 ++++---- fs/ext4/namei.c | 24 +++++++++++++----------- fs/ext4/xattr.c | 2 +- 9 files changed, 30 insertions(+), 34 deletions(-)
fs/ext4/acl.c +1 -1
@@ -197,7 +197,7 @@ __ext4_set_acl(handle_t *handle, struct inode *inode, int type,if (error <0 )return error;else { - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode);ext4_mark_inode_dirty (handle, inode);if (error ==0 ) acl =NULL ;
fs/ext4/ext4.h +0 -6
@@ -1523,12 +1523,6 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode) return container_of(inode, struct ext4_inode_info, vfs_inode); } -static inline struct timespec ext4_current_time (struct inode *inode) -{ -return (inode->i_sb->s_time_gran <NSEC_PER_SEC ) ? -current_fs_time (inode->i_sb) :CURRENT_TIME_SEC ; -} -static inline int ext4_valid_inum (struct super_block *sb,unsigned long ino) { return ino == EXT4_ROOT_INO ||
fs/ext4/extents.c +5 -5
@@ -4722,7 +4722,7 @@ retry: map.m_lblk += ret; map.m_len = len = len - ret; epos = (loff_t )map.m_lblk << inode->i_blkbits; - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode);if (new_size) {if (epos > new_size) epos = new_size;
@@ -4850,7 +4850,7 @@ static long ext4_zero_range(struct file *file, loff_t offset, }/* Now release the pages and zero block aligned part of pages */ truncate_pagecache_range (inode, start, end -1 ); - inode->i_mtime = inode->i_ctime =ext4_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode); ret =ext4_alloc_file_blocks (file, lblk, max_blocks, new_size, flags, mode);
@@ -4875,7 +4875,7 @@ static long ext4_zero_range(struct file *file, loff_t offset, goto out_dio; } - inode->i_mtime = inode->i_ctime =ext4_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode);if (new_size) {ext4_update_inode_size (inode, new_size); }else {
@@ -5574,7 +5574,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)up_write (&EXT4_I (inode)->i_data_sem);if (IS_SYNC (inode))ext4_handle_sync (handle); - inode->i_mtime = inode->i_ctime =ext4_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode);ext4_mark_inode_dirty (handle, inode); out_stop:
@@ -5684,7 +5684,7 @@ int ext4_insert_range(struct inode *inode, loff_t offset, loff_t len)/* Expand file to avoid data loss if there is error while shifting */ inode->i_size += len;EXT4_I (inode)->i_disksize += len; - inode->i_mtime = inode->i_ctime =ext4_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode); ret =ext4_mark_inode_dirty (handle, inode);if (ret) goto out_stop;
fs/ext4/ialloc.c +1 -1
@@ -1039,7 +1039,7 @@ got:/* This is the optimal IO size (for stat), not the fs block size */ inode->i_blocks =0 ; inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime = -ext4_current_time (inode); +current_time (inode);memset (ei->i_data,0 ,sizeof (ei->i_data)); ei->i_dir_start_lookup =0 ;
fs/ext4/inline.c +2 -2
@@ -1028,7 +1028,7 @@ static int ext4_add_dirent_to_inline(handle_t *handle,* happen is that the times are slightly out of date * and/or different from the directory change time. */ - dir->i_mtime = dir->i_ctime =ext4_current_time (dir); + dir->i_mtime = dir->i_ctime =current_time (dir);ext4_update_dx_flag (dir); dir->i_version++;ext4_mark_inode_dirty (handle, dir);
@@ -1971,7 +1971,7 @@ out:if (inode->i_nlink)ext4_orphan_del (handle, inode); - inode->i_mtime = inode->i_ctime =ext4_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode);ext4_mark_inode_dirty (handle, inode);if (IS_SYNC (inode))ext4_handle_sync (handle);
fs/ext4/inode.c +3 -3
@@ -3991,7 +3991,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)if (IS_SYNC (inode))ext4_handle_sync (handle); - inode->i_mtime = inode->i_ctime =ext4_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode);ext4_mark_inode_dirty (handle, inode); out_stop:ext4_journal_stop (handle);
@@ -4145,7 +4145,7 @@ out_stop:if (inode->i_nlink)ext4_orphan_del (handle, inode); - inode->i_mtime = inode->i_ctime =ext4_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode);ext4_mark_inode_dirty (handle, inode);ext4_journal_stop (handle);
@@ -5120,7 +5120,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)* update c/mtime in shrink case below */ if (!shrink) { - inode->i_mtime =ext4_current_time (inode); + inode->i_mtime =current_time (inode); inode->i_ctime = inode->i_mtime; }down_write (&EXT4_I (inode)->i_data_sem);
fs/ext4/ioctl.c +4 -4
@@ -155,7 +155,7 @@ static long swap_inode_boot_loader(struct super_block *sb,swap_inode_data (inode, inode_bl); - inode->i_ctime = inode_bl->i_ctime =ext4_current_time (inode); + inode->i_ctime = inode_bl->i_ctime =current_time (inode);spin_lock (&sbi->s_next_gen_lock); inode->i_generation = sbi->s_next_generation++;
@@ -274,7 +274,7 @@ static int ext4_ioctl_setflags(struct inode *inode, }ext4_set_inode_flags (inode); - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode); err =ext4_mark_iloc_dirty (handle, inode, &iloc); flags_err:
@@ -373,7 +373,7 @@ static int ext4_ioctl_setproject(struct file *filp, __u32 projid) } }EXT4_I (inode)->i_projid = kprojid; - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode); out_dirty: rc =ext4_mark_iloc_dirty (handle, inode, &iloc);if (!err)
@@ -505,7 +505,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } err =ext4_reserve_inode_write (handle, inode, &iloc);if (err ==0 ) { - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode); inode->i_generation = generation; err =ext4_mark_iloc_dirty (handle, inode, &iloc); }
fs/ext4/namei.c +13 -11
@@ -1940,7 +1940,7 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname,* happen is that the times are slightly out of date * and/or different from the directory change time. */ - dir->i_mtime = dir->i_ctime =ext4_current_time (dir); + dir->i_mtime = dir->i_ctime =current_time (dir);ext4_update_dx_flag (dir); dir->i_version++;ext4_mark_inode_dirty (handle, dir);
@@ -2989,7 +2989,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry)* recovery. */ inode->i_size =0 ;ext4_orphan_add (handle, inode); - inode->i_ctime = dir->i_ctime = dir->i_mtime =ext4_current_time (inode); + inode->i_ctime = dir->i_ctime = dir->i_mtime =current_time (inode);ext4_mark_inode_dirty (handle, inode);ext4_dec_count (handle, dir);ext4_update_dx_flag (dir);
@@ -3052,13 +3052,13 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry) retval =ext4_delete_entry (handle, dir, de, bh);if (retval) goto end_unlink; - dir->i_ctime = dir->i_mtime =ext4_current_time (dir); + dir->i_ctime = dir->i_mtime =current_time (dir);ext4_update_dx_flag (dir);ext4_mark_inode_dirty (handle, dir);drop_nlink (inode);if (!inode->i_nlink)ext4_orphan_add (handle, inode); - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode);ext4_mark_inode_dirty (handle, inode); end_unlink:
@@ -3257,7 +3257,7 @@ retry:if (IS_DIRSYNC (dir))ext4_handle_sync (handle); - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode);ext4_inc_count (handle, inode);ihold (inode);
@@ -3384,7 +3384,7 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent, ent->de->file_type = file_type; ent->dir->i_version++; ent->dir->i_ctime = ent->dir->i_mtime = -ext4_current_time (ent->dir); +current_time (ent->dir);ext4_mark_inode_dirty (handle, ent->dir);BUFFER_TRACE (ent->bh,"call ext4_handle_dirty_metadata" );if (!ent->inlined) {
@@ -3655,7 +3655,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the ctime for inodes on a * rename. */ - old.inode->i_ctime =ext4_current_time (old.inode); + old.inode->i_ctime =current_time (old.inode);ext4_mark_inode_dirty (handle, old.inode);if (!whiteout) {
@@ -3667,9 +3667,9 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,if (new.inode) {ext4_dec_count (handle, new.inode); - new.inode->i_ctime =ext4_current_time (new.inode); + new.inode->i_ctime =current_time (new.inode); } - old.dir->i_ctime = old.dir->i_mtime =ext4_current_time (old.dir); + old.dir->i_ctime = old.dir->i_mtime =current_time (old.dir);ext4_update_dx_flag (old.dir);if (old.dir_bh) { retval =ext4_rename_dir_finish (handle, &old, new.dir->i_ino);
@@ -3727,6 +3727,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, };u8 new_file_type;int retval; +struct timespec ctime; if ((ext4_encrypted_inode(old_dir) || ext4_encrypted_inode(new_dir)) &&
@@ -3829,8 +3830,9 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the ctime for inodes on a * rename. */ - old.inode->i_ctime =ext4_current_time (old.inode); - new.inode->i_ctime =ext4_current_time (new.inode); + ctime =current_time (old.inode); + old.inode->i_ctime = ctime; + new.inode->i_ctime = ctime;ext4_mark_inode_dirty (handle, old.inode);ext4_mark_inode_dirty (handle, new.inode);
fs/ext4/xattr.c +1 -1
@@ -1253,7 +1253,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, }if (!error) {ext4_xattr_update_super_block (handle, inode->i_sb); - inode->i_ctime =ext4_current_time (inode); + inode->i_ctime =current_time (inode);if (!value)ext4_clear_inode_state (inode,EXT4_STATE_NO_EXPAND ); error =ext4_mark_iloc_dirty (handle, inode, &is.iloc);
Signature · 6 lines
1.9.1 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Arnd Bergmann
maintainerRe: [PATCH v2 06/24] fs: ext4: Use current_time() for inode timestamps
Quoted 10 lines · CEST Deepa Dinamani
fs/ext4/namei.c +1
-0@@ -3727,6 +3727,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, };u8 new_file_type;int retval; +struct timespec ctime; if ((ext4_encrypted_inode(old_dir) || ext4_encrypted_inode(new_dir)) &&@@ -3829,8 +3830,9 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the ctime for inodes on a
fs/ext4/namei.c static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, · line 3838
Quoted 10 lines
fs/ext4/namei.c +3
-2* rename. */ - old.inode->i_ctime =ext4_current_time (old.inode); - new.inode->i_ctime =ext4_current_time (new.inode); + ctime =current_time (old.inode); + old.inode->i_ctime = ctime; + new.inode->i_ctime = ctime;ext4_mark_inode_dirty (handle, old.inode);ext4_mark_inode_dirty (handle, new.inode);
Adding a local variable here looks like it is going to cause us trouble when we change the return type of current_time() to timespec64.
I'd write this as
new.inode->i_ctime = old.inode->i_ctime;
instead.
Arnd
Re: [PATCH v2 06/24] fs: ext4: Use current_time() for inode timestamps
Quoted 24 lines
Quoted 10 lines
fs/ext4/namei.c +1
-0@@ -3727,6 +3727,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, };u8 new_file_type;int retval; +struct timespec ctime; if ((ext4_encrypted_inode(old_dir) || ext4_encrypted_inode(new_dir)) &&@@ -3829,8 +3830,9 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the ctime for inodes on a fs/ext4/namei.c static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, · line 3838
Quoted 10 lines
fs/ext4/namei.c +3
-2* rename. */ - old.inode->i_ctime =ext4_current_time (old.inode); - new.inode->i_ctime =ext4_current_time (new.inode); + ctime =current_time (old.inode); + old.inode->i_ctime = ctime; + new.inode->i_ctime = ctime;ext4_mark_inode_dirty (handle, old.inode);ext4_mark_inode_dirty (handle, new.inode);Adding a local variable here looks like it is going to cause us trouble when we change the return type of
current_time()to timespec64.
Quoted 5 lines
I'd write this as
new.inode->i_ctime = old.inode->i_ctime;instead.
This should be fine.
There are already instances that use local timespecs for inode time assignments.
These can be changed this way:
+ ctime = vfs_time_to_timespec(current_time(old.inode)); + old.inode->i_ctime = timespec_to_vfs_time(ctime); + new.inode->i_ctime = timespec_to_vfs_time(ctime);
This could be a little inefficient, but only temporary.
The local variable can be changed to timespec64 when the macros are deleted.
I'm trying to make minimal changes.
-Deepa
_______________________________________________
Y2038 mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/y2038
PATCH v2 7/24 fs: ubifs: Replace CURRENT_TIME_SEC with current_time
In reply to Deepa DinamaniCURRENT_TIME_SEC is not y2038 safe. current_time() will be transitioned to use 64 bit time along with vfs in a separate patch.
There is no plan to transition CURRENT_TIME_SEC to use y2038 safe time interfaces.
current_time() returns timestamps according to the granularities set in the inode's super_block. The granularity check to call current_fs_time() or CURRENT_TIME_SEC is not required.
Use current_time() directly to update inode timestamp. Use timespec_trunc during file system creation, before the first inode is created.
--- fs/ubifs/dir.c | 10 +++++----- fs/ubifs/file.c | 12 ++++++------ fs/ubifs/ioctl.c | 2 +- fs/ubifs/misc.h | 10 ---------- fs/ubifs/sb.c | 14 ++++++++++---- fs/ubifs/xattr.c | 6 +++--- 6 files changed, 25 insertions(+), 29 deletions(-)
fs/ubifs/dir.c +5 -5
@@ -106,7 +106,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir,inode_init_owner (inode, dir, mode); inode->i_mtime = inode->i_atime = inode->i_ctime = -ubifs_current_time (inode); +current_time (inode); inode->i_mapping->nrpages =0 ;switch (mode &S_IFMT ) {
@@ -529,7 +529,7 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,lock_2_inodes (dir, inode);inc_nlink (inode);ihold (inode); - inode->i_ctime =ubifs_current_time (inode); + inode->i_ctime =current_time (inode); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; dir->i_mtime = dir->i_ctime = inode->i_ctime;
@@ -586,7 +586,7 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) }lock_2_inodes (dir, inode); - inode->i_ctime =ubifs_current_time (dir); + inode->i_ctime =current_time (dir);drop_nlink (inode); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size;
@@ -675,7 +675,7 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) }lock_2_inodes (dir, inode); - inode->i_ctime =ubifs_current_time (dir); + inode->i_ctime =current_time (dir);clear_nlink (inode);drop_nlink (dir); dir->i_size -= sz_change;
@@ -1023,7 +1023,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,* Like most other Unix systems, set the @i_ctime for inodes on a * rename. */ - time =ubifs_current_time (old_dir); + time =current_time (old_dir); old_inode->i_ctime = time;/* We must adjust parent link count when renaming directories */
fs/ubifs/file.c +6 -6
@@ -1181,7 +1181,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode,mutex_lock (&ui->ui_mutex); ui->ui_size = inode->i_size;/* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime =ubifs_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode);/* Other attributes may be changed at the same time as well */ do_attr_changes (inode, attr); err =ubifs_jnl_truncate (c, inode, old_size, new_size);
@@ -1228,7 +1228,7 @@ static int do_setattr(struct ubifs_info *c, struct inode *inode,mutex_lock (&ui->ui_mutex);if (attr->ia_valid &ATTR_SIZE ) {/* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime =ubifs_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode);/* 'truncate_setsize()' changed @i_size, update @ui_size */ ui->ui_size = inode->i_size; }
@@ -1405,7 +1405,7 @@ int ubifs_update_time(struct inode *inode, struct timespec *time,*/ static int update_mctime (struct inode *inode) { -struct timespec now =ubifs_current_time (inode); +struct timespec now =current_time (inode);struct ubifs_inode *ui =ubifs_inode (inode);struct ubifs_info *c = inode->i_sb->s_fs_info;
@@ -1419,7 +1419,7 @@ static int update_mctime(struct inode *inode)return err;mutex_lock (&ui->ui_mutex); - inode->i_mtime = inode->i_ctime =ubifs_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode); release = ui->dirty;mark_inode_dirty_sync (inode);mutex_unlock (&ui->ui_mutex);
@@ -1477,7 +1477,7 @@ static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma,struct page *page = vmf->page;struct inode *inode =file_inode (vma->vm_file);struct ubifs_info *c = inode->i_sb->s_fs_info; -struct timespec now =ubifs_current_time (inode); +struct timespec now =current_time (inode);struct ubifs_budget_req req = { .new_page =1 };int err, update_time;
@@ -1545,7 +1545,7 @@ static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma,struct ubifs_inode *ui =ubifs_inode (inode);mutex_lock (&ui->ui_mutex); - inode->i_mtime = inode->i_ctime =ubifs_current_time (inode); + inode->i_mtime = inode->i_ctime =current_time (inode); release = ui->dirty;mark_inode_dirty_sync (inode);mutex_unlock (&ui->ui_mutex);
fs/ubifs/ioctl.c +1 -1
@@ -126,7 +126,7 @@ static int setflags(struct inode *inode, int flags) ui->flags =ioctl2ubifs (flags);ubifs_set_inode_flags (inode); - inode->i_ctime =ubifs_current_time (inode); + inode->i_ctime =current_time (inode); release = ui->dirty;mark_inode_dirty_sync (inode);mutex_unlock (&ui->ui_mutex);
fs/ubifs/misc.h +0 -10
@@ -225,16 +225,6 @@ static inline void *ubifs_idx_key(const struct ubifs_info *c, }/** -* ubifs_current_time - round current time to time granularity. -* @inode: inode -*/ -static inline struct timespec ubifs_current_time (struct inode *inode) -{ -return (inode->i_sb->s_time_gran <NSEC_PER_SEC ) ? -current_fs_time (inode->i_sb) :CURRENT_TIME_SEC ; -} - -/** * ubifs_tnc_lookup - look up a file-system node. * @c: UBIFS file-system description object * @key: node key to lookup
fs/ubifs/sb.c +10 -4
@@ -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; ino->mode =cpu_to_le32 (S_IFDIR |S_IRUGO |S_IWUSR |S_IXUGO ); ino->size =cpu_to_le64 (UBIFS_INO_NODE_SZ );
fs/ubifs/xattr.c +3 -3
@@ -152,7 +152,7 @@ static int create_xattr(struct ubifs_info *c, struct inode *host, ui->data_len = size;mutex_lock (&host_ui->ui_mutex); - host->i_ctime =ubifs_current_time (host); + host->i_ctime =current_time (host); host_ui->xattr_cnt +=1 ; host_ui->xattr_size +=CALC_DENT_SIZE (nm->len); host_ui->xattr_size +=CALC_XATTR_BYTES (size);
@@ -221,7 +221,7 @@ static int change_xattr(struct ubifs_info *c, struct inode *host,mutex_unlock (&ui->ui_mutex);mutex_lock (&host_ui->ui_mutex); - host->i_ctime =ubifs_current_time (host); + host->i_ctime =current_time (host); host_ui->xattr_size -=CALC_XATTR_BYTES (ui->data_len); host_ui->xattr_size +=CALC_XATTR_BYTES (size);
@@ -458,7 +458,7 @@ static int remove_xattr(struct ubifs_info *c, struct inode *host,return err;mutex_lock (&host_ui->ui_mutex); - host->i_ctime =ubifs_current_time (host); + host->i_ctime =current_time (host); host_ui->xattr_cnt -=1 ; host_ui->xattr_size -=CALC_DENT_SIZE (nm->len); host_ui->xattr_size -=CALC_XATTR_BYTES (ui->data_len);
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerRe: [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time
Quoted 18 lines · CEST Deepa Dinamani
fs/ubifs/sb.c +6
-1@@ -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);
fs/ubifs/sb.c static int create_default_filesystem(struct ubifs_info *c) · line 312
Quoted 10 lines
fs/ubifs/sb.c +4
-3ino->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
Re: [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time
Quoted 32 lines
Quoted 18 lines
fs/ubifs/sb.c +6
-1@@ -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);fs/ubifs/sb.c static int create_default_filesystem(struct ubifs_info *c) · line 312
Quoted 10 lines
fs/ubifs/sb.c +4
-3ino->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.
Quoted 2 lines
I'd suggest either leaving this part out of the patch series for now, or making it a separate patch that uses timespec64 directly.
This is actually the root inode which is created and written to disk. We actually want to use current_time() here, but this is not cached. So we don't have a vfs inode.
struct ubifs_ino_node represents inode format on the disk. I thought it would be odd to fill this with timespec64 only here. My plan was to switch it over to timespec64 when all of ubifs changes to use timespec64.
This also was helping the current series as it let me delete CURRENT_TIME macros.
I can add a comment to suggest this in code.
But, what you suggest should also work fine since the on disk representation is big enough to use timespec64 already. Let me know if you want me to drop this change for now as we delete CURRENT_TIME macros after rc1 now.
-Deepa
Arnd Bergmann
maintainerRe: [Y2038] [PATCH v2 07/24] fs: ubifs: Replace CURRENT_TIME_SEC with current_time
Quoted 6 lines · CEST Deepa Dinamani
Quoted 5 lines
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.
Quoted 8 lines
This is actually the root inode which is created and written to disk. We actually want to use
current_time()here, but this is not cached. So we don't have a vfs inode.struct
ubifs_ino_noderepresents inode format on the disk. I thought it would be odd to fill this with timespec64 only here. My plan was to switch it over to timespec64 when all of ubifs changes to use timespec64.
It is a bit odd, but I can't think of why that would be a problem. All the other instances have to wait until the inode timestamps are converted but this one does not.
Quoted 8 lines
This also was helping the current series as it let me delete
CURRENT_TIMEmacros.
I can add a comment to suggest this in code.But, what you suggest should also work fine since the on disk representation is big enough to use timespec64 already. Let me know if you want me to drop this change for now as we delete
CURRENT_TIMEmacros after rc1 now.
I'd leave it in.
Arnd
PATCH v2 8/24 fs: btrfs: Use ktime_get_real_ts for root ctime
In reply to Deepa Dinamanibtrfs_root_item maintains the ctime for root updates. This is not part of vfs_inode.
Since current_time() uses struct inode* as an argument as Linus suggested, this cannot be used to update root times unless, we modify the signature to use inode.
Since btrfs uses nanosecond time granularity, it can also use ktime_get_real_ts directly to obtain timestamp for the root. It is necessary to use the timespec time api here because the same btrfs_set_stack_timespec_*() apis are used for vfs inode times as well. These can be transitioned to using timespec64 when btrfs internally changes to use timespec64 as well.
--- fs/btrfs/root-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/root-tree.c +2 -1
@@ -496,10 +496,11 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, struct btrfs_root *root) {struct btrfs_root_item *item = &root->root_item; -struct timespec ct =current_fs_time (root->fs_info->sb); +struct timespec ct;spin_lock (&root->root_item_lock);btrfs_set_root_ctransid (item, trans->transid); +ktime_get_real_ts (&ct);btrfs_set_stack_timespec_sec (&item->ctime, ct.tv_sec);btrfs_set_stack_timespec_nsec (&item->ctime, ct.tv_nsec);spin_unlock (&root->root_item_lock);
Signature · 1 line
1.9.1
Re: [PATCH v2 08/24] fs: btrfs: Use ktime_get_real_ts for root ctime
Quoted 15 lines · Deepa Dinamani
btrfs_root_itemmaintains the ctime for root updates. This is not part ofvfs_inode.Since
current_time()uses struct inode* as an argument as Linus suggested, this cannot be used to update root times unless, we modify the signature to use inode.Since btrfs uses nanosecond time granularity, it can also use
ktime_get_real_tsdirectly to obtain timestamp for the root. It is necessary to use the timespec time api here because the same btrfs_set_stack_timespec_*() apis are used for vfs inode times as well. These can be transitioned to using timespec64 when btrfs internally changes to use timespec64 as well.
Quoted 3 lines
Signed-off-by Deepa Dinamani <[email protected]>Cc Chris Mason <[email protected]>Cc Josef Bacik <[email protected]>
PATCH v2 9/24 fs: udf: Replace CURRENT_TIME with current_time()
In reply to Deepa DinamaniCURRENT_TIME is not y2038 safe.
CURRENT_TIME macro is also not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps.
Logical Volume Integrity format is described to have the same timestamp format for "Recording Date and time" as the other [a,c,m]timestamps.
Hence using current_time() instead here promises to maintain the same granularity as other timestamps.
This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. As part of the effort current_fs_time() will be extended to do range checks.
--- fs/udf/super.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/udf/super.c +7 -2
@@ -1986,6 +1986,7 @@ static void udf_open_lvid(struct super_block *sb)struct buffer_head *bh = sbi->s_lvid_bh;struct logicalVolIntegrityDesc *lvid;struct logicalVolIntegrityDescImpUse *lvidiu; +struct timespec ts;if (!bh)return ;
@@ -1997,8 +1998,9 @@ static void udf_open_lvid(struct super_block *sb)mutex_lock (&sbi->s_alloc_mutex); lvidiu->impIdent.identSuffix[0 ] =UDF_OS_CLASS_UNIX ; lvidiu->impIdent.identSuffix[1 ] =UDF_OS_ID_LINUX ; +ktime_get_real_ts (&ts);udf_time_to_disk_stamp (&lvid->recordingDateAndTime, -CURRENT_TIME ); +timespec_trunc (ts, sb->s_time_gran)); lvid->integrityType =cpu_to_le32 (LVID_INTEGRITY_TYPE_OPEN ); lvid->descTag.descCRC = cpu_to_le16(
@@ -2019,6 +2021,7 @@ static void udf_close_lvid(struct super_block *sb)struct buffer_head *bh = sbi->s_lvid_bh;struct logicalVolIntegrityDesc *lvid;struct logicalVolIntegrityDescImpUse *lvidiu; +struct timespec ts;if (!bh)return ;
@@ -2030,7 +2033,9 @@ static void udf_close_lvid(struct super_block *sb)mutex_lock (&sbi->s_alloc_mutex); lvidiu->impIdent.identSuffix[0 ] =UDF_OS_CLASS_UNIX ; lvidiu->impIdent.identSuffix[1 ] =UDF_OS_ID_LINUX ; -udf_time_to_disk_stamp (&lvid->recordingDateAndTime,CURRENT_TIME ); +ktime_get_real_ts (&ts); +udf_time_to_disk_stamp (&lvid->recordingDateAndTime, +timespec_trunc (ts, sb->s_time_gran));if (UDF_MAX_WRITE_VERSION >le16_to_cpu (lvidiu->maxUDFWriteRev)) lvidiu->maxUDFWriteRev =cpu_to_le16 (UDF_MAX_WRITE_VERSION );if (sbi->s_udfrev >le16_to_cpu (lvidiu->minUDFReadRev))
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerRe: [Y2038] [PATCH v2 09/24] fs: udf: Replace CURRENT_TIME with current_time()
fs/udf/super.c static void udf_open_lvid(struct super_block *sb) · line 2006
Quoted 11 lines · CEST Deepa Dinamani
mutex_lock(&sbi->s_alloc_mutex); lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;fs/udf/super.c +2
-1+ktime_get_real_ts (&ts);udf_time_to_disk_stamp (&lvid->recordingDateAndTime, -CURRENT_TIME ); +timespec_trunc (ts, sb->s_time_gran)); lvid->integrityType =cpu_to_le32 (LVID_INTEGRITY_TYPE_OPEN ); lvid->descTag.descCRC = cpu_to_le16(
I think we don't need the timespec_trunc here, and introducing the call might complicate matters in the future.
IMHO timespec_trunc() really only makes sense when assigning into an inode timestamp, whereas udf_time_to_disk_stamp() already truncates the resulting nanoseconds to microseconds.
Arnd
Re: [Y2038] [PATCH v2 09/24] fs: udf: Replace CURRENT_TIME with current_time()
Quoted 10 lines · Arnd Bergmann
Quoted 9 lines · CEST Deepa Dinamani
mutex_lock(&sbi->s_alloc_mutex); lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX;fs/udf/super.c +2
-1+ktime_get_real_ts (&ts);udf_time_to_disk_stamp (&lvid->recordingDateAndTime, -CURRENT_TIME ); +timespec_trunc (ts, sb->s_time_gran)); lvid->integrityType =cpu_to_le32 (LVID_INTEGRITY_TYPE_OPEN );
Quoted 5 lines
Quoted 2 lines
lvid->descTag.descCRC = cpu_to_le16(I think we don't need the
timespec_trunchere, and introducing the call might complicate matters in the future.
This was done so that it could be similar to inode timestamps as both have same format and use same formatting functions.
Quoted 3 lines
IMHO
timespec_trunc()really only makes sense when assigning into an inode timestamp, whereasudf_time_to_disk_stamp()already truncates the resulting nanoseconds to microseconds.
I reconsidered our discussion.
I think you are correct.
I missed that the prints using microseconds format would actually convert seconds
also to microseconds and not just nanoseconds.
I will remove the timespec_trunc here and post a v3.
Thanks,
-Deepa
PATCH v2 10/24 fs: cifs: Replace CURRENT_TIME by current_time()
In reply to Deepa DinamaniCURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_time() instead.
This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe.
CURRENT_TIME macro will be deleted before merging the aforementioned change.
Change signature of helper cifs_all_info_to_fattr since it now needs both super_block and cifs_sb_info.
Note: The inode timestamps read from the server are assumed to have correct granularity and range.
--- fs/cifs/inode.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
fs/cifs/inode.c +11 -9
@@ -320,9 +320,9 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) fattr->cf_mode =S_IFDIR |S_IXUGO |S_IRWXU ; fattr->cf_uid = cifs_sb->mnt_uid; fattr->cf_gid = cifs_sb->mnt_gid; - fattr->cf_atime =CURRENT_TIME ; - fattr->cf_ctime =CURRENT_TIME ; - fattr->cf_mtime =CURRENT_TIME ; +ktime_get_real_ts (&fattr->cf_mtime); + fattr->cf_mtime =timespec_trunc (fattr->cf_mtime, sb->s_time_gran); + fattr->cf_atime = fattr->cf_ctime = fattr->cf_mtime; fattr->cf_nlink =2 ; fattr->cf_flags |=CIFS_FATTR_DFS_REFERRAL ; }
@@ -584,9 +584,10 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,/* Fill a cifs_fattr struct with info from FILE_ALL_INFO */ static void cifs_all_info_to_fattr (struct cifs_fattr *fattr,FILE_ALL_INFO *info, -struct cifs_sb_info *cifs_sb,bool adjust_tz, +struct super_block *sb,bool adjust_tz,bool symlink) { +struct cifs_sb_info *cifs_sb =CIFS_SB (sb);struct cifs_tcon *tcon =cifs_sb_master_tcon (cifs_sb);memset (fattr,0 ,sizeof (*fattr));
@@ -596,8 +597,10 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,if (info->LastAccessTime) fattr->cf_atime =cifs_NTtimeToUnix (info->LastAccessTime); -else - fattr->cf_atime =CURRENT_TIME ; +else { +ktime_get_real_ts (&fattr->cf_atime); + fattr->cf_atime =timespec_trunc (fattr->cf_atime, sb->s_time_gran); + } fattr->cf_ctime =cifs_NTtimeToUnix (info->ChangeTime); fattr->cf_mtime =cifs_NTtimeToUnix (info->LastWriteTime);
@@ -657,7 +660,6 @@ cifs_get_file_info(struct file *filp)FILE_ALL_INFO find_data;struct cifs_fattr fattr;struct inode *inode =file_inode (filp); -struct cifs_sb_info *cifs_sb =CIFS_SB (inode->i_sb);struct cifsFileInfo *cfile = filp->private_data;struct cifs_tcon *tcon =tlink_tcon (cfile->tlink);struct TCP_Server_Info *server = tcon->ses->server;
@@ -669,7 +671,7 @@ cifs_get_file_info(struct file *filp) rc = server->ops->query_file_info (xid, tcon, &cfile->fid, &find_data);switch (rc) {case 0 : -cifs_all_info_to_fattr (&fattr, &find_data, cifs_sb, false, +cifs_all_info_to_fattr (&fattr, &find_data, inode->i_sb, false, false);break ;case -EREMOTE :
@@ -751,7 +753,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path, }if (!rc) { -cifs_all_info_to_fattr (&fattr, data, cifs_sb, adjust_tz, +cifs_all_info_to_fattr (&fattr, data, sb, adjust_tz, symlink); }else if (rc == -EREMOTE ) {cifs_create_dfs_fattr (&fattr, sb);
Signature · 1 line
1.9.1
PATCH v2 11/24 fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts()
In reply to Deepa DinamaniThis is in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe.
CURRENT_TIME macro will be deleted before merging the aforementioned patch.
Filesystem times will use current_fs_time() instead of CURRENT_TIME.
Use ktime_get_real_ts() here as this is not filesystem time. ktime_get_real_ts() returns the timestamp in ns which can be used to calculate network time for NTLMv2 authentication timestamp.
All cifs timestamps currently use timespec internally. This timestamp can also be transitioned into using timespec64 when all other timestamps for cifs is transitioned to use timespec64.
--- fs/cifs/cifsencrypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/cifs/cifsencrypt.c +3 -1
@@ -471,6 +471,7 @@ find_timestamp(struct cifs_ses *ses)unsigned char *blobptr;unsigned char *blobend;struct ntlmssp2_name *attrptr; +struct timespec ts;if (!ses->auth_key.len || !ses->auth_key.response)return 0 ;
@@ -495,7 +496,8 @@ find_timestamp(struct cifs_ses *ses) blobptr += attrsize;/* advance attr value */ } -return cpu_to_le64 (cifs_UnixTimeToNT (CURRENT_TIME )); +ktime_get_real_ts (&ts); +return cpu_to_le64 (cifs_UnixTimeToNT (ts)); } static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
Signature · 1 line
1.9.1
PATCH v2 12/24 fs: cifs: Replace CURRENT_TIME by get_seconds
In reply to Deepa DinamaniThis is in preparation for the change that transitions filesystem timestamps to use 64 bit time and hence make them y2038 safe.
CURRENT_TIME macro will be deleted before merging the aforementioned patch.
Filesystems will use current_time() instead of CURRENT_TIME.
Use ktime_get_real_seconds() here as this is not filesystem time.
Only the seconds portion of the timestamp is necessary for timezone calculation using server time.
Assume that the difference between server and client times lie in the range INT_MIN..INT_MAX. This is valid because this is the difference between current times between server and client, and the largest timezone difference is in the range of one day.
All cifs timestamps currently use timespec internally. This timestamp can also be transitioned into using timespec64 when all other timestamps for cifs is transitioned to use timespec64.
--- fs/cifs/cifssmb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
fs/cifs/cifssmb.c +5 -5
@@ -478,14 +478,14 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr)* this requirement. */ int val, seconds, remain, result; -struct timespec ts, utc; - utc =CURRENT_TIME ; +struct timespec ts; +unsigned long utc =ktime_get_real_seconds (); ts =cnvrtDosUnixTm (rsp->SrvTime.Date, rsp->SrvTime.Time,0 );cifs_dbg (FYI ,"SrvTime %d sec since 1970 (utc: %d) diff: %d\n" , - (int )ts.tv_sec, (int )utc.tv_sec, - (int )(utc.tv_sec - ts.tv_sec)); - val = (int )(utc.tv_sec - ts.tv_sec); + (int )ts.tv_sec, (int )utc, + (int )(utc - ts.tv_sec)); + val = (int )(utc - ts.tv_sec); seconds =abs (val); result = (seconds /MIN_TZ_ADJ ) *MIN_TZ_ADJ ; remain = seconds %MIN_TZ_ADJ ;
Signature · 1 line
1.9.1
PATCH v2 13/24 fs: f2fs: Use ktime_get_real_seconds for sit_info times
In reply to Deepa DinamaniCURRENT_TIME_SEC is not y2038 safe.
Replace use of CURRENT_TIME_SEC with ktime_get_real_seconds in segment timestamps used by GC algorithm including the segment mtime timestamps.
--- fs/f2fs/segment.c | 2 +- fs/f2fs/segment.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
fs/f2fs/segment.c +1 -1
@@ -2156,7 +2156,7 @@ static int build_sit_info(struct f2fs_sb_info *sbi) sit_i->dirty_sentries =0 ; sit_i->sents_per_block =SIT_ENTRY_PER_BLOCK ; sit_i->elapsed_time =le64_to_cpu (sbi->ckpt->elapsed_time); - sit_i->mounted_time =CURRENT_TIME_SEC .tv_sec; + sit_i->mounted_time =ktime_get_real_seconds ();mutex_init (&sit_i->sentry_lock);return 0 ; }
fs/f2fs/segment.h +3 -2
@@ -661,8 +661,9 @@ static inline void set_to_next_sit(struct sit_info *sit_i, unsigned int start)static inline unsigned long long get_mtime (struct f2fs_sb_info *sbi) {struct sit_info *sit_i =SIT_I (sbi); -return sit_i->elapsed_time +CURRENT_TIME_SEC .tv_sec - - sit_i->mounted_time; +time64_t now =ktime_get_real_seconds (); + +return sit_i->elapsed_time + now - sit_i->mounted_time; } static inline void set_summary(struct f2fs_summary *sum, nid_t nid,
Signature · 6 lines
1.9.1 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
PATCH v2 14/24 drivers: staging: lustre: Replace CURRENT_TIME with current_time()
In reply to Deepa DinamaniCURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_time() instead.
This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. As part of the effort current_time() will be extended to do range checks. Hence, it is necessary for all file system timestamps to use current_time().
Also change format string for prints so that these are valid when vfs is transitioned to use 64 bit timestamps.
--- drivers/staging/lustre/lustre/llite/llite_lib.c | 16 ++++++++-------- drivers/staging/lustre/lustre/llite/namei.c | 4 ++-- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 6 +++--- .../staging/lustre/lustre/obdclass/linux/linux-obdo.c | 6 +++--- drivers/staging/lustre/lustre/obdclass/obdo.c | 6 +++--- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-)
drivers/staging/lustre/lustre/llite/llite_lib.c +8 -8
@@ -1258,23 +1258,23 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)/* We mark all of the fields "set" so MDS/OST does not re-set them */ if (attr->ia_valid &ATTR_CTIME ) { - attr->ia_ctime =CURRENT_TIME ; + attr->ia_ctime =current_time (inode); attr->ia_valid |=ATTR_CTIME_SET ; }if (!(attr->ia_valid &ATTR_ATIME_SET ) && (attr->ia_valid &ATTR_ATIME )) { - attr->ia_atime =CURRENT_TIME ; + attr->ia_atime =current_time (inode); attr->ia_valid |=ATTR_ATIME_SET ; }if (!(attr->ia_valid &ATTR_MTIME_SET ) && (attr->ia_valid &ATTR_MTIME )) { - attr->ia_mtime =CURRENT_TIME ; + attr->ia_mtime =current_time (inode); attr->ia_valid |=ATTR_MTIME_SET ; }if (attr->ia_valid & (ATTR_MTIME |ATTR_CTIME )) -CDEBUG (D_INODE ,"setting mtime %lu, ctime %lu, now = %llu\n" , -LTIME_S (attr->ia_mtime),LTIME_S (attr->ia_ctime), +CDEBUG (D_INODE ,"setting mtime %llu, ctime %llu, now = %llu\n" , + (long long )LTIME_S (attr->ia_mtime), (long long )LTIME_S (attr->ia_ctime), (s64 )ktime_get_real_seconds ());/* We always do an MDS RPC, even if we're only changing the size;
@@ -1564,9 +1564,9 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md) }if (body->valid &OBD_MD_FLMTIME ) {if (body->mtime >LTIME_S (inode->i_mtime)) { -CDEBUG (D_INODE ,"setting ino %lu mtime from %lu to %llu\n" , - inode->i_ino,LTIME_S (inode->i_mtime), - body->mtime); +CDEBUG (D_INODE ,"setting ino %lu mtime from %llu to %llu\n" , + inode->i_ino, (unsigned long long )LTIME_S (inode->i_mtime), + (unsigned long long )body->mtime);LTIME_S (inode->i_mtime) = body->mtime; } lli->lli_mtime = body->mtime;
drivers/staging/lustre/lustre/llite/namei.c +2 -2
@@ -731,8 +731,8 @@ static void ll_update_times(struct ptlrpc_request *request,LASSERT (body);if (body->valid &OBD_MD_FLMTIME && body->mtime >LTIME_S (inode->i_mtime)) { -CDEBUG (D_INODE ,"setting fid " DFID " mtime from %lu to %llu\n" , -PFID (ll_inode2fid (inode)),LTIME_S (inode->i_mtime), +CDEBUG (D_INODE ,"setting fid " DFID " mtime from %llu to %llu\n" , +PFID (ll_inode2fid (inode)), (unsigned long long )LTIME_S (inode->i_mtime), body->mtime);LTIME_S (inode->i_mtime) = body->mtime; }
drivers/staging/lustre/lustre/mdc/mdc_reint.c +3 -3
@@ -143,9 +143,9 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data, rpc_lock = obd->u.cli.cl_rpc_lock;if (op_data->op_attr.ia_valid & (ATTR_MTIME |ATTR_CTIME )) -CDEBUG (D_INODE ,"setting mtime %ld, ctime %ld\n" , -LTIME_S (op_data->op_attr.ia_mtime), -LTIME_S (op_data->op_attr.ia_ctime)); +CDEBUG (D_INODE ,"setting mtime %lld, ctime %lld\n" , + (long long )LTIME_S (op_data->op_attr.ia_mtime), + (long long )LTIME_S (op_data->op_attr.ia_ctime));mdc_setattr_pack (req, op_data, ea, ealen, ea2, ea2len);ptlrpc_request_set_replen (req);
drivers/staging/lustre/lustre/obdclass/linux/linux-obdo.c +3 -3
@@ -54,9 +54,9 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, u32 valid)if (valid & (OBD_MD_FLCTIME |OBD_MD_FLMTIME ))CDEBUG (D_INODE , -"valid %#llx, cur time %lu/%lu, new %llu/%llu\n" , - src->o_valid,LTIME_S (dst->i_mtime), -LTIME_S (dst->i_ctime), src->o_mtime, src->o_ctime); +"valid %#llx, cur time %llu/%llu, new %llu/%llu\n" , + src->o_valid, (unsigned long long )LTIME_S (dst->i_mtime), + (unsigned long long )LTIME_S (dst->i_ctime), src->o_mtime, src->o_ctime);if (valid &OBD_MD_FLATIME && src->o_atime >LTIME_S (dst->i_atime))LTIME_S (dst->i_atime) = src->o_atime;
drivers/staging/lustre/lustre/obdclass/obdo.c +3 -3
@@ -62,9 +62,9 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid)u32 newvalid =0 ;if (valid & (OBD_MD_FLCTIME |OBD_MD_FLMTIME )) -CDEBUG (D_INODE ,"valid %x, new time %lu/%lu\n" , - valid,LTIME_S (src->i_mtime), -LTIME_S (src->i_ctime)); +CDEBUG (D_INODE ,"valid %x, new time %llu/%llu\n" , + valid, (unsigned long long )LTIME_S (src->i_mtime), + (unsigned long long )LTIME_S (src->i_ctime));if (valid &OBD_MD_FLATIME ) { dst->o_atime =LTIME_S (src->i_atime);
drivers/staging/lustre/lustre/osc/osc_io.c +1 -1
@@ -221,7 +221,7 @@ static void osc_page_touch_at(const struct lu_env *env, kms > loi->loi_kms ?"" :"not " , loi->loi_kms, kms, loi->loi_lvb.lvb_size); - attr->cat_mtime = attr->cat_ctime =LTIME_S (CURRENT_TIME ); + attr->cat_mtime = attr->cat_ctime =ktime_get_real_seconds (); valid =CAT_MTIME |CAT_CTIME ;if (kms > loi->loi_kms) { attr->cat_kms = kms;
Signature · 1 line
1.9.1
PATCH v2 15/24 fs: ocfs2: Use time64_t to represent orphan scan times
In reply to Deepa Dinamanistruct 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.
--- fs/ocfs2/journal.c | 4 ++-- fs/ocfs2/ocfs2.h | 2 +- fs/ocfs2/super.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
fs/ocfs2/journal.c +2 -2
@@ -1946,7 +1946,7 @@ static void ocfs2_queue_orphan_scan(struct ocfs2_super *osb)*/ seqno++; os->os_count++; - os->os_scantime =CURRENT_TIME ; + os->os_scantime =ktime_get_seconds (); unlock:ocfs2_orphan_scan_unlock (osb, seqno); out:
@@ -2003,7 +2003,7 @@ void ocfs2_orphan_scan_start(struct ocfs2_super *osb)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 {
fs/ocfs2/ocfs2.h +1 -1
@@ -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 */
fs/ocfs2/super.c +1 -1
@@ -337,7 +337,7 @@ static int ocfs2_osb_dump(struct ocfs2_super *osb, char *buf, int len) 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" );
Signature · 1 line
1.9.1
PATCH v2 16/24 fs: ocfs2: Replace CURRENT_TIME with ktime_get_real_seconds()
In reply to Deepa DinamaniCURRENT_TIME is not y2038 safe.
Use y2038 safe ktime_get_real_seconds() here for timestamps.
struct heartbeat_block's hb_seq and deletetion time are already 64 bits wide and accommodate times beyond y2038.
--- fs/ocfs2/cluster/heartbeat.c | 2 +- fs/ocfs2/inode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/cluster/heartbeat.c +1 -1
@@ -741,7 +741,7 @@ static inline void o2hb_prepare_block(struct o2hb_region *reg, hb_block = (struct o2hb_disk_heartbeat_block *)slot->ds_raw_block;memset (hb_block,0 , reg->hr_block_bytes);/* TODO: time stuff */ - cputime =CURRENT_TIME .tv_sec; + cputime =ktime_get_real_seconds ();if (!cputime) cputime =1 ;
fs/ocfs2/inode.c +1 -1
@@ -703,7 +703,7 @@ static int ocfs2_remove_inode(struct inode *inode, goto bail_commit; } - di->i_dtime =cpu_to_le64 (CURRENT_TIME .tv_sec); + di->i_dtime =cpu_to_le64 (ktime_get_real_seconds ()); di->i_flags &=cpu_to_le32 (~(OCFS2_VALID_FL |OCFS2_ORPHANED_FL ));ocfs2_journal_dirty (handle, di_bh);
Signature · 1 line
1.9.1
PATCH v2 17/24 audit: Use timespec64 to represent audit timestamps
In reply to Deepa Dinamanistruct timespec is not y2038 safe.
Audit timestamps are recorded in string format into an audit buffer for a given context.
These mark the entry timestamps for the syscalls. Use y2038 safe struct timespec64 to represent the times. The log strings can handle this transition as strings can hold upto 1024 characters.
--- include/linux/audit.h | 4 ++-- kernel/audit.c | 10 +++++----- kernel/audit.h | 2 +- kernel/auditsc.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-)
include/linux/audit.h +2 -2
@@ -335,7 +335,7 @@ static inline void audit_ptrace(struct task_struct *t)/* Private API (for audit.c only) */ extern unsigned int audit_serial (void );extern int auditsc_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial); +struct timespec64 *t,unsigned int *serial);extern int audit_set_loginuid (kuid_t loginuid);static inline kuid_t audit_get_loginuid (struct task_struct *tsk)
@@ -510,7 +510,7 @@ static inline void __audit_seccomp(unsigned long syscall, long signr, int code)static inline void audit_seccomp (unsigned long syscall,long signr,int code) { }static inline int auditsc_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial) +struct timespec64 *t,unsigned int *serial) {return 0 ; }
kernel/audit.c +5 -5
@@ -1325,10 +1325,10 @@ unsigned int audit_serial(void) }static inline void audit_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial) +struct timespec64 *t,unsigned int *serial) {if (!ctx || !auditsc_get_stamp (ctx, t, serial)) { - *t =CURRENT_TIME ; +ktime_get_real_ts64 (t); *serial =audit_serial (); } }
@@ -1370,7 +1370,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type) {struct audit_buffer *ab =NULL ; -struct timespec t; +struct timespec64 t;unsigned int uninitialized_var (serial );int reserve =5 ;/* Allow atomic callers to go up to five entries over the normal backlog limit */
@@ -1422,8 +1422,8 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,audit_get_stamp (ab->ctx, &t, &serial); -audit_log_format (ab,"audit(%lu.%03lu:%u): " , - t.tv_sec, t.tv_nsec/1000000 , serial); +audit_log_format (ab,"audit(%llu.%03lu:%u): " , + (unsigned long long )t.tv_sec, t.tv_nsec/1000000 , serial);return ab; }
kernel/audit.h +1 -1
@@ -111,7 +111,7 @@ struct audit_context {enum audit_state state, current_state;unsigned int serial;/* serial number for record */ int major;/* syscall number */ -struct timespec ctime;/* time of syscall entry */ +struct timespec64 ctime;/* time of syscall entry */ unsigned long argv[4 ];/* syscall arguments */ long return_code;/* syscall return code */ u64 prio;
kernel/auditsc.c +3 -3
@@ -1527,7 +1527,7 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2,return ; context->serial =0 ; - context->ctime =CURRENT_TIME ; +ktime_get_real_ts64 (&context->ctime); context->in_syscall =1 ; context->current_state = state; context->ppid =0 ;
@@ -1936,13 +1936,13 @@ EXPORT_SYMBOL_GPL(__audit_inode_child);/** * auditsc_get_stamp - get local copies of audit_context values * @ctx: audit_context for the task -* @t: timespec to store time recorded in the audit_context +* @t: timespec64 to store time recorded in the audit_context * @serial: serial value that is recorded in the audit_context * * Also sets the context as auditable. */ int auditsc_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial) +struct timespec64 *t,unsigned int *serial) {if (!ctx->in_syscall)return 0 ;
Signature · 6 lines
1.9.1 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Re: [PATCH v2 17/24] audit: Use timespec64 to represent audit timestamps
Quoted 8 lines · Deepa Dinamani
struct timespec is not y2038 safe.
Audit timestamps are recorded in string format into an audit buffer for a given context.
These mark the entry timestamps for the syscalls. Use y2038 safe struct timespec64 to represent the times. The log strings can handle this transition as strings can hold upto 1024 characters.
Quoted 5 lines
Signed-off-by Deepa Dinamani <[email protected]>Cc Paul Moore <[email protected]>Cc Eric Paris <[email protected]>Acked-by Paul Moore <[email protected]>
Quoted 115 lines
--- include/linux/audit.h | 4 ++-- kernel/audit.c | 10 +++++----- kernel/audit.h | 2 +- kernel/auditsc.c | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-)include/linux/audit.h +2
-2@@ -335,7 +335,7 @@ static inline void audit_ptrace(struct task_struct *t)/* Private API (for audit.c only) */ extern unsigned int audit_serial (void );extern int auditsc_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial); +struct timespec64 *t,unsigned int *serial);extern int audit_set_loginuid (kuid_t loginuid);static inline kuid_t audit_get_loginuid (struct task_struct *tsk)@@ -510,7 +510,7 @@ static inline void __audit_seccomp(unsigned long syscall, long signr, int code)static inline void audit_seccomp (unsigned long syscall,long signr,int code) { }static inline int auditsc_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial) +struct timespec64 *t,unsigned int *serial) {return 0 ; }kernel/audit.c +5
-5@@ -1325,10 +1325,10 @@ unsigned int audit_serial(void) }static inline void audit_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial) +struct timespec64 *t,unsigned int *serial) {if (!ctx || !auditsc_get_stamp (ctx, t, serial)) { - *t =CURRENT_TIME ; +ktime_get_real_ts64 (t); *serial =audit_serial (); } }@@ -1370,7 +1370,7 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type) {struct audit_buffer *ab =NULL ; -struct timespec t; +struct timespec64 t;unsigned int uninitialized_var (serial );int reserve =5 ;/* Allow atomic callers to go up to five entries over the normal backlog limit */ @@ -1422,8 +1422,8 @@ struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask,audit_get_stamp (ab->ctx, &t, &serial); -audit_log_format (ab,"audit(%lu.%03lu:%u): " , - t.tv_sec, t.tv_nsec/1000000 , serial); +audit_log_format (ab,"audit(%llu.%03lu:%u): " , + (unsigned long long )t.tv_sec, t.tv_nsec/1000000 , serial);return ab; }kernel/audit.h +1
-1@@ -111,7 +111,7 @@ struct audit_context {enum audit_state state, current_state;unsigned int serial;/* serial number for record */ int major;/* syscall number */ -struct timespec ctime;/* time of syscall entry */ +struct timespec64 ctime;/* time of syscall entry */ unsigned long argv[4 ];/* syscall arguments */ long return_code;/* syscall return code */ u64 prio;kernel/auditsc.c +3
-3@@ -1527,7 +1527,7 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2,return ; context->serial =0 ; - context->ctime =CURRENT_TIME ; +ktime_get_real_ts64 (&context->ctime); context->in_syscall =1 ; context->current_state = state; context->ppid =0 ;@@ -1936,13 +1936,13 @@ EXPORT_SYMBOL_GPL(__audit_inode_child);/** * auditsc_get_stamp - get local copies of audit_context values * @ctx: audit_context for the task -* @t: timespec to store time recorded in the audit_context +* @t: timespec64 to store time recorded in the audit_context * @serial: serial value that is recorded in the audit_context * * Also sets the context as auditable. */ int auditsc_get_stamp (struct audit_context *ctx, -struct timespec *t,unsigned int *serial) +struct timespec64 *t,unsigned int *serial) {if (!ctx->in_syscall)return 0 ;Signature · 6 lines
1.9.1 -- Linux-audit mailing list [email protected] https://www.redhat.com/mailman/listinfo/linux-audit
- RGB
--
Richard Guy Briggs <[email protected]>
Kernel Security Engineering, Base Operating Systems, Red Hat Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635
_______________________________________________
Y2038 mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/y2038
PATCH v2 18/24 fs: nfs: Make nfs boot time y2038 safe
In reply to Deepa Dinamaniboot_time is represented as a struct timespec. struct timespec and CURRENT_TIME are not y2038 safe. Overall, the plan is to use timespec64 and ktime_t for all internal kernel representation of timestamps. CURRENT_TIME will also be removed.
boot_time is used to construct the nfs client boot verifier.
Use ktime_t to represent boot_time and ktime_get_real() for the boot_time value.
Following Trond's request https://lkml.org/lkml/2016/6/9/22 , use ktime_t instead of converting to struct timespec64.
Use higher and lower 32 bit parts of ktime_t for the boot verifier.
Use the lower 32 bit part of ktime_t for the authsys_parms stamp field.
---
Changes from V1:
* Use ktime_t instead of timespec64_t
* Change algorithm to use boot_time accordingly
fs/nfs/client.c | 2 +- fs/nfs/netns.h | 2 +- fs/nfs/nfs4proc.c | 10 ++++++---- fs/nfs/nfs4xdr.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-)
fs/nfs/client.c +1 -1
@@ -1080,7 +1080,7 @@ void nfs_clients_init(struct net *net)idr_init (&nn->cb_ident_idr);#endif spin_lock_init (&nn->nfs_client_lock); - nn->boot_time =CURRENT_TIME ; + nn->boot_time =ktime_get_real (); }#ifdef CONFIG_PROC_FS
fs/nfs/netns.h +1 -1
@@ -29,7 +29,7 @@ struct nfs_net {int cb_users[NFS4_MAX_MINOR_VERSION +1 ];#endif spinlock_t nfs_client_lock; -struct timespec boot_time; +ktime_t boot_time;#ifdef CONFIG_PROC_FS struct proc_dir_entry *proc_nfsfs;#endif
fs/nfs/nfs4proc.c +6 -4
@@ -5062,12 +5062,14 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,if (test_bit (NFS4CLNT_PURGE_STATE , &clp->cl_state)) {/* An impossible timestamp guarantees this value * will never match a generated boot time. */ - verf[0 ] =0 ; - verf[1 ] =cpu_to_be32 (NSEC_PER_SEC +1 ); + verf[0 ] =cpu_to_be32 (U32_MAX ); + verf[1 ] =cpu_to_be32 (U32_MAX ); }else {struct nfs_net *nn =net_generic (clp->cl_net, nfs_net_id); - verf[0 ] =cpu_to_be32 (nn->boot_time.tv_sec); - verf[1 ] =cpu_to_be32 (nn->boot_time.tv_nsec); +u64 ns =ktime_to_ns (nn->boot_time); + + verf[0 ] =cpu_to_be32 (ns >>32 ); + verf[1 ] =cpu_to_be32 (ns); }memcpy (bootverf->data, verf,sizeof (bootverf->data)); }
fs/nfs/nfs4xdr.c +1 -1
@@ -1850,7 +1850,7 @@ static void encode_create_session(struct xdr_stream *xdr, *p++ =cpu_to_be32 (RPC_AUTH_UNIX );/* auth_sys */ /* authsys_parms rfc1831 */ - *p++ =cpu_to_be32 (nn->boot_time.tv_nsec);/* stamp */ + *p++ =cpu_to_be32 (ktime_to_ns (nn->boot_time));/* stamp */ p =xdr_encode_array (p, clnt->cl_nodename, clnt->cl_nodelen); *p++ =cpu_to_be32 (0 );/* UID */ *p++ =cpu_to_be32 (0 );/* GID */
Signature · 1 line
1.9.1
PATCH v2 19/24 fnic: Use time64_t to represent trace timestamps
In reply to Deepa Dinamanitrace timestamps use struct timespec and CURRENT_TIME which are not y2038 safe.
These timestamps are only part of the trace log on the machine and are not shared with the fnic.
Replace then with y2038 safe struct timespec64 and ktime_get_real_ts64(), respectively.
Note that change to add time64_to_tm() is already part of John's kernel tree: https://lkml.org/lkml/2016/6/17/875 .
--- drivers/scsi/fnic/fnic_trace.c | 4 ++-- drivers/scsi/fnic/fnic_trace.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/fnic/fnic_trace.c +2 -2
@@ -613,7 +613,7 @@ int fnic_fc_trace_set_data(u32 host_no, u8 frame_type, fc_trace_entries.rd_idx =0 ; } - fc_buf->time_stamp =CURRENT_TIME ; +ktime_get_real_ts64 (&fc_buf->time_stamp); fc_buf->host_no = host_no; fc_buf->frame_type = frame_type;
@@ -740,7 +740,7 @@ void copy_and_format_trace_data(struct fc_trace_hdr *tdata, len = *orig_len; -time_to_tm (tdata->time_stamp.tv_sec,0 , &tm); +time64_to_tm (tdata->time_stamp.tv_sec,0 , &tm); fmt ="%02d:%02d:%04ld %02d:%02d:%02d.%09lu ns%8x %c%8x\t" ; len += snprintf(fnic_dbgfs_prt->buffer + len,
drivers/scsi/fnic/fnic_trace.h +1 -1
@@ -72,7 +72,7 @@ struct fnic_trace_data {typedef struct fnic_trace_data fnic_trace_data_t ;struct fc_trace_hdr { -struct timespec time_stamp; +struct timespec64 time_stamp;u32 host_no;u8 frame_type;u8 frame_len;
Signature · 6 lines
1.9.1 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Arnd Bergmann
maintainerRe: [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps
Quoted 10 lines · CEST Deepa Dinamani
trace timestamps use struct timespec and
CURRENT_TIMEwhich are not y2038 safe.
These timestamps are only part of the trace log on the machine and are not shared with the fnic.
Replace then with y2038 safe struct timespec64 andktime_get_real_ts64(), respectively.Note that change to add
time64_to_tm()is already part of John's kernel tree: https://lkml.org/lkml/2016/6/17/875 .
While the patch looks good, I think it can't be part of this series now, since it has to go on top of that first patch, rather than merged in parallel.
When you send a pull request, please leave it out and submit this one separately after 4.8-rc1.
Arnd
Re: [PATCH v2 19/24] fnic: Use time64_t to represent trace timestamps
Quoted 8 lines · Arnd Bergmann
Quoted 7 lines · CEST Deepa Dinamani
trace timestamps use struct timespec and
CURRENT_TIMEwhich are not y2038 safe.
These timestamps are only part of the trace log on the machine and are not shared with the fnic.
Replace then with y2038 safe struct timespec64 andktime_get_real_ts64(), respectively.
Quoted 7 lines
Quoted 3 lines
Note that change to add
time64_to_tm()is already part of John's kernel tree: https://lkml.org/lkml/2016/6/17/875 .While the patch looks good, I think it can't be part of this series now, since it has to go on top of that first patch, rather than merged in parallel.
Oh, I didn't realize we could merge these in parallel. I thought the time64_to_tm() had to go in first.
Quoted 2 lines
When you send a pull request, please leave it out and submit this one separately after 4.8-rc1.
Will do.
Thanks,
Deepa
PATCH v2 20/24 block: Replace CURRENT_TIME with ktime_get_real_ts
In reply to Deepa DinamaniCURRENT_TIME is not y2038 safe.
The macro will be deleted and all the references to it will be replaced by ktime_get_* apis.
struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph uses it internally everywhere.
These references will be changed to use struct timespec64 in a separate patch.
--- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/block/rbd.c +1 -1
@@ -1888,7 +1888,7 @@ static void rbd_osd_req_format_write(struct rbd_obj_request *obj_request) {struct ceph_osd_request *osd_req = obj_request->osd_req; - osd_req->r_mtime =CURRENT_TIME ; +ktime_get_real_ts (&osd_req->r_mtime); osd_req->r_data_offset = obj_request->offset; }
Signature · 6 lines
1.9.1 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
PATCH v2 21/24 libceph: Replace CURRENT_TIME with ktime_get_real_ts
In reply to Deepa DinamaniCURRENT_TIME is not y2038 safe.
The macro will be deleted and all the references to it will be replaced by ktime_get_* apis.
struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph uses it internally everywhere.
These references will be changed to use struct timespec64 in a separate patch.
--- net/ceph/messenger.c | 6 ++++-- net/ceph/osd_client.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
net/ceph/messenger.c +4 -2
@@ -1366,8 +1366,9 @@ static void prepare_write_keepalive(struct ceph_connection *con)dout ("prepare_write_keepalive %p\n" , con);con_out_kvec_reset (con);if (con->peer_features &CEPH_FEATURE_MSGR_KEEPALIVE2 ) { -struct timespec now =CURRENT_TIME ; +struct timespec now; +ktime_get_real_ts (&now);con_out_kvec_add (con,sizeof (tag_keepalive2), &tag_keepalive2);ceph_encode_timespec (&con->out_temp_keepalive2, &now); con_out_kvec_add(con, sizeof(con->out_temp_keepalive2),
@@ -3149,8 +3150,9 @@ bool ceph_con_keepalive_expired(struct ceph_connection *con, {if (interval >0 && (con->peer_features &CEPH_FEATURE_MSGR_KEEPALIVE2 )) { -struct timespec now =CURRENT_TIME ; +struct timespec now;struct timespec ts; +ktime_get_real_ts (&now);jiffies_to_timespec (interval, &ts); ts =timespec_add (con->last_keepalive_ack, ts);return timespec_compare (&now, &ts) >=0 ;
net/ceph/osd_client.c +2 -2
@@ -3567,7 +3567,7 @@ ceph_osdc_watch(struct ceph_osd_client *osdc,ceph_oid_copy (&lreq->t.base_oid, oid);ceph_oloc_copy (&lreq->t.base_oloc, oloc); lreq->t.flags =CEPH_OSD_FLAG_WRITE |CEPH_OSD_FLAG_ONDISK ; - lreq->mtime =CURRENT_TIME ; +ktime_get_real_ts (&lreq->mtime); lreq->reg_req =alloc_linger_request (lreq);if (!lreq->reg_req) {
@@ -3625,7 +3625,7 @@ int ceph_osdc_unwatch(struct ceph_osd_client *osdc,ceph_oid_copy (&req->r_base_oid, &lreq->t.base_oid);ceph_oloc_copy (&req->r_base_oloc, &lreq->t.base_oloc); req->r_flags =CEPH_OSD_FLAG_WRITE |CEPH_OSD_FLAG_ONDISK ; - req->r_mtime =CURRENT_TIME ; +ktime_get_real_ts (&req->r_mtime);osd_req_op_watch_init (req,0 , lreq->linger_id,CEPH_OSD_WATCH_OP_UNWATCH );
Signature · 6 lines
1.9.1 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
Re: [PATCH v2 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts
Quoted 15 lines · Deepa Dinamani
CURRENT_TIMEis not y2038 safe.
The macro will be deleted and all the references to it will be replaced by ktime_get_* apis.struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph uses it internally everywhere.
These references will be changed to use struct timespec64 in a separate patch.Signed-off-by Deepa Dinamani <[email protected]>Cc "Yan, Zheng" <[email protected]>Cc Sage Weil <[email protected]>Cc Ilya Dryomov <[email protected]>
Quoted 4 lines
--- net/ceph/messenger.c | 6 ++++-- net/ceph/osd_client.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
Hi Deepa,
Although I applaud 64-bit timestamps,
the ktime_get_* api seems to be a Linux only API.
So IF ever things need to be the least bit portable, I suggest wrapping these routines into a class of itself. So that porting confines itself to only that class. (plus/minus hairy semantic details)
For what is now committed the change is not really that big.
On the other hand, I 'll have to start figuring out if FreeBSD really does do 64bit timestamps...
So I would welcome a more elaborate description of the problem (it seems that Linux is going 64bit in its inodes??) and what is being fixed and how. So that in the porting case not only the code will be the source to figure out what is going on.
Thanx,
--WjW
Re: [PATCH v2 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts
Adding Arnd, as he is the overall y2038 project lead.
Quoted 9 lines
Quoted 9 lines
CURRENT_TIMEis not y2038 safe.
The macro will be deleted and all the references to it will be replaced by ktime_get_* apis.struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph uses it internally everywhere.
These references will be changed to use struct timespec64 in a separate patch.
Quoted 7 lines
Hi Deepa,
Although I applaud 64-bit timestamps,
the ktime_get_* api seems to be a Linux only API.
So IF ever things need to be the least bit portable, I suggest wrapping these routines into a class of itself. So that porting confines itself to only that class. (plus/minus hairy semantic details)
ktime_get_* apis just return 64 bit timestamps.
They are the equivalent of CURRENT_TIME.
Did you have a wrapper for CURRENT_TIME?
Are these concerns about all of ceph kernel code or just that the libceph is expected to be portable?
Quoted 4 lines
For what is now committed the change is not really that big.
On the other hand, I 'll have to start figuring out if FreeBSD really does do 64bit timestamps...
From what I can see here:
http://fxr.watson.org/fxr/ident?im=10;i=__time_t,
FreeBSD time_t is already 64 bit long.
So it supports 64 bit timestamps already.
Quoted 4 lines
So I would welcome a more elaborate description of the problem (it seems that Linux is going 64bit in its inodes??) and what is being fixed and how. So that in the porting case not only the code will be the source to figure out what is going on.
Yes, all inode timestamps are going to be switched over to use timespec64 i.e., 64 bit timestamps.
We will switch over just the vfs layer: struct inode, struct attr and struct kstat.
End filesystems such as ceph will still use timespec at this time. So whenever they access vfs timestamps, they will go through conversion apis:timespec64_to_timespec() / timespec_to_timespec64().
My reference tree is https://github.com/deepa-hub/vfs/tree/y2038 .
This gives you an overall idea of the changes.
Only a few names have to be updated according to review discussions. But, you can see what the end filesystems will look like after the vfs switch-over.
The problem with ceph is really that the timestamps sent over wire use the same encode/ decode function calls whether the timestamp is related to files or not. I'm not sure what the plan for wire protocol is here. As Sage suggested on the thread:
http://www.spinics.net/lists/ceph-devel/msg28960.html , you could interpret time values as u32.
After this, porting to BSD should be straight forward. Then, you can substitute nanotime() for ktime_get_real_ts64()?:
http://fxr.watson.org/fxr/source/kern/kern_tc.c?im=3#L387,938
-Deepa
Re: [PATCH v2 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts
Quoted 28 lines · Deepa Dinamani
Adding Arnd, as he is the overall y2038 project lead.
Quoted 9 lines
Quoted 9 lines
CURRENT_TIMEis not y2038 safe.
The macro will be deleted and all the references to it will be replaced by ktime_get_* apis.struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph uses it internally everywhere.
These references will be changed to use struct timespec64 in a separate patch.Quoted 7 lines
Hi Deepa,
Although I applaud 64-bit timestamps,
the ktime_get_* api seems to be a Linux only API.
So IF ever things need to be the least bit portable, I suggest wrapping these routines into a class of itself. So that porting confines itself to only that class. (plus/minus hairy semantic details)ktime_get_* apis just return 64 bit timestamps.
They are the equivalent ofCURRENT_TIME.
Did you have a wrapper forCURRENT_TIME?Are these concerns about all of ceph kernel code or just that the libceph is expected to be portable?
Quoted 2 lines
For what is now committed the change is not really that big.
Quoted 8 lines
Quoted 2 lines
On the other hand, I 'll have to start figuring out if FreeBSD really does do 64bit timestamps...
From what I can see here:
http://fxr.watson.org/fxr/ident?im=10;i=__time_t,FreeBSD
time_tis already 64 bit long.
So it supports 64 bit timestamps already.
Yup, I look a bit further into it. After your mail I started diging into my memory and realised that 64bit times are quite some time on FreeBSD. And wrote even a small test to be sure...
#include <stdio.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/timespec.h>
struct stat s;
struct itimerspec t;
int main () {
printf( "Size of __time_t: %lu bytes\n", sizeof(__time_t));
printf( "Size of st_atim: %lu bytes\n", sizeof(s.st_atim));
printf( "Size of timespec: %lu bytes\n", sizeof(t.it_interval));}
[~/Src/c-code] wjw > print_time_t_size
Size of __time_t: 8 bytes
Size of st_atim: 16 bytes
Size of timespec: 16 bytes
So FreeBSD is good.
Quoted 21 lines
Quoted 5 lines
So I would welcome a more elaborate description of the problem (it seems that Linux is going 64bit in its inodes??) and what is being fixed and how. So that in the porting case not only the code will be the source to figure out what is going on.
Yes, all inode timestamps are going to be switched over to use timespec64 i.e., 64 bit timestamps.
We will switch over just the vfs layer: struct inode, struct attr and struct kstat.
End filesystems such as ceph will still use timespec at this time. So whenever they access vfs timestamps, they will go through conversion apis:timespec64_to_timespec()/timespec_to_timespec64().My reference tree is https://github.com/deepa-hub/vfs/tree/y2038 .
This gives you an overall idea of the changes.
Only a few names have to be updated according to review discussions. But, you can see what the end filesystems will look like after the vfs switch-over.
Quoted 6 lines
The problem with ceph is really that the timestamps sent over wire use the same encode/ decode function calls whether the timestamp is related to files or not. I'm not sure what the plan for wire protocol is here. As Sage suggested on the thread:
http://www.spinics.net/lists/ceph-devel/msg28960.html , you could interpret time values as u32.
I've seen the discussion here but for the time being chose to ignore that, since whatever would come from it
Quoted 4 lines
After this, porting to BSD should be straight forward. Then, you can substitute
nanotime()forktime_get_real_ts64()?:
http://fxr.watson.org/fxr/source/kern/kern_tc.c?im=3#L387,938
So that is more or less why I suggest to make into a (small) class. Otherwise there are going to be wraped into ifdef's.
You could even put it just in a *.h file, and than a good compiler would do the optimisation, and clean-out one call set, and inline.
--WjW
Re: [PATCH v2 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts
Quoted 93 lines
Quoted 28 lines
Adding Arnd, as he is the overall y2038 project lead.
Quoted 9 lines
Quoted 9 lines
CURRENT_TIMEis not y2038 safe.
The macro will be deleted and all the references to it will be replaced by ktime_get_* apis.struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph uses it internally everywhere.
These references will be changed to use struct timespec64 in a separate patch.Quoted 7 lines
Hi Deepa,
Although I applaud 64-bit timestamps,
the ktime_get_* api seems to be a Linux only API.
So IF ever things need to be the least bit portable, I suggest wrapping these routines into a class of itself. So that porting confines itself to only that class. (plus/minus hairy semantic details)ktime_get_* apis just return 64 bit timestamps.
They are the equivalent ofCURRENT_TIME.
Did you have a wrapper forCURRENT_TIME?Are these concerns about all of ceph kernel code or just that the libceph is expected to be portable?
Quoted 2 lines
For what is now committed the change is not really that big.
Quoted 8 lines
Quoted 2 lines
On the other hand, I 'll have to start figuring out if FreeBSD really does do 64bit timestamps...
From what I can see here:
http://fxr.watson.org/fxr/ident?im=10;i=__time_t,FreeBSD
time_tis already 64 bit long.
So it supports 64 bit timestamps already.Yup, I look a bit further into it. After your mail I started diging into my memory and realised that 64bit times are quite some time on FreeBSD. And wrote even a small test to be sure...
#include <
stdio.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/timespec.h>struct stat s;
struct itimerspec t;int main () { printf( "Size of __time_t: %lu bytes\n", sizeof(__time_t)); printf( "Size of st_atim: %lu bytes\n", sizeof(s.st_atim)); printf( "Size of timespec: %lu bytes\n", sizeof(t.it_interval));}
[~/Src/c-code] wjw >print_time_t_size
Size of__time_t: 8 bytes
Size ofst_atim: 16 bytes
Size of timespec: 16 bytesSo FreeBSD is good.
Quoted 21 lines
Quoted 5 lines
So I would welcome a more elaborate description of the problem (it seems that Linux is going 64bit in its inodes??) and what is being fixed and how. So that in the porting case not only the code will be the source to figure out what is going on.
Yes, all inode timestamps are going to be switched over to use timespec64 i.e., 64 bit timestamps.
We will switch over just the vfs layer: struct inode, struct attr and struct kstat.
End filesystems such as ceph will still use timespec at this time. So whenever they access vfs timestamps, they will go through conversion apis:timespec64_to_timespec()/timespec_to_timespec64().My reference tree is https://github.com/deepa-hub/vfs/tree/y2038 .
This gives you an overall idea of the changes.
Only a few names have to be updated according to review discussions. But, you can see what the end filesystems will look like after the vfs switch-over.Quoted 6 lines
The problem with ceph is really that the timestamps sent over wire use the same encode/ decode function calls whether the timestamp is related to files or not. I'm not sure what the plan for wire protocol is here. As Sage suggested on the thread:
http://www.spinics.net/lists/ceph-devel/msg28960.html , you could interpret time values as u32.I've seen the discussion here but for the time being chose to ignore that, since whatever would come from it
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
After this, porting to BSD should be straight forward. Then, you can substitute
nanotime()forktime_get_real_ts64()?:
http://fxr.watson.org/fxr/source/kern/kern_tc.c?im=3#L387,938So that is more or less why I suggest to make into a (small) class. Otherwise there are going to be wraped into ifdef's.
You could even put it just in a *.h file, and than a good compiler would do the optimisation, and clean-out one call set, and inline.
I'm not sure what you mean by class here.
Could you elaborate?
ktime apis are not available in the userspace and the changes here are only relevant to linux kernel.
-Deepa
Re: [PATCH v2 21/24] libceph: Replace CURRENT_TIME with ktime_get_real_ts
Quoted 102 lines · Deepa Dinamani
Quoted 93 lines
Quoted 28 lines
Adding Arnd, as he is the overall y2038 project lead.
Quoted 9 lines
Quoted 9 lines
CURRENT_TIMEis not y2038 safe.
The macro will be deleted and all the references to it will be replaced by ktime_get_* apis.struct timespec is also not y2038 safe.
Retain timespec for timestamp representation here as ceph uses it internally everywhere.
These references will be changed to use struct timespec64 in a separate patch.Quoted 7 lines
Hi Deepa,
Although I applaud 64-bit timestamps,
the ktime_get_* api seems to be a Linux only API.
So IF ever things need to be the least bit portable, I suggest wrapping these routines into a class of itself. So that porting confines itself to only that class. (plus/minus hairy semantic details)ktime_get_* apis just return 64 bit timestamps.
They are the equivalent ofCURRENT_TIME.
Did you have a wrapper forCURRENT_TIME?Are these concerns about all of ceph kernel code or just that the libceph is expected to be portable?
Quoted 2 lines
For what is now committed the change is not really that big.
Quoted 8 lines
Quoted 2 lines
On the other hand, I 'll have to start figuring out if FreeBSD really does do 64bit timestamps...
From what I can see here:
http://fxr.watson.org/fxr/ident?im=10;i=__time_t,FreeBSD
time_tis already 64 bit long.
So it supports 64 bit timestamps already.Yup, I look a bit further into it. After your mail I started diging into my memory and realised that 64bit times are quite some time on FreeBSD. And wrote even a small test to be sure...
#include <
stdio.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/timespec.h>struct stat s;
struct itimerspec t;int main () { printf( "Size of __time_t: %lu bytes\n", sizeof(__time_t)); printf( "Size of st_atim: %lu bytes\n", sizeof(s.st_atim)); printf( "Size of timespec: %lu bytes\n", sizeof(t.it_interval));}
[~/Src/c-code] wjw >print_time_t_size
Size of__time_t: 8 bytes
Size ofst_atim: 16 bytes
Size of timespec: 16 bytesSo FreeBSD is good.
Quoted 21 lines
Quoted 5 lines
So I would welcome a more elaborate description of the problem (it seems that Linux is going 64bit in its inodes??) and what is being fixed and how. So that in the porting case not only the code will be the source to figure out what is going on.
Yes, all inode timestamps are going to be switched over to use timespec64 i.e., 64 bit timestamps.
We will switch over just the vfs layer: struct inode, struct attr and struct kstat.
End filesystems such as ceph will still use timespec at this time. So whenever they access vfs timestamps, they will go through conversion apis:timespec64_to_timespec()/timespec_to_timespec64().My reference tree is https://github.com/deepa-hub/vfs/tree/y2038 .
This gives you an overall idea of the changes.
Only a few names have to be updated according to review discussions. But, you can see what the end filesystems will look like after the vfs switch-over.Quoted 6 lines
The problem with ceph is really that the timestamps sent over wire use the same encode/ decode function calls whether the timestamp is related to files or not. I'm not sure what the plan for wire protocol is here. As Sage suggested on the thread:
http://www.spinics.net/lists/ceph-devel/msg28960.html , you could interpret time values as u32.I've seen the discussion here but for the time being chose to ignore that, since whatever would come from it
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
After this, porting to BSD should be straight forward. Then, you can substitute
nanotime()forktime_get_real_ts64()?:
http://fxr.watson.org/fxr/source/kern/kern_tc.c?im=3#L387,938So that is more or less why I suggest to make into a (small) class. Otherwise there are going to be wraped into ifdef's.
You could even put it just in a *.h file, and than a good compiler would do the optimisation, and clean-out one call set, and inline.
Quoted 5 lines
I'm not sure what you mean by class here.
Could you elaborate?ktime apis are not available in the userspace and the changes here are only relevant to linux kernel.
'mmm,
I was certain that I saw the ktime api calls in Ceph code. ktime_get_real_ts() is used in a few of the Ceph-modules to replace CURRENT_TIME. Perhaps that is not really part of the ktime API??
eg.:
- osd_req->r_mtime = CURRENT_TIME;
+ ktime_get_real_ts(&osd_req->r_mtime);
Having this wrapped in a separate class or routine would make porting a nobrainer. Other OSes just need to augment this one routine.
--WjW
PATCH v2 22/24 fs: ceph: Replace current_fs_time for request stamp
In reply to Deepa DinamaniThe current_fs_time() api is being changed to use vfs struct inode* as an argument instead of struct super_block*.
Set the new mds client request r_stamp field using ktime_get_real_ts() instead of using current_fs_time().
Also, since r_stamp is used as mtime on the server, use timespec_trunc() to truncate the timestamp, using the right granularity from the superblock.
This api will be transitioned to be y2038 safe along with vfs.
--- fs/ceph/mds_client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +3 -1
@@ -1697,6 +1697,7 @@ struct ceph_mds_request * ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) { struct ceph_mds_request *req = kzalloc(sizeof(*req), GFP_NOFS); +struct timespec ts;if (!req)return ERR_PTR (-ENOMEM );
@@ -1715,7 +1716,8 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode)init_completion (&req->r_safe_completion);INIT_LIST_HEAD (&req->r_unsafe_item); - req->r_stamp =current_fs_time (mdsc->fsc->sb); +ktime_get_real_ts (&ts); + req->r_stamp =timespec_trunc (ts, mdsc->fsc->sb->s_time_gran); req->r_op = op; req->r_direct_mode = mode;
Signature · 6 lines
1.9.1 _______________________________________________ Y2038 mailing list [email protected] https://lists.linaro.org/mailman/listinfo/y2038
PATCH v2 23/24 time: Delete CURRENT_TIME_SEC and CURRENT_TIME macro
In reply to Deepa DinamaniAll uses of these macros have been replaced by other time functions.
These macros are also not y2038 safe.
And, all its use cases can be fulfilled by y2038 safe ktime_get_* variants.
--- include/linux/time.h | 3 --- 1 file changed, 3 deletions(-)
include/linux/time.h +0 -3
@@ -151,9 +151,6 @@ static inline bool timespec_inject_offset_valid(const struct timespec *ts)return true; } -#define CURRENT_TIME (current_kernel_time()) -#define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) -/* Some architectures do not supply their own clocksource. * This is mainly the case in architectures that get their * inter-tick times by reading the counter on their interval
Signature · 1 line
1.9.1
Arnd Bergmann
maintainerRe: [PATCH v2 23/24] time: Delete CURRENT_TIME_SEC and CURRENT_TIME macro
Quoted 11 lines · CEST Deepa Dinamani
All uses of these macros have been replaced by other time functions.
These macros are also not y2038 safe.
And, all its use cases can be fulfilled by y2038 safe ktime_get_* variants.Signed-off-by Deepa Dinamani <[email protected]>Cc John Stultz <[email protected]>Cc Thomas Gleixner <[email protected]>Acked-by John Stultz <[email protected]>
Since we can't merge patch 19 yet due to the dependency on John's tree, this will have to wait as well.
Arnd
PATCH v2 24/24 time: Delete current_fs_time() function
In reply to Deepa DinamaniAll uses of the current_fs_time() function have been replaced by other time interfaces.
And, its use cases can be fulfilled by current_time() or ktime_get_* variants.
--- include/linux/fs.h | 1 - kernel/time/time.c | 14 -------------- 2 files changed, 15 deletions(-)
include/linux/fs.h +0 -1
@@ -1460,7 +1460,6 @@ struct super_block {struct list_head s_inodes;/* all inodes */ }; -extern struct timespec current_fs_time (struct super_block *sb);extern struct timespec current_time (struct inode *inode);static inline struct timespec current_fs_time_sec (struct super_block *sb)
kernel/time/time.c +0 -14
@@ -230,20 +230,6 @@ SYSCALL_DEFINE1(adjtimex, struct timex __user *, txc_p)return copy_to_user (txc_p, &txc,sizeof (struct timex )) ? -EFAULT : ret; } -/** -* current_fs_time - Return FS time -* @sb: Superblock. -* -* Return the current time truncated to the time granularity supported by -* the fs. -*/ -struct timespec current_fs_time (struct super_block *sb) -{ -struct timespec now =current_kernel_time (); -return timespec_trunc (now, sb->s_time_gran); -} -EXPORT_SYMBOL (current_fs_time); -/* * Convert jiffies to milliseconds and back. *
Signature · 1 line
1.9.1
Quoted 1 line · Deepa Dinamani
The series is aimed at getting rid of
CURRENT_TIMEandCURRENT_TIME_SECmacros.
This version now looks ok to me.
I do have a comment (or maybe just a RFD) for future work.
It does strike me that once we actually change over the inode times to use timespec64, the calling conventions are going to be fairly horrendous on most 32-bit architectures.
Gcc handles 8-byte structure returns (on most architectures) by returning them as two 32-bit registers (%edx:%eax on x86). But once it is timespec64, that will no longer be the case, and the calling convention will end up using a pointer to the local stack instead.
So for 32-bit code generation, we *may* want to introduce a new model of doing
set_inode_time(inode, ATTR_ATIME | ATTR_MTIME);
which basically just does
inode->i_atime = inode->i_mtime = current_time(inode);
but with a much easier calling convention on 32-bit architectures.
But that is entirely orthogonal to this patch-set, and should be seen as a separate issue.
And maybe it doesn't end up helping anyway, but I do think those "simple" direct assignments will really generate pretty disgusting code on 32-bit architectures.
That whole
inode->i_atime = inode->i_mtime = CURRENT_TIME;
model really made a lot more sense back in the ancient days when inode times were just simply 32-bit seconds (not even timeval structures).
Linus
Quoted 15 lines
This version now looks ok to me.
I do have a comment (or maybe just a RFD) for future work.
It does strike me that once we actually change over the inode times to use timespec64, the calling conventions are going to be fairly horrendous on most 32-bit architectures.
Gcc handles 8-byte structure returns (on most architectures) by returning them as two 32-bit registers (%edx:%eax on x86). But once it is timespec64, that will no longer be the case, and the calling convention will end up using a pointer to the local stack instead.
So for 32-bit code generation, we *may* want to introduce a new model of doing
Quoted 7 lines
set_inode_time(inode, ATTR_ATIME | ATTR_MTIME);which basically just does
inode->i_atime = inode->i_mtime = current_time(inode);but with a much easier calling convention on 32-bit architectures.
Arnd and I had discussed something like this before. But, for entirely different reasons:
Having the set_inode_time() like you suggest will also help switching of vfs inode times to timespec64.
We were suggesting all the accesses to inode time be abstracted through something like inode_set_time().
Arnd also had suggested a split representation of fields in the struct inode as well which led to space savings
as well. And, having the split representation also meant no more direct assignments:
https://lkml.org/lkml/2016/1/7/20
This in general will be similar to setattr_copy(), but only sets times rather than other attributes as well.
If this is what is preferred, then the patches to change vfs to use timespec64 could make use of this and will
need to be refactored. So maybe it would be good to discuss before I post those patches.
-Deepa
Arnd Bergmann
maintainerQuoted 7 lines · CEST you
Quoted 1 line · Deepa Dinamani
The series is aimed at getting rid of
CURRENT_TIMEandCURRENT_TIME_SECmacros.Gcc handles 8-byte structure returns (on most architectures) by returning them as two 32-bit registers (%edx:%eax on x86). But once it is timespec64, that will no longer be the case, and the calling convention will end up using a pointer to the local stack instead.
I guess we already have that today, as the implementation of current_fs_time() is
static inline struct timespec64 tk_xtime(struct timekeeper *tk)
{
struct timespec64 ts;
ts.tv_sec = tk->xtime_sec;
ts.tv_nsec = (long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift);
return ts;
}
extern struct timespec64 current_kernel_time64(void);
struct timespec64 current_kernel_time64(void)
{
struct timekeeper *tk = &tk_core.timekeeper;
struct timespec64 now;
unsigned long seq;
do {
seq = read_seqcount_begin(&tk_core.seq);
now = tk_xtime(tk);
} while (read_seqcount_retry(&tk_core.seq, seq));
return now;
}
static inline struct timespec current_kernel_time(void)
{
struct timespec64 now = current_kernel_time64();
return timespec64_to_timespec(now);
}
extern struct timespec current_fs_time(struct super_block *sb);
struct timespec current_fs_time(struct super_block *sb)
{
struct timespec now = current_kernel_time();
return timespec_trunc(now, sb->s_time_gran);
} We can surely do a little better than this, independent of the conversion in Deepa's patch set.
Quoted 4 lines
So for 32-bit code generation, we *may* want to introduce a new model of doing
set_inode_time(inode, ATTR_ATIME | ATTR_MTIME);
Quoted 8 lines
which basically just does
inode->i_atime = inode->i_mtime = current_time(inode);but with a much easier calling convention on 32-bit architectures.
But that is entirely orthogonal to this patch-set, and should be seen as a separate issue.
I've played around with that, but found it hard to avoid going through memory other than going all the way to the tk_xtime() access to copy both tk->xtime_sec and the nanoseconds into the inode fields.
Without that, the set_inode_time() implementation ends up being more expensive thaninode->i_atime = inode->i_ctime = inode->i_mtime = current_time(inode); because we still copy through the stack but also have
a couple of conditional branches that we don't have at the moment.
At the moment, the triple assignment becomes (here on ARM)
c: 4668 mov r0, sp
12: f7ff fffe bl 0 <current_kernel_time64>
3e: f107 0520 add.w r5, r7, #32
12: R_ARM_THM_CALL current_kernel_time64
16: f106 0410 add.w r4, r6, #16
1a: e89d 000f ldmia.w sp, {r0, r1, r2, r3} # load from stack
1e: e885 000f stmia.w r5, {r0, r1, r2, r3} # store into i_atime
22: e884 000f stmia.w r4, {r0, r1, r2, r3} # i_ctime
26: e886 000f stmia.w r6, {r0, r1, r2, r3} # i_mtimeand a slightly more verbose version of the same thing on x86 (storing only 12 bytes instead of 16 is cheaper there, while ARM does a store-multiple to copy the entire structure).
Arnd
Arnd Bergmann
maintainerQuoted 23 lines · CEST Deepa Dinamani
The series is aimed at getting rid of
CURRENT_TIMEandCURRENT_TIME_SECmacros. The macros are not y2038 safe. There is no plan to transition them into being y2038 safe.
ktime_get_* api's can be used in their place. And, these are y2038 safe.Thanks to Arnd Bergmann for all the guidance and discussions.
Patches 2-4 were mostly generated using coccinelle scripts.
All filesystem timestamps use
current_fs_time()for right granularity as mentioned in the respective commit texts of patches. This has a changed signature, renamed tocurrent_time()and moved to thefs/inode.c.This series also serves as a preparatory series to transition vfs to 64 bit timestamps as outlined here: https://lkml.org/lkml/2016/2/12/104 .
As per Linus's suggestion in https://lkml.org/lkml/2016/5/24/663 , all the inode timestamp changes have been squashed into a single patch. Also,
current_time()now is used as a single generic vfs filesystem timestamp api. It also takes struct inode* as argument instead of struct super_block*. Posting all patches together in a bigger series so that the big picture is clear.
Quoted 2 lines
As per the suggestion in https://lwn.net/Articles/672598/,
CURRENT_TIMEmacro bug fixes are being handled in a series separate from transitioning vfs to use.
I've looked in detail at all the patches in this version now, and while overall everything is fine, I found that two patches cannot be part of the series because of the dependency on the patch that John already took (adding time64_to_tm), but I think that's ok because we just need to change over all the users of CURRENT_TIME and CURRENT_TIME_SEC that assign to inode timestamps in order to prepare for the type change, the other ones can be changed later.
I also found a few things that could be done differently to make the later conversion slightly easier, but it's also possible that I missed part of your bigger plan for those files, and none of them seem important.
Arnd
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/