All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RESEND] f2fs: use timespec64 for inode timestamps
@ 2018-07-13 14:37 ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-07-13 14:37 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu
  Cc: y2038, Arnd Bergmann, Sheng Yong, Theodore Ts'o,
	Eric Biggers, Yunlei He, Deepa Dinamani, Yunlong Song,
	linux-f2fs-devel, linux-kernel

The on-disk representation and the vfs both use 64-bit tv_sec values,
so let's change the last missing piece in the middle.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I sent this on Jun 20 and got an Ack, but nobody picked up the patch
into linux-next.

Could you merge this for 4.19?
---
 fs/f2fs/f2fs.h  | 16 ++++++----------
 fs/f2fs/inode.c | 12 ++++++------
 fs/f2fs/namei.c |  2 +-
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 6fe7db8d914c..1e49b896e211 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -669,8 +669,8 @@ struct f2fs_inode_info {
 	int i_extra_isize;		/* size of extra space located in i_addr */
 	kprojid_t i_projid;		/* id for project quota */
 	int i_inline_xattr_size;	/* inline xattr size */
-	struct timespec i_crtime;	/* inode creation time */
-	struct timespec i_disk_time[4];	/* inode disk times */
+	struct timespec64 i_crtime;	/* inode creation time */
+	struct timespec64 i_disk_time[4];/* inode disk times */
 };
 
 static inline void get_extent_info(struct extent_info *ext,
@@ -2519,7 +2519,6 @@ static inline void clear_file(struct inode *inode, int type)
 
 static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
 {
-	struct timespec ts;
 	bool ret;
 
 	if (dsync) {
@@ -2535,16 +2534,13 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
 			i_size_read(inode) & ~PAGE_MASK)
 		return false;
 
-	ts = timespec64_to_timespec(inode->i_atime);
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time, &ts))
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime))
 		return false;
-	ts = timespec64_to_timespec(inode->i_ctime);
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &ts))
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime))
 		return false;
-	ts = timespec64_to_timespec(inode->i_mtime);
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &ts))
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime))
 		return false;
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3,
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 3,
 						&F2FS_I(inode)->i_crtime))
 		return false;
 
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index f91dd017a65c..f9d1bccebcb6 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -300,9 +300,9 @@ static int do_read_inode(struct inode *inode)
 		fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec);
 	}
 
-	F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime);
-	F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime);
-	F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime);
+	F2FS_I(inode)->i_disk_time[0] = inode->i_atime;
+	F2FS_I(inode)->i_disk_time[1] = inode->i_ctime;
+	F2FS_I(inode)->i_disk_time[2] = inode->i_mtime;
 	F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime;
 	f2fs_put_page(node_page, 1);
 
@@ -473,9 +473,9 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page)
 	if (inode->i_nlink == 0)
 		clear_inline_node(node_page);
 
-	F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime);
-	F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime);
-	F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime);
+	F2FS_I(inode)->i_disk_time[0] = inode->i_atime;
+	F2FS_I(inode)->i_disk_time[1] = inode->i_ctime;
+	F2FS_I(inode)->i_disk_time[2] = inode->i_mtime;
 	F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime;
 }
 
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 231b7f3ea7d3..2ea0de4cbe76 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -51,7 +51,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
 	inode->i_ino = ino;
 	inode->i_blocks = 0;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
-	F2FS_I(inode)->i_crtime = timespec64_to_timespec(inode->i_mtime);
+	F2FS_I(inode)->i_crtime = inode->i_mtime;
 	inode->i_generation = sbi->s_next_generation++;
 
 	if (S_ISDIR(inode->i_mode))
-- 
2.9.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] [RESEND] f2fs: use timespec64 for inode timestamps
@ 2018-07-13 14:37 ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-07-13 14:37 UTC (permalink / raw)
  To: Jaegeuk Kim, Chao Yu
  Cc: Theodore Ts'o, Arnd Bergmann, Eric Biggers, y2038,
	linux-kernel, linux-f2fs-devel, Deepa Dinamani

The on-disk representation and the vfs both use 64-bit tv_sec values,
so let's change the last missing piece in the middle.

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I sent this on Jun 20 and got an Ack, but nobody picked up the patch
into linux-next.

