From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: which dentry a page belongs to Date: Fri, 23 Apr 2004 16:14:58 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040423151458.GC6300@mail.shareable.org> References: <1082732223.1943.11.camel@zaphod> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from mail.shareable.org ([81.29.64.88]:30630 "EHLO mail.shareable.org") by vger.kernel.org with ESMTP id S264844AbUDWPQ4 (ORCPT ); Fri, 23 Apr 2004 11:16:56 -0400 To: Shaya Potter Content-Disposition: inline In-Reply-To: <1082732223.1943.11.camel@zaphod> List-Id: linux-fsdevel.vger.kernel.org Shaya Potter wrote: > It would seem that since the > address_space object contains the vm_area_struct's of i_mmap and > i_mmap_shared I should then be able to get the appropriate file and > dentry object's through > > page->mapping->i_mmap->vm_file->f_dentry > > or > > page->mapping->i_mmap_shared->vm_file->f_dentry > > 1) Is this correct logic? I'm assuming the only things that matters in > choosing which list is used if the page is map'd shared or not? is that > correct as well? No, no and no. i_mmap and i_mmap_shared are lists. They can both be empty, or both non-empty. A page can be mapped shared *and* non-shared at the same time. A page might not be mapped at all. Also, a page is often mapped in a _subset_ of the mappings which are found in i_mmap and i_mmap_shared: it depends on its offset, and the vma offsets, and non-linear mapping offsets. It is possible to find multiple dentries which are currently being used to map a page. It's also possible to find no dentries at all. Your question is extremely ill-formed. What do you mean by "the dentry corresponding to a page"? What do you want the value for? -- Jamie