Re: How to locate struct file * from a bio?



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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [GIT PULL] block updates for 2.6.30
    ... add private bio_set for bio integrity allocations ... struct bsg_command *bc, struct request *rq) ... static int __init cciss_init ... extern void del_gendisk; ...
    (Linux-Kernel)
  • [GIT PULL] block/io bits for 2.6.30-rc2
    ... move bio list helpers into bio.h ... don't delay queue kick for a merged request ... that it collects up enough requests in the queue to be able to take ... struct rb_node rb_node; ...
    (Linux-Kernel)
  • Re: [PATCH][RFC] fast file mapping for loop
    ... Here is a modified version of Jens' patch. ... Change loop to use fast mapping only when the new address_space op is ... The extent_map struct passed in will be inserted into ... * Add bio to back of pending list and wakeup thread ...
    (Linux-Kernel)
  • Re: [PATCH] [Target_Core_Mod/pSCSI]: Add block/blk-map.c:blk_rq_map_kern_sg() usage
    ... limited to TYPE_DISK and TYPE_ROM that reference a struct block_device using the ConfigFS ... target mode with struct request it should be EXPORT_SYMBOL_GPL..? ... I have a pre-made bio, both from filesystem and a block device. ... an internally allocated array of scatterlists. ...
    (Linux-Kernel)
  • Re: [PATCH][RFC] fast file mapping for loop
    ... Change loop to use fast mapping only when the new address_space op is ... * Add bio to back of pending list and wakeup thread ... struct switch_request { ...
    (Linux-Kernel)