From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH] ecryptfs: some inode attrs, and a question Date: Thu, 15 Jan 2009 23:53:18 -0800 Message-ID: <20090115235318.f728454e.akpm@linux-foundation.org> References: <7471.1231827621@jrobl> <20090115150332.f72ad0f8.akpm@linux-foundation.org> <9845.1232091751@jrobl> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, mhalcrow@us.ibm.com, ecryptfs-devel@lists.launchpad.net To: hooanon05@yahoo.co.jp Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:52653 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762863AbZAPHxZ (ORCPT ); Fri, 16 Jan 2009 02:53:25 -0500 In-Reply-To: <9845.1232091751@jrobl> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 16 Jan 2009 16:42:31 +0900 hooanon05@yahoo.co.jp wrote: > Andrew Morton: > > > + atomic_inc_return(&lower_dentry->d_inode->i_count); > > > + atomic_inc_return(&lower_inode->i_count); > > > > atomic_inc() would suffice here, yes? > > I thought that ..._return() is smp safe and necessary here. > Because lower_inode may be touched by lower fs (outside of ecryptfs). atomic_inc() is fully atomic too. atomic_inc_return() is "special", in that it does an atomic_inc(), but also returns the result of that increment to the caller.