[v2,14/92] reiserfs: convert to simple_rename_timestamp

Message ID 20230705190309.579783-12-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 p.m. UTC
  Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/reiserfs/namei.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
  

Comments

Jan Kara July 6, 2023, 10:32 a.m. UTC | #1
On Wed 05-07-23 15:00:39, Jeff Layton wrote:
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/reiserfs/namei.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
> index 52240cc891cf..405ac59eb2dd 100644
> --- a/fs/reiserfs/namei.c
> +++ b/fs/reiserfs/namei.c
> @@ -1325,7 +1325,6 @@ static int reiserfs_rename(struct mnt_idmap *idmap,
>  	int jbegin_count;
>  	umode_t old_inode_mode;
>  	unsigned long savelink = 1;
> -	struct timespec64 ctime;
>  
>  	if (flags & ~RENAME_NOREPLACE)
>  		return -EINVAL;
> @@ -1576,14 +1575,11 @@ static int reiserfs_rename(struct mnt_idmap *idmap,
>  
>  	mark_de_hidden(old_de.de_deh + old_de.de_entry_num);
>  	journal_mark_dirty(&th, old_de.de_bh);
> -	ctime = current_time(old_dir);
> -	old_dir->i_ctime = old_dir->i_mtime = ctime;
> -	new_dir->i_ctime = new_dir->i_mtime = ctime;
>  	/*
>  	 * thanks to Alex Adriaanse <alex_a@caltech.edu> for patch
>  	 * which adds ctime update of renamed object
>  	 */
> -	old_inode->i_ctime = ctime;
> +	simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry);
>  
>  	if (new_dentry_inode) {
>  		/* adjust link number of the victim */
> @@ -1592,7 +1588,6 @@ static int reiserfs_rename(struct mnt_idmap *idmap,
>  		} else {
>  			drop_nlink(new_dentry_inode);
>  		}
> -		new_dentry_inode->i_ctime = ctime;
>  		savelink = new_dentry_inode->i_nlink;
>  	}
>  
> -- 
> 2.41.0
>
  

Patch

diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index 52240cc891cf..405ac59eb2dd 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -1325,7 +1325,6 @@  static int reiserfs_rename(struct mnt_idmap *idmap,
 	int jbegin_count;
 	umode_t old_inode_mode;
 	unsigned long savelink = 1;
-	struct timespec64 ctime;
 
 	if (flags & ~RENAME_NOREPLACE)
 		return -EINVAL;
@@ -1576,14 +1575,11 @@  static int reiserfs_rename(struct mnt_idmap *idmap,
 
 	mark_de_hidden(old_de.de_deh + old_de.de_entry_num);
 	journal_mark_dirty(&th, old_de.de_bh);
-	ctime = current_time(old_dir);
-	old_dir->i_ctime = old_dir->i_mtime = ctime;
-	new_dir->i_ctime = new_dir->i_mtime = ctime;
 	/*
 	 * thanks to Alex Adriaanse <alex_a@caltech.edu> for patch
 	 * which adds ctime update of renamed object
 	 */
-	old_inode->i_ctime = ctime;
+	simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry);
 
 	if (new_dentry_inode) {
 		/* adjust link number of the victim */
@@ -1592,7 +1588,6 @@  static int reiserfs_rename(struct mnt_idmap *idmap,
 		} else {
 			drop_nlink(new_dentry_inode);
 		}
-		new_dentry_inode->i_ctime = ctime;
 		savelink = new_dentry_inode->i_nlink;
 	}