* [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros @ 2016-08-13 22:48 Deepa Dinamani 2016-08-13 22:48 ` [PATCH v4 09/26] fs: ubifs: Replace CURRENT_TIME_SEC with current_time Deepa Dinamani 2016-08-15 16:23 ` [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Greg KH 0 siblings, 2 replies; 6+ messages in thread From: Deepa Dinamani @ 2016-08-13 22:48 UTC (permalink / raw) To: linux-fsdevel, linux-kernel Cc: arnd, tglx, torvalds, tytso, viro, y2038, adilger.kernel, adrian.hunter, anna.schumaker, buchino, ceph-devel, clm, cm224.lee, dedekind1, dsterba, dushistov, elder, eparis, gregkh, hiralpat, idryomov, jack, jaegeuk, jbacik, jejb, jfs-discussion, jlbec, john.stultz, linux-audit, linux-btrfs, linux-ext4, linux-f2fs-devel, linux-mtd, linux-nfs, linux-scsi, lustre-devel, martin.petersen, mfasheh, ocfs2-devel, paul, sage, sfrench, shaggy, sramars, trond.myklebust, zyan 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 64 bit timestamps. Changes from v3: * Rebased to 4.8-rc1 to avoid merge conflicts. * Added CURRENT_TIME deletion and fnic patches back as time64_to_tm() is merged. * Rearranged a couple of instances of CURRENT_TIME. Changes from v2: * Fix buildbot error for uninitialized sb in inode. * Minor fixes according to Arnd's comments. * Leave out the fnic and deletion of CURRENT_TIME to be submitted after 4.8 rc1. 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 . --------------------------------------------------------------- The following changes since commit 09f0834105f7fe315ddaeb77fad15f00565c167e: Add linux-next specific files for 20160809 (2016-08-09 13:48:00 +1000) are available in the git repository at: https://github.com/deepa-hub/vfs current_time-v4.8-rc1 for you to fetch changes up to 050e25f5112626e228b742ed219314abc409a70f: time: Delete CURRENT_TIME_SEC and CURRENT_TIME (2016-08-13 13:44:41 -0700) ---------------------------------------------------------------- Deepa Dinamani (26): vfs: Add current_time() api fs: proc: Delete inode time initializations in proc_alloc_inode() 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: ufs: Use ktime_get_real_ts64() for birthtime 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 macro audit: Use timespec64 to represent audit timestamps fs: nfs: Make nfs boot time y2038 safe 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 fnic: Use time64_t to represent trace timestamps time: Delete current_fs_time() function time: Delete CURRENT_TIME_SEC and CURRENT_TIME 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 | 29 +++++++++++++++++++--- 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 | 3 +-- 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/apparmor/apparmorfs.c | 2 +- security/inode.c | 2 +- security/selinux/selinuxfs.c | 2 +- 207 files changed, 540 insertions(+), 524 deletions(-) -- 1.9.1 Cc: adilger.kernel@dilger.ca Cc: adrian.hunter@intel.com Cc: anna.schumaker@netapp.com Cc: buchino@cisco.com Cc: ceph-devel@vger.kernel.org Cc: clm@fb.com Cc: cm224.lee@samsung.com Cc: dedekind1@gmail.com Cc: dsterba@suse.com Cc: dushistov@mail.ru Cc: elder@kernel.org Cc: eparis@redhat.com Cc: gregkh@linuxfoundation.org Cc: hiralpat@cisco.com Cc: idryomov@gmail.com Cc: jack@suse.com Cc: jaegeuk@kernel.org Cc: jbacik@fb.com Cc: jejb@linux.vnet.ibm.com Cc: jfs-discussion@lists.sourceforge.net Cc: jlbec@evilplan.org Cc: john.stultz@linaro.org Cc: linux-audit@redhat.com Cc: linux-btrfs@vger.kernel.org Cc: linux-ext4@vger.kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net Cc: linux-mtd@lists.infradead.org Cc: linux-nfs@vger.kernel.org Cc: linux-scsi@vger.kernel.org Cc: lustre-devel@lists.lustre.org Cc: martin.petersen@oracle.com Cc: mfasheh@suse.com Cc: ocfs2-devel@oss.oracle.com Cc: paul@paul-moore.com Cc: sage@redhat.com Cc: sfrench@samba.org Cc: shaggy@kernel.org Cc: sramars@cisco.com Cc: trond.myklebust@primarydata.com Cc: zyan@redhat.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v4 09/26] fs: ubifs: Replace CURRENT_TIME_SEC with current_time 2016-08-13 22:48 [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani @ 2016-08-13 22:48 ` Deepa Dinamani 2016-08-15 16:23 ` [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Greg KH 1 sibling, 0 replies; 6+ messages in thread From: Deepa Dinamani @ 2016-08-13 22:48 UTC (permalink / raw) To: linux-fsdevel, linux-kernel Cc: arnd, tglx, torvalds, tytso, viro, y2038, Artem Bityutskiy, Adrian Hunter, linux-mtd CURRENT_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. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Cc: Artem Bityutskiy <dedekind1@gmail.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: linux-mtd@lists.infradead.org --- 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(-) diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 4b86d3a..6e2dff9 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -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 */ diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 7bbf420..45e3d71 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1182,7 +1182,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); @@ -1229,7 +1229,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; } @@ -1406,7 +1406,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; @@ -1420,7 +1420,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); @@ -1498,7 +1498,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; @@ -1566,7 +1566,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); diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 3c7b29d..a81603d 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c @@ -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); diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index 8ece6ca..caf83d6 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h @@ -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 diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 3cbb904..907bfff 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c @@ -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); diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index e237811..60b407b 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -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); -- 1.9.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros 2016-08-13 22:48 [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani 2016-08-13 22:48 ` [PATCH v4 09/26] fs: ubifs: Replace CURRENT_TIME_SEC with current_time Deepa Dinamani @ 2016-08-15 16:23 ` Greg KH 2016-08-16 18:18 ` Deepa Dinamani 2016-08-23 14:51 ` Arnd Bergmann 1 sibling, 2 replies; 6+ messages in thread From: Greg KH @ 2016-08-15 16:23 UTC (permalink / raw) To: Deepa Dinamani Cc: linux-fsdevel, linux-kernel, arnd, tglx, torvalds, tytso, viro, y2038, adilger.kernel, adrian.hunter, anna.schumaker, buchino, ceph-devel, clm, cm224.lee, dedekind1, dsterba, dushistov, elder, eparis, hiralpat, idryomov, jack, jaegeuk, jbacik, jejb, jfs-discussion, jlbec, john.stultz, linux-audit, linux-btrfs, linux-ext4, linux-f2fs-devel, linux-mtd, linux-nfs, linux-scsi, lustre-devel, martin.petersen, mfasheh, ocfs2-devel, paul, sage, sfrench, shaggy, sramars, trond.myklebust, zyan On Sat, Aug 13, 2016 at 03:48:12PM -0700, Deepa Dinamani wrote: > 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. Who are you execting to pull this huge patch series? Why not just introduce the new api call, wait for that to be merged, and then push the individual patches through the different subsystems? After half of those get ignored, then provide a single set of patches that can go through Andrew or my trees. thanks, greg k-h ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros 2016-08-15 16:23 ` [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Greg KH @ 2016-08-16 18:18 ` Deepa Dinamani 2016-08-16 18:53 ` Greg KH 2016-08-23 14:51 ` Arnd Bergmann 1 sibling, 1 reply; 6+ messages in thread From: Deepa Dinamani @ 2016-08-16 18:18 UTC (permalink / raw) To: Greg KH Cc: Linux FS-devel Mailing List, Linux Kernel Mailing List, Arnd Bergmann, Thomas Gleixner, Linus Torvalds, Theodore Ts'o, Alexander Viro, y2038 Mailman List, Andreas Dilger, Adrian Hunter, Anna Schumaker, Brian Uchino, ceph-devel, Chris Mason, Changman Lee, Artem Bityutskiy, David Sterba, Evgeniy Dushistov, Alex Elder, Eric Paris, Hiral Patel, Ilya Dryomov, Jan Kara, Jaegeuk Kim, Josef Bacik, James E.J. Bottomley, jfs-discussion, Joel Becker, John Stultz, linux-audit, linux-btrfs, linux-ext4, Linux F2FS DEV, Mailing List, linux-mtd, Linux NFS Mailing List, Linux SCSI List, lustre-devel, Martin K. Petersen, Mark Fasheh, ocfs2-devel, Paul Moore, Sage Weil, Steve French, Dave Kleikamp, Suma Ramars, Trond Myklebust, Yan, Zheng Thank you for the suggestion. > Who are you execting to pull this huge patch series? The last pull request was addressed to Al as per Arnd's suggestion. I'm not completely sure who should it be addressed to. > Why not just introduce the new api call, wait for that to be merged, and > then push the individual patches through the different subsystems? > After half of those get ignored, then provide a single set of patches > that can go through Andrew or my trees. Arnd and I tried to do this a few ways. We can try to introduce the api first like you suggest. There are a few Acks already on the patches. And, patches 2-5 also need to be merged through some common tree like yours or Andrew's as you suggest. So, if everyone is ok, I could do the following: 1. Post patches 1-5 for rc-2. 2. Post all other patches to respective maintainers after rc-2 3. Then after patches get ignored or merged, post remaining as a series for you or Andrew to pick up. -Deepa ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros 2016-08-16 18:18 ` Deepa Dinamani @ 2016-08-16 18:53 ` Greg KH 0 siblings, 0 replies; 6+ messages in thread From: Greg KH @ 2016-08-16 18:53 UTC (permalink / raw) To: Deepa Dinamani Cc: Linux FS-devel Mailing List, Linux Kernel Mailing List, Arnd Bergmann, Thomas Gleixner, Linus Torvalds, Theodore Ts'o, Alexander Viro, y2038 Mailman List, Andreas Dilger, Adrian Hunter, Anna Schumaker, Brian Uchino, ceph-devel, Chris Mason, Changman Lee, Artem Bityutskiy, David Sterba, Evgeniy Dushistov, Alex Elder, Eric Paris, Hiral Patel, Ilya Dryomov, Jan Kara, Jaegeuk Kim, Josef Bacik, James E.J. Bottomley, jfs-discussion, Joel Becker, John Stultz, linux-audit, linux-btrfs, linux-ext4, Linux F2FS DEV, Mailing List, linux-mtd, Linux NFS Mailing List, Linux SCSI List, lustre-devel, Martin K. Petersen, Mark Fasheh, ocfs2-devel, Paul Moore, Sage Weil, Steve French, Dave Kleikamp, Suma Ramars, Trond Myklebust, Yan, Zheng On Tue, Aug 16, 2016 at 11:18:52AM -0700, Deepa Dinamani wrote: > Thank you for the suggestion. > > > Who are you execting to pull this huge patch series? > > The last pull request was addressed to Al as per Arnd's suggestion. > I'm not completely sure who should it be addressed to. > > > Why not just introduce the new api call, wait for that to be merged, and > > then push the individual patches through the different subsystems? > > After half of those get ignored, then provide a single set of patches > > that can go through Andrew or my trees. > > Arnd and I tried to do this a few ways. > > We can try to introduce the api first like you suggest. > > There are a few Acks already on the patches. > And, patches 2-5 also need to be merged through some common tree like > yours or Andrew's as you suggest. > > So, if everyone is ok, I could do the following: > > 1. Post patches 1-5 for rc-2. -rc2 is already released, and we aren't adding new apis this late in the release cycle, sorry. > 2. Post all other patches to respective maintainers after rc-2 > 3. Then after patches get ignored or merged, post remaining as a > series for you or Andrew to pick up. The apis need to be aimed for 4.9-rc1, it's too late for 4.8, sorry. greg k-h ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros 2016-08-15 16:23 ` [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Greg KH 2016-08-16 18:18 ` Deepa Dinamani @ 2016-08-23 14:51 ` Arnd Bergmann 1 sibling, 0 replies; 6+ messages in thread From: Arnd Bergmann @ 2016-08-23 14:51 UTC (permalink / raw) To: Greg KH Cc: Deepa Dinamani, linux-fsdevel, linux-kernel, tglx, torvalds, tytso, viro, y2038, adilger.kernel, adrian.hunter, anna.schumaker, buchino, ceph-devel, clm, cm224.lee, dedekind1, dsterba, dushistov, elder, eparis, hiralpat, idryomov, jack, jaegeuk, jbacik, jejb, jfs-discussion, jlbec, john.stultz, linux-audit, linux-btrfs, linux-ext4, linux-f2fs-devel, linux-mtd, linux-nfs, linux-scsi, lustre-devel, martin.petersen, mfasheh, ocfs2-devel, paul, sage, sfrench, shaggy, sramars, trond.myklebust, zyan On Monday, August 15, 2016 6:23:12 PM CEST Greg KH wrote: > On Sat, Aug 13, 2016 at 03:48:12PM -0700, Deepa Dinamani wrote: > > 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. > > Who are you execting to pull this huge patch series? Dave Chinner suggested to have Al Viro pick up the whole series. > Why not just introduce the new api call, wait for that to be merged, and > then push the individual patches through the different subsystems? > After half of those get ignored, then provide a single set of patches > that can go through Andrew or my trees. That was the original approach for v4.7, but (along with requesting a number of reworks that Deepa incorporated), Linus preferred doing the API change done in one chunk, see https://patchwork.kernel.org/patch/9134249/ Arnd ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-08-23 14:53 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-08-13 22:48 [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Deepa Dinamani 2016-08-13 22:48 ` [PATCH v4 09/26] fs: ubifs: Replace CURRENT_TIME_SEC with current_time Deepa Dinamani 2016-08-15 16:23 ` [GIT PULL] [PATCH v4 00/26] Delete CURRENT_TIME and CURRENT_TIME_SEC macros Greg KH 2016-08-16 18:18 ` Deepa Dinamani 2016-08-16 18:53 ` Greg KH 2016-08-23 14:51 ` Arnd Bergmann
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).