Linux 4.12 compat: CURRENT_TIME removed

Linux 4.9 added current_time() as the preferred interface to get
the filesystem time.  CURRENT_TIME was retired in Linux 4.12.

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6114
This commit is contained in:
Brian Behlendorf
2017-05-10 09:30:48 -07:00
committed by GitHub
parent a3eeab2de6
commit 2946a1a15a
7 changed files with 45 additions and 11 deletions
+2 -1
View File
@@ -451,7 +451,7 @@ static struct inode *
zfsctl_inode_alloc(zfsvfs_t *zfsvfs, uint64_t id,
const struct file_operations *fops, const struct inode_operations *ops)
{
struct timespec now = current_fs_time(zfsvfs->z_sb);
struct timespec now;
struct inode *ip;
znode_t *zp;
@@ -459,6 +459,7 @@ zfsctl_inode_alloc(zfsvfs_t *zfsvfs, uint64_t id,
if (ip == NULL)
return (NULL);
now = current_time(ip);
zp = ITOZ(ip);
ASSERT3P(zp->z_dirlocks, ==, NULL);
ASSERT3P(zp->z_acl_cached, ==, NULL);
+9 -6
View File
@@ -103,8 +103,10 @@ static int
zpl_root_getattr_impl(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int query_flags)
{
generic_fillattr(path->dentry->d_inode, stat);
stat->atime = CURRENT_TIME;
struct inode *ip = path->dentry->d_inode;
generic_fillattr(ip, stat);
stat->atime = current_time(ip);
return (0);
}
@@ -377,14 +379,15 @@ static int
zpl_snapdir_getattr_impl(const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int query_flags)
{
zfsvfs_t *zfsvfs = ITOZSB(path->dentry->d_inode);
struct inode *ip = path->dentry->d_inode;
zfsvfs_t *zfsvfs = ITOZSB(ip);
ZFS_ENTER(zfsvfs);
generic_fillattr(path->dentry->d_inode, stat);
generic_fillattr(ip, stat);
stat->nlink = stat->size = 2;
stat->ctime = stat->mtime = dmu_objset_snap_cmtime(zfsvfs->z_os);
stat->atime = CURRENT_TIME;
stat->atime = current_time(ip);
ZFS_EXIT(zfsvfs);
return (0);
@@ -522,7 +525,7 @@ zpl_shares_getattr_impl(const struct path *path, struct kstat *stat,
if (zfsvfs->z_shares_dir == 0) {
generic_fillattr(path->dentry->d_inode, stat);
stat->nlink = stat->size = 2;
stat->atime = CURRENT_TIME;
stat->atime = current_time(ip);
ZFS_EXIT(zfsvfs);
return (0);
}
+1 -1
View File
@@ -596,7 +596,7 @@ zpl_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
return (-EMLINK);
crhold(cr);
ip->i_ctime = CURRENT_TIME_SEC;
ip->i_ctime = current_time(ip);
igrab(ip); /* Use ihold() if available */
cookie = spl_fstrans_mark();
+2 -3
View File
@@ -938,7 +938,6 @@ xattr_handler_t zpl_xattr_security_handler = {
int
zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type)
{
struct super_block *sb = ITOZSB(ip)->z_sb;
char *name, *value = NULL;
int error = 0;
size_t size = 0;
@@ -964,7 +963,7 @@ zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type)
*/
if (ip->i_mode != mode) {
ip->i_mode = mode;
ip->i_ctime = current_fs_time(sb);
ip->i_ctime = current_time(ip);
zfs_mark_inode_dirty(ip);
}
@@ -1130,7 +1129,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
if (!acl) {
ip->i_mode &= ~current_umask();
ip->i_ctime = current_fs_time(ITOZSB(ip)->z_sb);
ip->i_ctime = current_time(ip);
zfs_mark_inode_dirty(ip);
return (0);
}