lkml.org 
[lkml]   [2007]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to locate struct file * from a bio?
Eddie Pettis wrote:
> Short question: Is it possible to locate the struct file * associated
> with a bio? If so, how?
>
> Longer version: I am working on a project that requires measuring the
> popularity of each file in a filesystem. I have made several attempts
> to locate all the file reads by grepping for ->readpage() and
> ->readpages() calls, but I am still missing several file reads. I
> have not yet looked for file writes.
>
> I *have* been able to catch every bio access, which leads to my
> question. Is it possible to locate the struct file * associated with
> a bio? If so, how? Efficiency is not my primary issue right now.
> I'm mainly concerned with it "just working."
Looks like you do this the wrong way.

Why don't you tap into "open" instead?
Here you can note who opens the file and if they open it for
reading or writing. If you really need the amount of data
transferred, consider trapping the read and write syscalls too.

Helge Hafting
-
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/

\
 
 \ /
  Last update: 2007-01-31 16:25    [W:0.047 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site