2023-07-05 19:12:59

by Jeff Layton

[permalink] [raw]
Subject: [PATCH v2 36/92] ecryptfs: 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: Jeff Layton <[email protected]>
---
fs/ecryptfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 83274915ba6d..b491bb239c8f 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -148,7 +148,7 @@ static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry,
}
fsstack_copy_attr_times(dir, lower_dir);
set_nlink(inode, ecryptfs_inode_to_lower(inode)->i_nlink);
- inode->i_ctime = dir->i_ctime;
+ inode_set_ctime_to_ts(inode, inode_get_ctime(dir));
out_unlock:
dput(lower_dentry);
inode_unlock(lower_dir);
--
2.41.0



2023-07-06 11:33:27

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH v2 36/92] ecryptfs: convert to ctime accessor functions

On Wed 05-07-23 15:01:01, 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 <[email protected]>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <[email protected]>

Honza

> ---
> fs/ecryptfs/inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
> index 83274915ba6d..b491bb239c8f 100644
> --- a/fs/ecryptfs/inode.c
> +++ b/fs/ecryptfs/inode.c
> @@ -148,7 +148,7 @@ static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry,
> }
> fsstack_copy_attr_times(dir, lower_dir);
> set_nlink(inode, ecryptfs_inode_to_lower(inode)->i_nlink);
> - inode->i_ctime = dir->i_ctime;
> + inode_set_ctime_to_ts(inode, inode_get_ctime(dir));
> out_unlock:
> dput(lower_dentry);
> inode_unlock(lower_dir);
> --
> 2.41.0
>
--
Jan Kara <[email protected]>
SUSE Labs, CR