Could you merge this for 4.19?
---
 fs/f2fs/f2fs.h  | 16 ++++++----------
 fs/f2fs/inode.c | 12 ++++++------
 fs/f2fs/namei.c |  2 +-
 3 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 6fe7db8d914c..1e49b896e211 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -669,8 +669,8 @@ struct f2fs_inode_info {
 	int i_extra_isize;		/* size of extra space located in i_addr */
 	kprojid_t i_projid;		/* id for project quota */
 	int i_inline_xattr_size;	/* inline xattr size */
-	struct timespec i_crtime;	/* inode creation time */
-	struct timespec i_disk_time[4];	/* inode disk times */
+	struct timespec64 i_crtime;	/* inode creation time */
+	struct timespec64 i_disk_time[4];/* inode disk times */
 };
 
 static inline void get_extent_info(struct extent_info *ext,
@@ -2519,7 +2519,6 @@ static inline void clear_file(struct inode *inode, int type)
 
 static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
 {
-	struct timespec ts;
 	bool ret;
 
 	if (dsync) {
@@ -2535,16 +2534,13 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
 			i_size_read(inode) & ~PAGE_MASK)
 		return false;
 
-	ts = timespec64_to_timespec(inode->i_atime);
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time, &ts))
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime))
 		return false;
-	ts = timespec64_to_timespec(inode->i_ctime);
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &ts))
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime))
 		return false;
-	ts = timespec64_to_timespec(inode->i_mtime);
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &ts))
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime))
 		return false;
-	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3,
+	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 3,
 						&F2FS_I(inode)->i_crtime))
 		return false;
 
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index f91dd017a65c..f9d1bccebcb6 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -300,9 +300,9 @@ static int do_read_inode(struct inode *inode)
 		fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec);
 	}
 
-	F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime);
-	F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime);
-	F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime);
+	F2FS_I(inode)->i_disk_time[0] = inode->i_atime;
+	F2FS_I(inode)->i_disk_time[1] = inode->i_ctime;
+	F2FS_I(inode)->i_disk_time[2] = inode->i_mtime;
 	F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime;
 	f2fs_put_page(node_page, 1);
 
@@ -473,9 +473,9 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page)
 	if (inode->i_nlink == 0)
 		clear_inline_node(node_page);
 
-	F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime);
-	F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime);
-	F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime);
+	F2FS_I(inode)->i_disk_time[0] = inode->i_atime;
+	F2FS_I(inode)->i_disk_time[1] = inode->i_ctime;
+	F2FS_I(inode)->i_disk_time[2] = inode->i_mtime;
 	F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime;
 }
 
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 231b7f3ea7d3..2ea0de4cbe76 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -51,7 +51,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
 	inode->i_ino = ino;
 	inode->i_blocks = 0;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
-	F2FS_I(inode)->i_crtime = timespec64_to_timespec(inode->i_mtime);
+	F2FS_I(inode)->i_crtime = inode->i_mtime;
 	inode->i_generation = sbi->s_next_generation++;
 
 	if (S_ISDIR(inode->i_mode))
