[v2,81/92] vboxsf: convert to ctime accessor functions

Message ID 20230705190309.579783-79-jlayton@kernel.org
State New
Headers
Series [v2,01/92] ibmvmc: update ctime in conjunction with mtime on write |

Commit Message

Jeff Layton July 5, 2023, 7:01 p.m. UTC
  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: Jeff Layton <jlayton@kernel.org>
---
 fs/vboxsf/utils.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jan Kara July 6, 2023, 2:50 p.m. UTC | #1
On Wed 05-07-23 15:01:46, Jeff Layton wrote:
> 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: Jeff Layton <jlayton@kernel.org>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/vboxsf/utils.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c
> index dd0ae1188e87..576b91d571c5 100644
> --- a/fs/vboxsf/utils.c
> +++ b/fs/vboxsf/utils.c
> @@ -128,8 +128,8 @@ int vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode,
>  
>  	inode->i_atime = ns_to_timespec64(
>  				 info->access_time.ns_relative_to_unix_epoch);
> -	inode->i_ctime = ns_to_timespec64(
> -				 info->change_time.ns_relative_to_unix_epoch);
> +	inode_set_ctime_to_ts(inode,
> +			      ns_to_timespec64(info->change_time.ns_relative_to_unix_epoch));
>  	inode->i_mtime = ns_to_timespec64(
>  			   info->modification_time.ns_relative_to_unix_epoch);
>  	return 0;
> -- 
> 2.41.0
>
  

Patch

diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c
index dd0ae1188e87..576b91d571c5 100644
--- a/fs/vboxsf/utils.c
+++ b/fs/vboxsf/utils.c
@@ -128,8 +128,8 @@  int vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode,
 
 	inode->i_atime = ns_to_timespec64(
 				 info->access_time.ns_relative_to_unix_epoch);
-	inode->i_ctime = ns_to_timespec64(
-				 info->change_time.ns_relative_to_unix_epoch);
+	inode_set_ctime_to_ts(inode,
+			      ns_to_timespec64(info->change_time.ns_relative_to_unix_epoch));
 	inode->i_mtime = ns_to_timespec64(
 			   info->modification_time.ns_relative_to_unix_epoch);
 	return 0;