From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [RFC][PATCH] ensure i_ino uniqueness in filesystems without permanent inode numbers (via pointer conversion) Date: Fri, 17 Nov 2006 06:50:37 -0700 Message-ID: <20061117135037.GB18567@parisc-linux.org> References: <1163770980.13410.39.camel@dantu.rdu.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from palinux.external.hp.com ([192.25.206.14]:45010 "EHLO mail.parisc-linux.org") by vger.kernel.org with ESMTP id S1755091AbWKQNui (ORCPT ); Fri, 17 Nov 2006 08:50:38 -0500 To: Jeff Layton Content-Disposition: inline In-Reply-To: <1163770980.13410.39.camel@dantu.rdu.redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Nov 17, 2006 at 08:43:00AM -0500, Jeff Layton wrote: > +/* convert an inode address into an unsigned int and xor it with a random value > + * determined at boot time */ > +static inline unsigned int inode_to_uint (struct inode *inode) > +{ > + return ((((unsigned long) (inode - (struct inode *) 0)) > + ^ inode_xor_mask) & 0xffffffff); > +} Seems a little obfuscated. Why not simply: return ((unsigned long)inode ^ inode_xor_mask) & 0xffffffff; > @@ -125,7 +135,6 @@ static struct inode *alloc_inode(struct > inode->i_size = 0; > inode->i_blocks = 0; > inode->i_bytes = 0; > - inode->i_generation = 0; > #ifdef CONFIG_QUOTA > memset(&inode->i_dquot, 0, sizeof(inode->i_dquot)); > #endif It seems to me that filesystems with fake inodes could instead initialise i_generation to, say, jiffies. What do you think to that? I like this idea, very creative.