Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 7 Sep 2002 15:42:21 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 7 Sep 2002 15:42:21 -0400 Received: from leibniz.math.psu.edu ([146.186.130.2]:22500 "EHLO math.psu.edu") by vger.kernel.org with ESMTP id ; Sat, 7 Sep 2002 15:42:20 -0400 Date: Sat, 7 Sep 2002 15:47:00 -0400 (EDT) From: Alexander Viro To: Jamie Lokier cc: Daniel Phillips , Rusty Russell , linux-kernel@vger.kernel.org Subject: Re: Question about pseudo filesystems In-Reply-To: <20020907192736.A22492@kushida.apsleyroad.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1129 Lines: 28 On Sat, 7 Sep 2002, Jamie Lokier wrote: > Alexander Viro wrote: > > If your rules are "it's pinned as long as there are opened files created > > by foo()" - very well, there are two variants. The basic idea is the same > > - have sum of ->mnt_count for all vfsmounts of our type bumped whenever we > > call foo() and drop whenever final fput() is done on a file created by foo(). > > Thanks -- that's what I implemented, except I used a semaphore instead > of a spinlock. > > I wanted to check that it's safe to call `mntput' from `->release()', > which seems like quite a dubious thing to depend on. But if you say it > is safe, that's cool. It is neither safe nor needed. Please, look at the previous posting again - neither variant calls mntput() in ->release(). Now, __fput() _does_ call mntput() - always. And yes, if that happens to be the final reference - it's OK. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/