From: Chung-Chiang Cheng Date: Thu, 1 Jul 2021 01:56:40 +0000 (-0700) Subject: hfsplus: report create_date to kstat.btime X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c3eb84092b326a353725edcc8274a3782f1d1524;p=linux.git 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. Link: https://lkml.kernel.org/r/20210416172147.8736-1-cccheng@synology.com Signed-off-by: Chung-Chiang Cheng Reviewed-by: Viacheslav Dubeyko Cc: Christian Brauner Cc: James Morris Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 70e8374ddac40..6fef67c2a9f09 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -281,6 +281,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)