From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [PATCH 19/18] fs: split __inode_add_to_list Date: Tue, 12 Oct 2010 21:47:27 +1100 Message-ID: <20101012104727.GC32255@dastard> References: <1286515292-15882-1-git-send-email-david@fromorbit.com> <20101009080854.GA15943@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from bld-mail12.adl6.internode.on.net ([150.101.137.97]:37381 "EHLO mail.internode.on.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757139Ab0JLKrc (ORCPT ); Tue, 12 Oct 2010 06:47:32 -0400 Content-Disposition: inline In-Reply-To: <20101009080854.GA15943@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Oct 09, 2010 at 04:08:54AM -0400, Christoph Hellwig wrote: > __inode_add_to_list does two things that aren't related. First it ad= ds > the inode to the s_inodes list in the superblock, and second it optio= nally > adds the inode to the inode hash. Now that these don't even share th= e > same lock there is no need to keeps this functionally together. Spli= t > out an add_to_inode_hash helper from __insert_inode_hash to add an in= ode > to a pre-calculated hash bucket for use by the various iget version, = and > a inode_add_to_sb_list helper from __inode_add_to_list to just add an > inode to the per-sb list. The inode.c-internal callers of > __inode_add_to_list are converted to a sequence of inode_add_to_sb_li= st > and __insert_inode_hash (if needed), and the only use of inode_add_to= _list > in XFS is replaced with a call to inode_add_to_sb_list and insert_ino= de_hash. The only reason XFS hashed the inodes was to avoid problems in the generic code that checked for unhashed inodes during clear_inode(). The evict() changeover moved that unhashed check into generic_drop_inode(), which the filesystem can override. Hence if you add a ->drop_inode() method for XFS that just checks the link count, we can avoid ha=D1=95hing the inodes altogether for XFS. I can add another patch on top of this one to do that if you want... Cheers, Dave. --=20 Dave Chinner david@fromorbit.com -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html