Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1313334imm; Wed, 20 Jun 2018 15:47:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIw1nOUf+Bu7udtH0+FxmXBXUkzFgIkOwGAMKVMw/CHHfx0O+1B9WsRkCe+upKCVWNiU3f/ X-Received: by 2002:a17:902:8347:: with SMTP id z7-v6mr26208354pln.290.1529534837731; Wed, 20 Jun 2018 15:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529534837; cv=none; d=google.com; s=arc-20160816; b=0Wd4jQfrCUVlFSF3zI5/HuZOckmGTIEnBABpLytIPjM8FhXm9x604xiS39Y3tLtc/+ zKxwXn5va7HGwQu2CyC4zAVJPfZ6aV5Pzd7X4FDL9D8lkxPVP0T4N0nnMiR8GIy8nkFO PLxLZVisU92cH9L4+Dj/mKeS47txnUWaEjouVzthIfZoulA8jpp/wazwdymvS8Quotwp EYTmPJY28QnIpP4NzxmR2nmyN1lmyD2GkHA5favkxGBsKPMzA2ox/mSD836kE2S8Zahe WpvP+BnFuWqPb7lD654c8i2ZjT2ki4RIwHOkvLl309tLJsBVFSQn9MbUJ0f9WE8jnNXM bxcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=ENMzouPXFPxc/mwmfEGBAa2xH+v0dRkuojp2f9YgbCg=; b=Xmdco5gdcw5O7QJmvcOkPMKovOa5eo1ty2MRQaYZT1B7qmnt63zCdSjXqw+p9u6n6F 50JauIwStZyeI8sz317K5bBTl5tv3BrqgS/aPIxFYFSw4rzcvt9AO3o6OPcRPjkLyw0O keQ5gsEUgGPqcMIupfpWGatyabz7Cn6hWvOeeeD845qFfCDtZvw+pZSv+4XzOJkpMtfF i/sAnK1l4Prf1Z0SEDixwh9WygPJDVZkyYf2/VeDIqfE5iFerF60MrR0UYxn3UgZL61H 5B8D1rc3oq4s56gfoZZDkMFROA3t+qKH85KwL5kSkrmNfSp74icIvdyGNRkTq/+jgSPz ukNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BXX0ZU6A; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t200-v6si2578774pgb.553.2018.06.20.15.47.03; Wed, 20 Jun 2018 15:47:17 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BXX0ZU6A; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754113AbeFTWqC (ORCPT + 99 others); Wed, 20 Jun 2018 18:46:02 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:34797 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753651AbeFTWqA (ORCPT ); Wed, 20 Jun 2018 18:46:00 -0400 Received: by mail-qk0-f196.google.com with SMTP id q70-v6so744817qke.1; Wed, 20 Jun 2018 15:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ENMzouPXFPxc/mwmfEGBAa2xH+v0dRkuojp2f9YgbCg=; b=BXX0ZU6AmcWKIWslc4/Zt/s3t/RNYq5XWHj/7OhbBjwbNZe4tPJIkR5M3h1xwRsVA4 Uc6WvEAl58IJ1Twq7pNkmQO4MyB6qrfptmzD9NdwirIJdZIshYAp3KLNqYw5JiIVLZpk cOnLypgJpZmRRpOPHi0QdRzrNuWGK7DDOIZePief2DvUdSkhuKfBxyyeAx173IIPG4Ad BrNKDV0M0rRyAEUtADWzwwSC74SJkbWydYiC5pV+TwUhspN8SnGUGiXSQOjtO9r/lTdy 79YEuNaNJzoiZw6OceotfYEeluLiVU+GuVGjLXhnvwwKjjpiq91kQNj4xO4qWhlhSLDJ YgiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ENMzouPXFPxc/mwmfEGBAa2xH+v0dRkuojp2f9YgbCg=; b=BviVJnTisabSvcOt9YacAi+YBvP9Nt3t5FEdDT2Qj2S//XIF+S89a4rkc6umbEDRhj VgI2wtzSwPA+n0f5wQtQRRxfsSr7PylBzm0iVQZWMw5T+p9cYLiZCMu6x7svWEav5Y+z 2YPfUoymYQE6PXMAdtQ1LmKs/WwQjA09k/hQWWHx8a1OdHOWPvVFwPJRLsPDKumHLbTF qjo1GNMFb914pKI44Cep9dKM5KsUJdowI7w3NZUN5jzigWmIJsl+zaBdb+XKGX24Q9Od aSb/XUeS4LdbtRupXhzcP6il2FT5Lua8Kv55Y5vjkjXdtZCIKYFN7I4d498rGr5XD8Ea qfZw== X-Gm-Message-State: APt69E3ijdUgLLyIvRMuhZCJKvFYdIzkPlz+hoaww24bxwpRxvXIVYNK 2OheTu5UJ87+o6HOKKmnEP4= X-Received: by 2002:a37:5704:: with SMTP id l4-v6mr19348320qkb.53.1529534760040; Wed, 20 Jun 2018 15:46:00 -0700 (PDT) Received: from eaf ([181.47.179.0]) by smtp.gmail.com with ESMTPSA id w46-v6sm2967416qtw.55.2018.06.20.15.45.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 15:45:59 -0700 (PDT) Date: Wed, 20 Jun 2018 19:45:54 -0300 From: Ernesto =?utf-8?Q?A=2E_Fern=C3=A1ndez?= To: Arnd Bergmann Cc: Al Viro , Andrew Morton , y2038@lists.linaro.org, Vyacheslav Dubeyko , Deepa Dinamani , Jan Kara , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Ernesto A. Fernandez" Subject: Re: [PATCH 3/3] hfsplus: return inode birthtime for statx Message-ID: <20180620224553.wfz6abuvvz4ul42d@eaf> References: <20180619160223.4108556-1-arnd@arndb.de> <20180619160223.4108556-3-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180619160223.4108556-3-arnd@arndb.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi: On Tue, Jun 19, 2018 at 06:02:09PM +0200, Arnd Bergmann wrote: > 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); I think d_inode() is better. They work the same, but "normal filesystems should not use this", according to the d_backing_inode() documentation. > + > + 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 > What about symlinks and special files? Thanks, Ernest