binderfs: convert to ctime accessor functions
authorJeff Layton <jlayton@kernel.org>
Wed, 5 Jul 2023 19:00:42 +0000 (15:00 -0400)
committerChristian Brauner <brauner@kernel.org>
Thu, 13 Jul 2023 08:28:02 +0000 (10:28 +0200)
In later patches, we're going to change how the inode's ctime field is
used. Switch to using accessor functions instead of raw accesses of
inode->i_ctime.

Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-15-jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
drivers/android/binderfs.c

index 76e7d66..faebe9f 100644 (file)
@@ -153,7 +153,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode,
                goto err;
 
        inode->i_ino = minor + INODE_OFFSET;
-       inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+       inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode);
        init_special_inode(inode, S_IFCHR | 0600,
                           MKDEV(MAJOR(binderfs_dev), minor));
        inode->i_fop = &binder_fops;
@@ -432,7 +432,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb)
        }
 
        inode->i_ino = SECOND_INODE;
-       inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+       inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode);
        init_special_inode(inode, S_IFCHR | 0600,
                           MKDEV(MAJOR(binderfs_dev), minor));
        inode->i_fop = &binder_ctl_fops;
@@ -474,7 +474,7 @@ static struct inode *binderfs_make_inode(struct super_block *sb, int mode)
        if (ret) {
                ret->i_ino = iunique(sb, BINDERFS_MAX_MINOR + INODE_OFFSET);
                ret->i_mode = mode;
-               ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret);
+               ret->i_atime = ret->i_mtime = inode_set_ctime_current(ret);
        }
        return ret;
 }
@@ -703,7 +703,7 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc)
        inode->i_ino = FIRST_INODE;
        inode->i_fop = &simple_dir_operations;
        inode->i_mode = S_IFDIR | 0755;
-       inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+       inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode);
        inode->i_op = &binderfs_dir_inode_operations;
        set_nlink(inode, 2);