mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helge Hafting <helge.hafting@aitel.hist.no>
To: Eddie Pettis <pettis.eddie@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to locate struct file * from a bio?
Date: Wed, 31 Jan 2007 16:18:27 +0100	[thread overview]
Message-ID: <45C0B343.1090301@aitel.hist.no> (raw)
In-Reply-To: <d66e87630701310634s385db5adwa82e2194188efa81@mail.gmail.com>

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

  parent reply	other threads:[~2007-01-31 15:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-31 14:34 Eddie Pettis
2007-01-31 14:44 ` Al Viro
2007-01-31 14:51   ` Al Viro
2007-01-31 15:18 ` Helge Hafting [this message]
2007-01-31 18:45   ` Jan Engelhardt
2007-01-31 18:55   ` Eddie Pettis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45C0B343.1090301@aitel.hist.no \
    --to=helge.hafting@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pettis.eddie@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®