-- 
2.9.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] [RESEND] f2fs: use timespec64 for inode timestamps
  2018-07-13 14:37 ` Arnd Bergmann
  (?)
@ 2018-07-13 16:10 ` Jaegeuk Kim
  2018-07-13 18:50     ` Arnd Bergmann
  -1 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2018-07-13 16:10 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Chao Yu, y2038, Sheng Yong, Theodore Ts'o, Eric Biggers,
	Yunlei He, Deepa Dinamani, Yunlong Song, linux-f2fs-devel,
	linux-kernel

Hi Arnd,

I queued in the testing branch, since I'm trying to fix another issue in -next.

https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=2cdbbf025aac9f3dd54b9dec0a6603839a3171d3

Allow me to merge it in -next sooner or later.

Thanks,

On 07/13, Arnd Bergmann wrote:
> The on-disk representation and the vfs both use 64-bit tv_sec values,
> so let's change the last missing piece in the middle.
> 
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I sent this on Jun 20 and got an Ack, but nobody picked up the patch
> into linux-next.
> 
> Could you merge this for 4.19?
> ---
>  fs/f2fs/f2fs.h  | 16 ++++++----------
>  fs/f2fs/inode.c | 12 ++++++------
>  fs/f2fs/namei.c |  2 +-
>  3 files changed, 13 insertions(+), 17 deletions(-)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 6fe7db8d914c..1e49b896e211 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -669,8 +669,8 @@ struct f2fs_inode_info {
>  	int i_extra_isize;		/* size of extra space located in i_addr */
>  	kprojid_t i_projid;		/* id for project quota */
>  	int i_inline_xattr_size;	/* inline xattr size */
> -	struct timespec i_crtime;	/* inode creation time */
> -	struct timespec i_disk_time[4];	/* inode disk times */
> +	struct timespec64 i_crtime;	/* inode creation time */
> +	struct timespec64 i_disk_time[4];/* inode disk times */
>  };
>  
>  static inline void get_extent_info(struct extent_info *ext,
> @@ -2519,7 +2519,6 @@ static inline void clear_file(struct inode *inode, int type)
>  
>  static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
>  {
> -	struct timespec ts;
>  	bool ret;
>  
>  	if (dsync) {
> @@ -2535,16 +2534,13 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
>  			i_size_read(inode) & ~PAGE_MASK)
>  		return false;
>  
> -	ts = timespec64_to_timespec(inode->i_atime);
> -	if (!timespec_equal(F2FS_I(inode)->i_disk_time, &ts))
> +	if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime))
>  		return false;
> -	ts = timespec64_to_timespec(inode->i_ctime);
> -	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &ts))
> +	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime))
>  		return false;
> -	ts = timespec64_to_timespec(inode->i_mtime);
> -	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &ts))
> +	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime))
>  		return false;
> -	if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3,
> +	if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 3,
>  						&F2FS_I(inode)->i_crtime))
>  		return false;
>  
> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
> index f91dd017a65c..f9d1bccebcb6 100644
> --- a/fs/f2fs/inode.c
> +++ b/fs/f2fs/inode.c
> @@ -300,9 +300,9 @@ static int do_read_inode(struct inode *inode)
>  		fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec);
>  	}
>  
> -	F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime);
> -	F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime);
> -	F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime);
> +	F2FS_I(inode)->i_disk_time[0] = inode->i_atime;
> +	F2FS_I(inode)->i_disk_time[1] = inode->i_ctime;
> +	F2FS_I(inode)->i_disk_time[2] = inode->i_mtime;
>  	F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime;
>  	f2fs_put_page(node_page, 1);
>  
> @@ -473,9 +473,9 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page)
>  	if (inode->i_nlink == 0)
>  		clear_inline_node(node_page);
>  
> -	F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime);
> -	F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime);
> -	F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime);
> +	F2FS_I(inode)->i_disk_time[0] = inode->i_atime;
> +	F2FS_I(inode)->i_disk_time[1] = inode->i_ctime;
> +	F2FS_I(inode)->i_disk_time[2] = inode->i_mtime;
>  	F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime;
>  }
>  
> diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
> index 231b7f3ea7d3..2ea0de4cbe76 100644
> --- a/fs/f2fs/namei.c
> +++ b/fs/f2fs/namei.c
> @@ -51,7 +51,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
>  	inode->i_ino = ino;
>  	inode->i_blocks = 0;
>  	inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
> -	F2FS_I(inode)->i_crtime = timespec64_to_timespec(inode->i_mtime);
> +	F2FS_I(inode)->i_crtime = inode->i_mtime;
>  	inode->i_generation = sbi->s_next_generation++;
>  
>  	if (S_ISDIR(inode->i_mode))
> -- 
> 2.9.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [RESEND] f2fs: use timespec64 for inode timestamps
  2018-07-13 16:10 ` Jaegeuk Kim
@ 2018-07-13 18:50     ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-07-13 18:50 UTC (permalink / raw)
  To: Jaegeuk Kim
  Cc: Chao Yu, y2038 Mailman List, Sheng Yong, Theodore Ts'o,
	Eric Biggers, Yunlei He, Deepa Dinamani, Yunlong Song,
	Linux F2FS DEV, Mailing List, Linux Kernel Mailing List

On Fri, Jul 13, 2018 at 6:10 PM, Jaegeuk Kim <jaegeuk@kernel.org> wrote:
> Hi Arnd,
>
> I queued in the testing branch, since I'm trying to fix another issue in -next.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=2cdbbf025aac9f3dd54b9dec0a6603839a3171d3
>
> Allow me to merge it in -next sooner or later.

Ok, thanks for the confirmation that it's merged. I didn't mean to rush you,
just wanted to make sure it's not lost.

       Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [RESEND] f2fs: use timespec64 for inode timestamps
@ 2018-07-13 18:50     ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2018-07-13 18:50 UTC (permalink / raw)
  To: Jaegeuk Kim
  Cc: Chao Yu, y2038 Mailman List, Sheng Yong, Theodore Ts'o,
	Eric Biggers, Yunlei He, Deepa Dinamani, Yunlong Song,
	Linux F2FS DEV, Mailing List, Linux Kernel Mailing List

On Fri, Jul 13, 2018 at 6:10 PM, Jaegeuk Kim <jaegeuk@kernel.org> wrote:
> Hi Arnd,
>
> I queued in the testing branch, since I'm trying to fix another issue in -next.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test&id=2cdbbf025aac9f3dd54b9dec0a6603839a3171d3
>
> Allow me to merge it in -next sooner or later.

Ok, thanks for the confirmation that it's merged. I didn't mean to rush you,
just wanted to make sure it's not lost.

       Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-13 18:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 14:37 [PATCH] [RESEND] f2fs: use timespec64 for inode timestamps Arnd Bergmann
2018-07-13 14:37 ` Arnd Bergmann
2018-07-13 16:10 ` Jaegeuk Kim
2018-07-13 18:50   ` Arnd Bergmann
2018-07-13 18:50     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.