From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shaya Potter Subject: Re: which dentry a page belongs to Date: Fri, 23 Apr 2004 13:59:00 -0400 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <1082743140.1943.82.camel@zaphod> References: <1082732223.1943.11.camel@zaphod> <20040423151458.GC6300@mail.shareable.org> <1082734938.1943.26.camel@zaphod> <20040423173738.A3812@infradead.org> <1082739174.1943.49.camel@zaphod> <20040423180130.A4255@infradead.org> <1082740707.1943.61.camel@zaphod> <20040423173719.GB7335@mail.shareable.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org Return-path: Received: from opus.cs.columbia.edu ([128.59.20.100]:11681 "EHLO opus.cs.columbia.edu") by vger.kernel.org with ESMTP id S262605AbUDWR7I (ORCPT ); Fri, 23 Apr 2004 13:59:08 -0400 To: Jamie Lokier In-Reply-To: <20040423173719.GB7335@mail.shareable.org> List-Id: linux-fsdevel.vger.kernel.org On Fri, 2004-04-23 at 18:37 +0100, Jamie Lokier wrote: > Shaya Potter wrote: > > > you can be in writepage with page->mapping->i_mmap{,shared} beeing empty. > > > No way in hell you'll ever get to a dentry. > > > > the question being in what cases will that happen, so I can make a > > determination if I care about those cases. (i.e. if the dentry is > > deleted, I don't particularly care, as since I am versioning, if it's > > already been deleted, don't care) > > > > i.e. how can I determine where i_mmap{,shared} exist and when does't it? > > (in file system page context). > > If you do mmap, then modify the pages, then munmap or exit, your > ->writpage function is sometimes called _after_ that. > > That means you can get no vmas in i_mmap{,shared} when doing > perfectly normal writable shared mappings. just realized an insanely ugly solution would be for all mapped files to map inode -> dentry (with code that makes sure they are still valid, i.e if dentry gets deleted or renamed). Since the page always has it's inode host, could figure it out via that. Since relatively few mapped files (compared to amount of files on fs) shouldn't be a huge memory overhead. don't think that's going to be my solution though :)