From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757105Ab0JUTks (ORCPT ); Thu, 21 Oct 2010 15:40:48 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:36103 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754474Ab0JUTkr (ORCPT ); Thu, 21 Oct 2010 15:40:47 -0400 Date: Thu, 21 Oct 2010 20:40:45 +0100 From: Al Viro To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/21] fs: rework icount to be a locked variable Message-ID: <20101021194044.GC19804@ZenIV.linux.org.uk> References: <1287622186-1935-1-git-send-email-david@fromorbit.com> <1287622186-1935-9-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1287622186-1935-9-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2010 at 11:49:33AM +1100, Dave Chinner wrote: > From: Dave Chinner > > The inode reference count is currently an atomic variable so that it > can be sampled/modified outside the inode_lock. However, the > inode_lock is still needed to synchronise the final reference count > and checks against the inode state. > > To avoid needing the protection of the inode lock, protect the inode > reference count with the per-inode i_lock and convert it to a normal > variable. To avoid existing out-of-tree code accidentally compiling > against the new method, rename the i_count field to i_ref. This is > relatively straight forward as there are limited external references > to the i_count field remaining. BTW, the same thing as with Nick's set - separate patch for "clone the reference to inode we are already holding" helper, in front of queue.