Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933315AbXAaOv5 (ORCPT ); Wed, 31 Jan 2007 09:51:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933318AbXAaOv4 (ORCPT ); Wed, 31 Jan 2007 09:51:56 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:32999 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933315AbXAaOvz (ORCPT ); Wed, 31 Jan 2007 09:51:55 -0500 Date: Wed, 31 Jan 2007 14:51:54 +0000 From: Al Viro To: Eddie Pettis Cc: linux-kernel@vger.kernel.org Subject: Re: How to locate struct file * from a bio? Message-ID: <20070131145154.GA19815@ftp.linux.org.uk> References: <20070131144423.GB10050@ftp.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070131144423.GB10050@ftp.linux.org.uk> User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1149 Lines: 21 On Wed, Jan 31, 2007 at 02:44:23PM +0000, Al Viro wrote: > On Wed, Jan 31, 2007 at 09:34:54AM -0500, Eddie Pettis wrote: > > Short question: Is it possible to locate the struct file * associated > > with a bio? If so, how? > > Obviously impossible. For one thing, there might very well be no inode, > let alone struct file, associated with bio in question (e.g. for any > filesystem metadata). Moreover, the same on-disk object may get IO > without any stuct file at all (e.g. a directory) or with many struct > file (e.g. any file independently opened by several processes; no matter > how many of them do reads, we'll get stuff pulled into page cache the > same way (and once, not once per struct file). BTW, here's a good testcase for you: /etc/ld.so.cache; it's accessed at practically any execve(), so it should be very close to top of the popularity list (right there with /lib/libc.so.6)... - 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/