From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D9E5CDB482 for ; Thu, 19 Oct 2023 14:41:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235418AbjJSOl6 (ORCPT ); Thu, 19 Oct 2023 10:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346232AbjJSOlX (ORCPT ); Thu, 19 Oct 2023 10:41:23 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E9E710D3; Thu, 19 Oct 2023 07:41:15 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 45DEF21A60; Thu, 19 Oct 2023 14:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1697726473; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=giUtDebGC6NH2VxVmcfSKNOmZ8T50HmB+uU52TrCw5s=; b=s3/NkTWMWcdC2YaKJScEK9z2CwoGs+34LvlukdkIbgzgmhJOypbE1F5tQu1CgN+e/SODY+ yVM1R8TakTBTpd8Kfu2OTLsyN9BAX1DSvHWkTxLaygzz1TlA58landeXMwKmdDwBVUfQ+z +SOND7nf19WVZHBtjO0mIIyC6qnAt2k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1697726473; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=giUtDebGC6NH2VxVmcfSKNOmZ8T50HmB+uU52TrCw5s=; b=F1DHfkkMuiKq0YZfVvVhiGNdbjG3MziNMFeVI2cSYkIflSvXsylQXbT11Hg7y2BdnUJC+S cr2n8RuwMwCA3zCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 36F5E1357F; Thu, 19 Oct 2023 14:41:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6ZJjDQlAMWXcCQAAMHmgww (envelope-from ); Thu, 19 Oct 2023 14:41:13 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id BA13FA06B0; Thu, 19 Oct 2023 16:41:12 +0200 (CEST) Date: Thu, 19 Oct 2023 16:41:12 +0200 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Jeff Layton , Chuck Lever , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH 4/5] exportfs: define FILEID_INO64_GEN* file handle types Message-ID: <20231019144112.anbgoixxe2aol5s6@quack3> References: <20231018100000.2453965-1-amir73il@gmail.com> <20231018100000.2453965-5-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231018100000.2453965-5-amir73il@gmail.com> Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [-6.60 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-3.00)[-1.000]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_SEVEN(0.00)[7]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed 18-10-23 12:59:59, Amir Goldstein wrote: > Similar to the common FILEID_INO32* file handle types, define common > FILEID_INO64* file handle types. > > The type values of FILEID_INO64_GEN and FILEID_INO64_GEN_PARENT are the > values returned by fuse and xfs for 64bit ino encoded file handle types. > > Note that these type value are filesystem specific and they do not define > a universal file handle format, for example: > fuse encodes FILEID_INO64_GEN as [ino-hi32,ino-lo32,gen] and xfs encodes > FILEID_INO64_GEN as [hostr-order-ino64,gen] (a.k.a xfs_fid64). > > The FILEID_INO64_GEN fhandle type is going to be used for file ids for > fanotify from filesystems that do not support NFS export. > > Signed-off-by: Amir Goldstein Yeah, better than the plain numbers. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/fuse/inode.c | 7 ++++--- > include/linux/exportfs.h | 11 +++++++++++ > 2 files changed, 15 insertions(+), 3 deletions(-) > > diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c > index 2e4eb7cf26fb..e63f966698a5 100644 > --- a/fs/fuse/inode.c > +++ b/fs/fuse/inode.c > @@ -1002,7 +1002,7 @@ static int fuse_encode_fh(struct inode *inode, u32 *fh, int *max_len, > } > > *max_len = len; > - return parent ? 0x82 : 0x81; > + return parent ? FILEID_INO64_GEN_PARENT : FILEID_INO64_GEN; > } > > static struct dentry *fuse_fh_to_dentry(struct super_block *sb, > @@ -1010,7 +1010,8 @@ static struct dentry *fuse_fh_to_dentry(struct super_block *sb, > { > struct fuse_inode_handle handle; > > - if ((fh_type != 0x81 && fh_type != 0x82) || fh_len < 3) > + if ((fh_type != FILEID_INO64_GEN && > + fh_type != FILEID_INO64_GEN_PARENT) || fh_len < 3) > return NULL; > > handle.nodeid = (u64) fid->raw[0] << 32; > @@ -1024,7 +1025,7 @@ static struct dentry *fuse_fh_to_parent(struct super_block *sb, > { > struct fuse_inode_handle parent; > > - if (fh_type != 0x82 || fh_len < 6) > + if (fh_type != FILEID_INO64_GEN_PARENT || fh_len < 6) > return NULL; > > parent.nodeid = (u64) fid->raw[3] << 32; > diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h > index 6b6e01321405..21eeb9f6bdbd 100644 > --- a/include/linux/exportfs.h > +++ b/include/linux/exportfs.h > @@ -98,6 +98,17 @@ enum fid_type { > */ > FILEID_FAT_WITH_PARENT = 0x72, > > + /* > + * 64 bit inode number, 32 bit generation number. > + */ > + FILEID_INO64_GEN = 0x81, > + > + /* > + * 64 bit inode number, 32 bit generation number, > + * 64 bit parent inode number, 32 bit parent generation. > + */ > + FILEID_INO64_GEN_PARENT = 0x82, > + > /* > * 128 bit child FID (struct lu_fid) > * 128 bit parent FID (struct lu_fid) > -- > 2.34.1 > -- Jan Kara SUSE Labs, CR