Merge tag 'vfs-timespec64' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 14 Jun 2018 22:31:07 +0000 (07:31 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 14 Jun 2018 22:31:07 +0000 (07:31 +0900)
Pull inode timestamps conversion to timespec64 from Arnd Bergmann:
 "This is a late set of changes from Deepa Dinamani doing an automated
  treewide conversion of the inode and iattr structures from 'timespec'
  to 'timespec64', to push the conversion from the VFS layer into the
  individual file systems.

  As Deepa writes:

   'The series aims to switch vfs timestamps to use struct timespec64.
    Currently vfs uses struct timespec, which is not y2038 safe.

    The series involves the following:
    1. Add vfs helper functions for supporting struct timepec64
       timestamps.
    2. Cast prints of vfs timestamps to avoid warnings after the switch.
    3. Simplify code using vfs timestamps so that the actual replacement
       becomes easy.
    4. Convert vfs timestamps to use struct timespec64 using a script.
       This is a flag day patch.

    Next steps:
    1. Convert APIs that can handle timespec64, instead of converting
       timestamps at the boundaries.
    2. Update internal data structures to avoid timestamp conversions'

  Thomas Gleixner adds:

   'I think there is no point to drag that out for the next merge
    window. The whole thing needs to be done in one go for the core
    changes which means that you're going to play that catchup game
    forever. Let's get over with it towards the end of the merge window'"

* tag 'vfs-timespec64' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground:
  pstore: Remove bogus format string definition
  vfs: change inode times to use struct timespec64
  pstore: Convert internal records to timespec64
  udf: Simplify calls to udf_disk_stamp_to_time
  fs: nfs: get rid of memcpys for inode times
  ceph: make inode time prints to be long long
  lustre: Use long long type to print inode time
  fs: add timespec64_truncate()

43 files changed:
1  2 
drivers/usb/gadget/function/f_fs.c
fs/attr.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/transaction.c
fs/ceph/addr.c
fs/ceph/caps.c
fs/ceph/file.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/cifs/inode.c
fs/cramfs/inode.c
fs/ext4/ext4.h
fs/ext4/ialloc.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/inode.c
fs/f2fs/namei.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/fuse/inode.c
fs/gfs2/dir.c
fs/hfs/inode.c
fs/inode.c
fs/locks.c
fs/nfsd/blocklayout.c
fs/nfsd/nfs4xdr.c
fs/ocfs2/dlmglue.c
fs/ocfs2/file.c
fs/orangefs/inode.c
fs/orangefs/orangefs-kernel.h
fs/overlayfs/inode.c
fs/overlayfs/overlayfs.h
fs/proc/uptime.c
fs/ubifs/dir.c
fs/ubifs/file.c
fs/ubifs/ubifs.h
fs/udf/super.c
fs/udf/udfdecl.h
fs/xfs/xfs_inode.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_trans_inode.c
include/linux/fs.h

Simple merge
diff --cc fs/attr.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/ceph/addr.c
@@@ -1935,7 -1936,8 +1937,7 @@@ static int __ceph_pool_perm_get(struct 
                                     0, false, true);
        err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false);
  
-       wr_req->r_mtime = ci->vfs_inode.i_mtime;
+       wr_req->r_mtime = timespec64_to_timespec(ci->vfs_inode.i_mtime);
 -      wr_req->r_abort_on_full = true;
        err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false);
  
        if (!err)
diff --cc fs/ceph/caps.c
Simple merge
diff --cc fs/ceph/file.c
Simple merge
diff --cc fs/ceph/inode.c
Simple merge
Simple merge
diff --cc fs/cifs/inode.c
Simple merge
Simple merge
diff --cc fs/ext4/ext4.h
Simple merge
Simple merge
diff --cc fs/f2fs/f2fs.h
Simple merge
diff --cc fs/f2fs/file.c
Simple merge
diff --cc fs/f2fs/inode.c
Simple merge
diff --cc fs/f2fs/namei.c
@@@ -50,13 -50,10 +50,13 @@@ static struct inode *f2fs_new_inode(str
  
        inode->i_ino = ino;
        inode->i_blocks = 0;
-       inode->i_mtime = inode->i_atime = inode->i_ctime =
-                       F2FS_I(inode)->i_crtime = current_time(inode);
+       inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+       F2FS_I(inode)->i_crtime = timespec64_to_timespec(inode->i_mtime);
        inode->i_generation = sbi->s_next_generation++;
  
 +      if (S_ISDIR(inode->i_mode))
 +              F2FS_I(inode)->i_current_depth = 1;
 +
        err = insert_inode_locked(inode);
        if (err) {
                err = -EINVAL;
Simple merge
Simple merge
diff --cc fs/fuse/inode.c
Simple merge
diff --cc fs/gfs2/dir.c
Simple merge
diff --cc fs/hfs/inode.c
Simple merge
diff --cc fs/inode.c
Simple merge
diff --cc fs/locks.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/ocfs2/file.c
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -325,16 -331,9 +325,16 @@@ int ovl_xattr_get(struct dentry *dentry
  ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size);
  struct posix_acl *ovl_get_acl(struct inode *inode, int type);
  int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags);
- int ovl_update_time(struct inode *inode, struct timespec *ts, int flags);
+ int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags);
  bool ovl_is_private_xattr(const char *name);
  
 +struct ovl_inode_params {
 +      struct inode *newinode;
 +      struct dentry *upperdentry;
 +      struct ovl_path *lowerpath;
 +      struct dentry *index;
 +      unsigned int numlower;
 +};
  struct inode *ovl_new_inode(struct super_block *sb, umode_t mode, dev_t rdev);
  struct inode *ovl_lookup_inode(struct super_block *sb, struct dentry *real,
                               bool is_upper);
Simple merge
diff --cc fs/ubifs/dir.c
Simple merge
diff --cc fs/ubifs/file.c
Simple merge
Simple merge
diff --cc fs/udf/super.c
@@@ -880,17 -885,17 +883,17 @@@ static int udf_load_pvoldesc(struct sup
  
        pvoldesc = (struct primaryVolDesc *)bh->b_data;
  
-       if (udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time,
-                             pvoldesc->recordingDateAndTime)) {
+       udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time,
+                             pvoldesc->recordingDateAndTime);
  #ifdef UDFFS_DEBUG
-               struct timestamp *ts = &pvoldesc->recordingDateAndTime;
-               udf_debug("recording time %04u/%02u/%02u %02u:%02u (%x)\n",
-                         le16_to_cpu(ts->year), ts->month, ts->day, ts->hour,
-                         ts->minute, le16_to_cpu(ts->typeAndTimezone));
+       ts = &pvoldesc->recordingDateAndTime;
+       udf_debug("recording time %04u/%02u/%02u %02u:%02u (%x)\n",
+                 le16_to_cpu(ts->year), ts->month, ts->day, ts->hour,
+                 ts->minute, le16_to_cpu(ts->typeAndTimezone));
  #endif
-       }
  
 -      ret = udf_dstrCS0toUTF8(outstr, 31, pvoldesc->volIdent, 32);
 +      ret = udf_dstrCS0toChar(sb, outstr, 31, pvoldesc->volIdent, 32);
        if (ret < 0)
                goto out_bh;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge