All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] erofs: rename ctime to mtime
@ 2022-03-17 11:48 Gao Xiang
  0 siblings, 0 replies; 5+ messages in thread
From: Gao Xiang @ 2022-03-17 11:48 UTC (permalink / raw)
  To: linux-erofs, Chao Yu; +Cc: Gao Xiang

From: David Anderson <dvander@google.com>

EROFS images should inherit modification time rather than change time,
since users and host tooling have no easy way to control change time.

To reflect the new timestamp meaning, i_ctime and i_ctime_nsec are
renamed to i_mtime and i_mtime_nsec.

Signed-off-by: David Anderson <dvander@google.com>
[ Gao Xiang: update document as well. ]
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
If no other concerns, I will apply it for 5.18.

 Documentation/filesystems/erofs.rst | 2 +-
 fs/erofs/erofs_fs.h                 | 5 +++--
 fs/erofs/inode.c                    | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/Documentation/filesystems/erofs.rst b/Documentation/filesystems/erofs.rst
index 7119aa213be7..bef6d3040ce4 100644
--- a/Documentation/filesystems/erofs.rst
+++ b/Documentation/filesystems/erofs.rst
@@ -40,7 +40,7 @@ Here is the main features of EROFS:
    Inode metadata size    32 bytes      64 bytes
    Max file size          4 GB          16 EB (also limited by max. vol size)
    Max uids/gids          65536         4294967296
-   File change time       no            yes (64 + 32-bit timestamp)
+   Per-inode timestamp    no            yes (64 + 32-bit timestamp)
    Max hardlinks          65536         4294967296
    Metadata reserved      4 bytes       14 bytes
    =====================  ============  =====================================
diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_fs.h
index 3ea62c6fb00a..1238ca104f09 100644
--- a/fs/erofs/erofs_fs.h
+++ b/fs/erofs/erofs_fs.h
@@ -12,6 +12,7 @@
 #define EROFS_SUPER_OFFSET      1024
 
 #define EROFS_FEATURE_COMPAT_SB_CHKSUM          0x00000001
+#define EROFS_FEATURE_COMPAT_MTIME              0x00000002
 
 /*
  * Any bits that aren't in EROFS_ALL_FEATURE_INCOMPAT should
@@ -186,8 +187,8 @@ struct erofs_inode_extended {
 
 	__le32 i_uid;
 	__le32 i_gid;
-	__le64 i_ctime;
-	__le32 i_ctime_nsec;
+	__le64 i_mtime;
+	__le32 i_mtime_nsec;
 	__le32 i_nlink;
 	__u8   i_reserved2[16];
 };
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index ff62f84f47d3..e8b37ba5e9ad 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -113,8 +113,8 @@ static void *erofs_read_inode(struct erofs_buf *buf,
 		set_nlink(inode, le32_to_cpu(die->i_nlink));
 
 		/* extended inode has its own timestamp */
-		inode->i_ctime.tv_sec = le64_to_cpu(die->i_ctime);
-		inode->i_ctime.tv_nsec = le32_to_cpu(die->i_ctime_nsec);
+		inode->i_ctime.tv_sec = le64_to_cpu(die->i_mtime);
+		inode->i_ctime.tv_nsec = le32_to_cpu(die->i_mtime_nsec);
 
 		inode->i_size = le64_to_cpu(die->i_size);
 
-- 
2.24.4


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

* Re: [PATCH] erofs: rename ctime to mtime
  2022-03-16  4:44   ` Gao Xiang
@ 2022-03-18  4:54     ` David Anderson via Linux-erofs
  0 siblings, 0 replies; 5+ messages in thread
From: David Anderson via Linux-erofs @ 2022-03-18  4:54 UTC (permalink / raw)
  To: Gao Xiang; +Cc: linux-erofs

[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]

Sorry about this - thank you for updating the patch!

On Tue, Mar 15, 2022 at 9:45 PM Gao Xiang <hsiangkao@linux.alibaba.com>
wrote:

> Hi David,
>
> On Fri, Mar 11, 2022 at 12:47:20PM +0800, Gao Xiang wrote:
> > Hi David,
> >
> > On Fri, Mar 11, 2022 at 04:18:29AM +0000, David Anderson via Linux-erofs
> wrote:
> > > EROFS images should inherit modification time rather than creation
> time,
> > > since users and host tooling have no easy way to control creation time.
> > > To reflect the new timestamp meaning, i_ctime and i_ctime_nsec are
> > > renamed to i_mtime and i_mtime_nsec.
> > >
> > > Signed-off-by: David Anderson <dvander@google.com>
> >
> > Thanks for the patch!
> >
> > This patch looks good to me, yet, should we update
> >
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/erofs.rst#n43
> >
> > here as well? (I think "Inode timestamp" might be fine..)
>
> Since another -rc8 is out, would you mind revising the patch with
> the document update... Or would you mind if I could help revise it?
>
> Thanks,
> Gao Xiang
>
> >
> > Thanks,
> > Gao Xiang
>

[-- Attachment #2: Type: text/html, Size: 1820 bytes --]

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

* Re: [PATCH] erofs: rename ctime to mtime
  2022-03-11  4:47 ` Gao Xiang
@ 2022-03-16  4:44   ` Gao Xiang
  2022-03-18  4:54     ` David Anderson via Linux-erofs
  0 siblings, 1 reply; 5+ messages in thread
From: Gao Xiang @ 2022-03-16  4:44 UTC (permalink / raw)
  To: David Anderson; +Cc: linux-erofs

Hi David,

On Fri, Mar 11, 2022 at 12:47:20PM +0800, Gao Xiang wrote:
> Hi David,
> 
> On Fri, Mar 11, 2022 at 04:18:29AM +0000, David Anderson via Linux-erofs wrote:
> > EROFS images should inherit modification time rather than creation time,
> > since users and host tooling have no easy way to control creation time.
> > To reflect the new timestamp meaning, i_ctime and i_ctime_nsec are
> > renamed to i_mtime and i_mtime_nsec.
> > 
> > Signed-off-by: David Anderson <dvander@google.com>
> 
> Thanks for the patch!
> 
> This patch looks good to me, yet, should we update
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/erofs.rst#n43
> 
> here as well? (I think "Inode timestamp" might be fine..)

Since another -rc8 is out, would you mind revising the patch with
the document update... Or would you mind if I could help revise it?

Thanks,
Gao Xiang

> 
> Thanks,
> Gao Xiang

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

* Re: [PATCH] erofs: rename ctime to mtime
  2022-03-11  4:18 David Anderson via Linux-erofs
@ 2022-03-11  4:47 ` Gao Xiang
  2022-03-16  4:44   ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Gao Xiang @ 2022-03-11  4:47 UTC (permalink / raw)
  To: David Anderson; +Cc: linux-erofs

Hi David,

On Fri, Mar 11, 2022 at 04:18:29AM +0000, David Anderson via Linux-erofs wrote:
> EROFS images should inherit modification time rather than creation time,
> since users and host tooling have no easy way to control creation time.
> To reflect the new timestamp meaning, i_ctime and i_ctime_nsec are
> renamed to i_mtime and i_mtime_nsec.
> 
> Signed-off-by: David Anderson <dvander@google.com>

Thanks for the patch!

This patch looks good to me, yet, should we update
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/erofs.rst#n43

here as well? (I think "Inode timestamp" might be fine..)

Thanks,
Gao Xiang

> ---
>  fs/erofs/erofs_fs.h | 5 +++--
>  fs/erofs/inode.c    | 4 ++--
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_fs.h
> index 3ea62c6fb00a..1238ca104f09 100644
> --- a/fs/erofs/erofs_fs.h
> +++ b/fs/erofs/erofs_fs.h
> @@ -12,6 +12,7 @@
>  #define EROFS_SUPER_OFFSET      1024
>  
>  #define EROFS_FEATURE_COMPAT_SB_CHKSUM          0x00000001
> +#define EROFS_FEATURE_COMPAT_MTIME              0x00000002
>  
>  /*
>   * Any bits that aren't in EROFS_ALL_FEATURE_INCOMPAT should
> @@ -186,8 +187,8 @@ struct erofs_inode_extended {
>  
>  	__le32 i_uid;
>  	__le32 i_gid;
> -	__le64 i_ctime;
> -	__le32 i_ctime_nsec;
> +	__le64 i_mtime;
> +	__le32 i_mtime_nsec;
>  	__le32 i_nlink;
>  	__u8   i_reserved2[16];
>  };
> diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
> index ff62f84f47d3..e8b37ba5e9ad 100644
> --- a/fs/erofs/inode.c
> +++ b/fs/erofs/inode.c
> @@ -113,8 +113,8 @@ static void *erofs_read_inode(struct erofs_buf *buf,
>  		set_nlink(inode, le32_to_cpu(die->i_nlink));
>  
>  		/* extended inode has its own timestamp */
> -		inode->i_ctime.tv_sec = le64_to_cpu(die->i_ctime);
> -		inode->i_ctime.tv_nsec = le32_to_cpu(die->i_ctime_nsec);
> +		inode->i_ctime.tv_sec = le64_to_cpu(die->i_mtime);
> +		inode->i_ctime.tv_nsec = le32_to_cpu(die->i_mtime_nsec);
>  
>  		inode->i_size = le64_to_cpu(die->i_size);
>  
> -- 
> 2.35.1.723.g4982287a31-goog

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

* [PATCH] erofs: rename ctime to mtime
@ 2022-03-11  4:18 David Anderson via Linux-erofs
  2022-03-11  4:47 ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: David Anderson via Linux-erofs @ 2022-03-11  4:18 UTC (permalink / raw)
  To: linux-erofs

EROFS images should inherit modification time rather than creation time,
since users and host tooling have no easy way to control creation time.
To reflect the new timestamp meaning, i_ctime and i_ctime_nsec are
renamed to i_mtime and i_mtime_nsec.

Signed-off-by: David Anderson <dvander@google.com>
---
 fs/erofs/erofs_fs.h | 5 +++--
 fs/erofs/inode.c    | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/erofs/erofs_fs.h b/fs/erofs/erofs_fs.h
index 3ea62c6fb00a..1238ca104f09 100644
--- a/fs/erofs/erofs_fs.h
+++ b/fs/erofs/erofs_fs.h
@@ -12,6 +12,7 @@
 #define EROFS_SUPER_OFFSET      1024
 
 #define EROFS_FEATURE_COMPAT_SB_CHKSUM          0x00000001
+#define EROFS_FEATURE_COMPAT_MTIME              0x00000002
 
 /*
  * Any bits that aren't in EROFS_ALL_FEATURE_INCOMPAT should
@@ -186,8 +187,8 @@ struct erofs_inode_extended {
 
 	__le32 i_uid;
 	__le32 i_gid;
-	__le64 i_ctime;
-	__le32 i_ctime_nsec;
+	__le64 i_mtime;
+	__le32 i_mtime_nsec;
 	__le32 i_nlink;
 	__u8   i_reserved2[16];
 };
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index ff62f84f47d3..e8b37ba5e9ad 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -113,8 +113,8 @@ static void *erofs_read_inode(struct erofs_buf *buf,
 		set_nlink(inode, le32_to_cpu(die->i_nlink));
 
 		/* extended inode has its own timestamp */
-		inode->i_ctime.tv_sec = le64_to_cpu(die->i_ctime);
-		inode->i_ctime.tv_nsec = le32_to_cpu(die->i_ctime_nsec);
+		inode->i_ctime.tv_sec = le64_to_cpu(die->i_mtime);
+		inode->i_ctime.tv_nsec = le32_to_cpu(die->i_mtime_nsec);
 
 		inode->i_size = le64_to_cpu(die->i_size);
 
-- 
2.35.1.723.g4982287a31-goog


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

end of thread, other threads:[~2022-03-18  4:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17 11:48 [PATCH] erofs: rename ctime to mtime Gao Xiang
  -- strict thread matches above, loose matches on Subject: below --
2022-03-11  4:18 David Anderson via Linux-erofs
2022-03-11  4:47 ` Gao Xiang
2022-03-16  4:44   ` Gao Xiang
2022-03-18  4:54     ` David Anderson via Linux-erofs

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.