Commit 6ac54226 authored by Jeff Layton's avatar Jeff Layton Committed by Christian Brauner
Browse files

apparmor: convert to ctime accessor functions



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.

Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20230705190309.579783-87-jlayton@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent bc734e8e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry,

	inode->i_ino = get_next_ino();
	inode->i_mode = mode;
	inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
	inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
	inode->i_private = data;
	if (S_ISDIR(mode)) {
		inode->i_op = iops ? iops : &simple_dir_inode_operations;
@@ -1557,7 +1557,7 @@ void __aafs_profile_migrate_dents(struct aa_profile *old,
		if (new->dents[i]) {
			struct inode *inode = d_inode(new->dents[i]);

			inode->i_mtime = inode->i_ctime = current_time(inode);
			inode->i_mtime = inode_set_ctime_current(inode);
		}
		old->dents[i] = NULL;
	}
@@ -2543,7 +2543,7 @@ static int aa_mk_null_file(struct dentry *parent)

	inode->i_ino = get_next_ino();
	inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO;
	inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode);
	inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode);
	init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO,
			   MKDEV(MEM_MAJOR, 3));
	d_instantiate(dentry, inode);
+2 −2
Original line number Diff line number Diff line
@@ -89,10 +89,10 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision)
		struct inode *inode;

		inode = d_inode(data->dents[AAFS_LOADDATA_DIR]);
		inode->i_mtime = inode->i_ctime = current_time(inode);
		inode->i_mtime = inode_set_ctime_current(inode);

		inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]);
		inode->i_mtime = inode->i_ctime = current_time(inode);
		inode->i_mtime = inode_set_ctime_current(inode);
	}
}