Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5353228imm; Tue, 19 Jun 2018 09:04:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK5XBFnCZmpnavQ1QQcoRETjpZMEPgH2FiG9NMC7oCNgMe5b6rrhD4xdnmFlUR7dqUtHomQ X-Received: by 2002:a17:902:8a81:: with SMTP id p1-v6mr19045757plo.33.1529424281605; Tue, 19 Jun 2018 09:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529424281; cv=none; d=google.com; s=arc-20160816; b=QEBT2MzRxjor5FKfEJGcPJhJhpTghKbP9w1DxCOzWXekQfJcibXHf4sghkKRFrNjON EQociX4RDuR0twOfdMIxbrLb1lCOBFJja0gDhFhBR52rmPhmvN5/nubZe5qchzJFZvSg ZmVMyUAa1NTgEFAAKB97TJICXgce1DnSpYWu8g3WiazvCgjwl9I9SUPs9aExEUGxym5B fY58ui/jVCwQROBl1AFF3Nbq3LEljKPoEVy9JcOGIe1Es82TudmmqTMB4/3VVYptXBRQ RuKRQPk8CVSOXCubA9PHONTRSqC8mggaH3645rTI4jOxQ23Y71M5iON68Txgg7PALQbj YFRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=TlKScKp/lYqMBxxiYCV8oY8p4gI/LRfMrad1tNaMgGs=; b=rg9G83qgObZx11aaFZK8MTbzDTFCtRi6xH2tz4vqGX7m9O4rEiAgNZb6lHbK5xbJp2 BW8S1CXNqGeh1MSZDUQwNFOSBTPa9jvfaGob1QRfTDZSvDpON98RI3xeFMW+URWFZTS7 KuFpiGYUR0lH0So+RMJpOsIr21TbXNTnhVfNGeN/aXq3nAM1C7TWYLd+bFae2lHRA+lX ZkNGCTZh2Q4/Rx2zLGOrDncStDR/txWQHjrINaQ4VtoJT0w1FS/QJo3twITL+5Tctxn9 AHUzM80odsZ03jmZWrUP3n9FEUva9vks19pfg7xryeGUtRb9hNN9J/OPpHLrVnMfjrQZ fT4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10-v6si30290plr.265.2018.06.19.09.04.27; Tue, 19 Jun 2018 09:04:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966949AbeFSQDd (ORCPT + 99 others); Tue, 19 Jun 2018 12:03:33 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:33533 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966267AbeFSQD2 (ORCPT ); Tue, 19 Jun 2018 12:03:28 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MOETY-1fapPp2sgW-005ZXD; Tue, 19 Jun 2018 18:03:21 +0200 From: Arnd Bergmann To: Al Viro , Andrew Morton Cc: y2038@lists.linaro.org, Arnd Bergmann , Vyacheslav Dubeyko , "Ernesto A. Fernandez" , Deepa Dinamani , Jan Kara , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] hfsplus: return inode birthtime for statx Date: Tue, 19 Jun 2018 18:02:09 +0200 Message-Id: <20180619160223.4108556-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180619160223.4108556-1-arnd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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have the data in the kernel, so we might just as well provide it to user space. Signed-off-by: Arnd Bergmann --- fs/hfsplus/dir.c | 1 + fs/hfsplus/hfsplus_fs.h | 2 ++ fs/hfsplus/inode.c | 14 ++++++++++++++ 3 files changed, 17 insertions(+) diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index b5254378f011..df14b6dd5b5a 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -566,6 +566,7 @@ const struct inode_operations hfsplus_dir_inode_operations = { .symlink = hfsplus_symlink, .mknod = hfsplus_mknod, .rename = hfsplus_rename, + .getattr = hfsplus_getattr, .listxattr = hfsplus_listxattr, #ifdef CONFIG_HFSPLUS_FS_POSIX_ACL .get_acl = hfsplus_get_posix_acl, diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index 646c207be38d..1a6b469f8d22 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -489,6 +489,8 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd); int hfsplus_cat_write_inode(struct inode *inode); int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, int datasync); +int hfsplus_getattr(const struct path *path, struct kstat *stat, + u32 request_mask, unsigned int query_flags); /* ioctl.c */ long hfsplus_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index c0c8d433864f..f9bb568f9479 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -276,6 +276,19 @@ static int hfsplus_setattr(struct dentry *dentry, struct iattr *attr) return 0; } +int hfsplus_getattr(const struct path *path, struct kstat *stat, + u32 request_mask, unsigned int query_flags) +{ + struct inode *inode = d_backing_inode(path->dentry); + + generic_fillattr(inode, stat); + + stat->btime = hfsp_mt2ut(HFSPLUS_I(inode)->create_date); + stat->result_mask |= STATX_BTIME; + + return 0; +} + int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) { @@ -335,6 +348,7 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, static const struct inode_operations hfsplus_file_inode_operations = { .setattr = hfsplus_setattr, + .getattr = hfsplus_getattr, .listxattr = hfsplus_listxattr, #ifdef CONFIG_HFSPLUS_FS_POSIX_ACL .get_acl = hfsplus_get_posix_acl, -- 2.9.0