2021-04-16 18:56:10

by Chung-Chiang Cheng

[permalink] [raw]
Subject: [PATCH] hfsplus: report create_date to kstat.btime

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 <[email protected]>
---
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


2021-06-25 03:09:27

by Chung-Chiang Cheng

[permalink] [raw]
Subject: Re: [PATCH] hfsplus: report create_date to kstat.btime

From: Chung-Chiang Cheng <[email protected]>

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 <[email protected]> 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 <[email protected]>
> ---
> 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
>

2021-06-28 23:38:58

by Viacheslav Dubeyko

[permalink] [raw]
Subject: Re: [PATCH] hfsplus: report create_date to kstat.btime



> On Apr 16, 2021, at 10:21 AM, Chung-Chiang Cheng <[email protected]> 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 <[email protected]>
> ---
> 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 <[email protected]>

Thanks,
Slava.