diff mbox series

[05/79] qib_fs: switch to new ctime accessors

Message ID 20230621144735.55953-4-jlayton@kernel.org (mailing list archive)
State Not Applicable
Headers show
Series None | expand

Commit Message

Jeff Layton June 21, 2023, 2:45 p.m. UTC
In later patches, we're going to change how the ctime.tv_nsec field is
utilized. Switch to using accessor functions instead of raw accesses of
inode->i_ctime.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 drivers/infiniband/hw/qib/qib_fs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jan Kara June 21, 2023, 4:35 p.m. UTC | #1
On Wed 21-06-23 10:45:18, Jeff Layton wrote:
> In later patches, we're going to change how the ctime.tv_nsec field is
> utilized. Switch to using accessor functions instead of raw accesses of
> inode->i_ctime.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Looks good to me. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  drivers/infiniband/hw/qib/qib_fs.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
> index a973905afd13..db008f2884e4 100644
> --- a/drivers/infiniband/hw/qib/qib_fs.c
> +++ b/drivers/infiniband/hw/qib/qib_fs.c
> @@ -64,9 +64,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
>  	inode->i_uid = GLOBAL_ROOT_UID;
>  	inode->i_gid = GLOBAL_ROOT_GID;
>  	inode->i_blocks = 0;
> -	inode->i_atime = current_time(inode);
> -	inode->i_mtime = inode->i_atime;
> -	inode->i_ctime = inode->i_atime;
> +	inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode);
>  	inode->i_private = data;
>  	if (S_ISDIR(mode)) {
>  		inode->i_op = &simple_dir_inode_operations;
> -- 
> 2.41.0
>
Dennis Dalessandro June 21, 2023, 7:37 p.m. UTC | #2
On 6/21/23 10:45 AM, Jeff Layton wrote:
> In later patches, we're going to change how the ctime.tv_nsec field is
> utilized. Switch to using accessor functions instead of raw accesses of
> inode->i_ctime.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  drivers/infiniband/hw/qib/qib_fs.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
> index a973905afd13..db008f2884e4 100644
> --- a/drivers/infiniband/hw/qib/qib_fs.c
> +++ b/drivers/infiniband/hw/qib/qib_fs.c
> @@ -64,9 +64,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
>  	inode->i_uid = GLOBAL_ROOT_UID;
>  	inode->i_gid = GLOBAL_ROOT_GID;
>  	inode->i_blocks = 0;
> -	inode->i_atime = current_time(inode);
> -	inode->i_mtime = inode->i_atime;
> -	inode->i_ctime = inode->i_atime;
> +	inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode);
>  	inode->i_private = data;
>  	if (S_ISDIR(mode)) {
>  		inode->i_op = &simple_dir_inode_operations;

Acked-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c
index a973905afd13..db008f2884e4 100644
--- a/drivers/infiniband/hw/qib/qib_fs.c
+++ b/drivers/infiniband/hw/qib/qib_fs.c
@@ -64,9 +64,7 @@  static int qibfs_mknod(struct inode *dir, struct dentry *dentry,
 	inode->i_uid = GLOBAL_ROOT_UID;
 	inode->i_gid = GLOBAL_ROOT_GID;
 	inode->i_blocks = 0;
-	inode->i_atime = current_time(inode);
-	inode->i_mtime = inode->i_atime;
-	inode->i_ctime = inode->i_atime;
+	inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode);
 	inode->i_private = data;
 	if (S_ISDIR(mode)) {
 		inode->i_op = &simple_dir_inode_operations;