diff mbox series

[2/2] fat: make fat_update_time get its own timestamp

Message ID 20230810-ctime-fat-v1-2-327598fd1de8@kernel.org (mailing list archive)
State New, archived
Headers show
Series fat: revise the FAT patches for mgtime series | expand

Commit Message

Jeff Layton Aug. 10, 2023, 1:12 p.m. UTC
In later patches, we're going to drop the "now" parameter from the
update_time operation. Fix fat_update_time to fetch its own timestamp.
It turns out that this is easily done by just passing a NULL timestamp
pointer to fat_truncate_time.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/fat/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Kara Aug. 10, 2023, 1:22 p.m. UTC | #1
On Thu 10-08-23 09:12:05, Jeff Layton wrote:
> In later patches, we're going to drop the "now" parameter from the
> update_time operation. Fix fat_update_time to fetch its own timestamp.
> It turns out that this is easily done by just passing a NULL timestamp
> pointer to fat_truncate_time.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/fat/misc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/fat/misc.c b/fs/fat/misc.c
> index 37f4afb346af..f2304a1054aa 100644
> --- a/fs/fat/misc.c
> +++ b/fs/fat/misc.c
> @@ -347,7 +347,7 @@ int fat_update_time(struct inode *inode, int flags)
>  		return 0;
>  
>  	if (flags & (S_ATIME | S_CTIME | S_MTIME)) {
> -		fat_truncate_time(inode, now, flags);
> +		fat_truncate_time(inode, NULL, flags);
>  		if (inode->i_sb->s_flags & SB_LAZYTIME)
>  			dirty_flags |= I_DIRTY_TIME;
>  		else
> 
> -- 
> 2.41.0
>
OGAWA Hirofumi Aug. 10, 2023, 5:31 p.m. UTC | #2
Jeff Layton <jlayton@kernel.org> writes:

> In later patches, we're going to drop the "now" parameter from the
> update_time operation. Fix fat_update_time to fetch its own timestamp.
> It turns out that this is easily done by just passing a NULL timestamp
> pointer to fat_truncate_time.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

Thanks.

> ---
>  fs/fat/misc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/misc.c b/fs/fat/misc.c
> index 37f4afb346af..f2304a1054aa 100644
> --- a/fs/fat/misc.c
> +++ b/fs/fat/misc.c
> @@ -347,7 +347,7 @@ int fat_update_time(struct inode *inode, int flags)
>  		return 0;
>  
>  	if (flags & (S_ATIME | S_CTIME | S_MTIME)) {
> -		fat_truncate_time(inode, now, flags);
> +		fat_truncate_time(inode, NULL, flags);
>  		if (inode->i_sb->s_flags & SB_LAZYTIME)
>  			dirty_flags |= I_DIRTY_TIME;
>  		else
Frank Sorenson Aug. 10, 2023, 6:05 p.m. UTC | #3
On 8/10/23 08:12, Jeff Layton wrote:
> In later patches, we're going to drop the "now" parameter from the
> update_time operation. Fix fat_update_time to fetch its own timestamp.
> It turns out that this is easily done by just passing a NULL timestamp
> pointer to fat_truncate_time.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---

Reviewed-by:  Frank Sorenson <sorenson@redhat.com>


>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/misc.c b/fs/fat/misc.c
> index 37f4afb346af..f2304a1054aa 100644
> --- a/fs/fat/misc.c
> +++ b/fs/fat/misc.c
> @@ -347,7 +347,7 @@ int fat_update_time(struct inode *inode, int flags)
>   		return 0;
>   
>   	if (flags & (S_ATIME | S_CTIME | S_MTIME)) {
> -		fat_truncate_time(inode, now, flags);
> +		fat_truncate_time(inode, NULL, flags);
>   		if (inode->i_sb->s_flags & SB_LAZYTIME)
>   			dirty_flags |= I_DIRTY_TIME;
>   		else
>
diff mbox series

Patch

diff --git a/fs/fat/misc.c b/fs/fat/misc.c
index 37f4afb346af..f2304a1054aa 100644
--- a/fs/fat/misc.c
+++ b/fs/fat/misc.c
@@ -347,7 +347,7 @@  int fat_update_time(struct inode *inode, int flags)
 		return 0;
 
 	if (flags & (S_ATIME | S_CTIME | S_MTIME)) {
-		fat_truncate_time(inode, now, flags);
+		fat_truncate_time(inode, NULL, flags);
 		if (inode->i_sb->s_flags & SB_LAZYTIME)
 			dirty_flags |= I_DIRTY_TIME;
 		else