linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hfsplus: report create_date to kstat.btime
@ 2021-04-16 17:21 Chung-Chiang Cheng
  2021-06-25  3:07 ` Chung-Chiang Cheng
  2021-06-28 17:04 ` Viacheslav Dubeyko
  0 siblings, 2 replies; 3+ messages in thread
From: Chung-Chiang Cheng @ 2021-04-16 17:21 UTC (permalink / raw)
  To: christian.brauner, linux-fsdevel, linux-kernel, jamorris, axboe; +Cc: cccheng

The create_date field of inode in hfsplus is corresponding to kstat.btime
and could be reported in statx.

Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
---
 fs/hfsplus/inode.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 078c5c8a5156..aab3388a0fd7 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -278,6 +278,11 @@ int hfsplus_getattr(struct user_namespace *mnt_userns, const struct path *path,
 	struct inode *inode = d_inode(path->dentry);
 	struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
 
+	if (request_mask & STATX_BTIME) {
+		stat->result_mask |= STATX_BTIME;
+		stat->btime = hfsp_mt2ut(hip->create_date);
+	}
+
 	if (inode->i_flags & S_APPEND)
 		stat->attributes |= STATX_ATTR_APPEND;
 	if (inode->i_flags & S_IMMUTABLE)
-- 
2.25.1


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

* Re: [PATCH] hfsplus: report create_date to kstat.btime
  2021-04-16 17:21 [PATCH] hfsplus: report create_date to kstat.btime Chung-Chiang Cheng
@ 2021-06-25  3:07 ` Chung-Chiang Cheng
  2021-06-28 17:04 ` Viacheslav Dubeyko
  1 sibling, 0 replies; 3+ messages in thread
From: Chung-Chiang Cheng @ 2021-06-25  3:07 UTC (permalink / raw)
  To: christian.brauner, linux-fsdevel, linux-kernel, jamorris, axboe,
	dhowells, ernesto.mnd.fernandez, Al Viro
  Cc: Synology/Chung-Chiang Cheng

From: Chung-Chiang Cheng <cccheng@synology.com>

There's no HFSPLUS maintainer now. Could anyone help to review this
patch or give feedback?

On Sat, Apr 17, 2021 at 1:21 AM Chung-Chiang Cheng <shepjeng@gmail.com> wrote:
>
> The create_date field of inode in hfsplus is corresponding to kstat.btime
> and could be reported in statx.
>
> Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
> ---
>  fs/hfsplus/inode.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
> index 078c5c8a5156..aab3388a0fd7 100644
> --- a/fs/hfsplus/inode.c
> +++ b/fs/hfsplus/inode.c
> @@ -278,6 +278,11 @@ int hfsplus_getattr(struct user_namespace *mnt_userns, const struct path *path,
>         struct inode *inode = d_inode(path->dentry);
>         struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
>
> +       if (request_mask & STATX_BTIME) {
> +               stat->result_mask |= STATX_BTIME;
> +               stat->btime = hfsp_mt2ut(hip->create_date);
> +       }
> +
>         if (inode->i_flags & S_APPEND)
>                 stat->attributes |= STATX_ATTR_APPEND;
>         if (inode->i_flags & S_IMMUTABLE)
> --
> 2.25.1
>

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

* Re: [PATCH] hfsplus: report create_date to kstat.btime
  2021-04-16 17:21 [PATCH] hfsplus: report create_date to kstat.btime Chung-Chiang Cheng
  2021-06-25  3:07 ` Chung-Chiang Cheng
@ 2021-06-28 17:04 ` Viacheslav Dubeyko
  1 sibling, 0 replies; 3+ messages in thread
From: Viacheslav Dubeyko @ 2021-06-28 17:04 UTC (permalink / raw)
  To: Chung-Chiang Cheng
  Cc: christian.brauner, Linux FS Devel, LKML, jamorris, axboe,
	cccheng, Andrew Morton



> On Apr 16, 2021, at 10:21 AM, Chung-Chiang Cheng <shepjeng@gmail.com> wrote:
> 
> The create_date field of inode in hfsplus is corresponding to kstat.btime
> and could be reported in statx.
> 
> Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
> ---
> fs/hfsplus/inode.c | 5 +++++
> 1 file changed, 5 insertions(+)
> 
> diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
> index 078c5c8a5156..aab3388a0fd7 100644
> --- a/fs/hfsplus/inode.c
> +++ b/fs/hfsplus/inode.c
> @@ -278,6 +278,11 @@ int hfsplus_getattr(struct user_namespace *mnt_userns, const struct path *path,
> 	struct inode *inode = d_inode(path->dentry);
> 	struct hfsplus_inode_info *hip = HFSPLUS_I(inode);
> 
> +	if (request_mask & STATX_BTIME) {
> +		stat->result_mask |= STATX_BTIME;
> +		stat->btime = hfsp_mt2ut(hip->create_date);
> +	}
> +
> 	if (inode->i_flags & S_APPEND)
> 		stat->attributes |= STATX_ATTR_APPEND;
> 	if (inode->i_flags & S_IMMUTABLE)
> -- 
> 2.25.1
> 

Looks good for me.

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.


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

end of thread, other threads:[~2021-06-28 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 17:21 [PATCH] hfsplus: report create_date to kstat.btime Chung-Chiang Cheng
2021-06-25  3:07 ` Chung-Chiang Cheng
2021-06-28 17:04 ` Viacheslav Dubeyko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).