linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "XiongJia Le" <lexiongjia@gmail.com>
To: "TJ Easter" <tjeaster@gmail.com>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: How to filter the Block I/O in 2.6 kernel?
Date: Fri, 23 May 2008 09:20:21 +0800	[thread overview]
Message-ID: <6f4bf7350805221820p905e9b5n788ca42cab20cfaf@mail.gmail.com> (raw)
In-Reply-To: <1d4539510805220957s6954ac7as117cca02bb2077ca@mail.gmail.com>

Hi TJ,

I am working on a small tools what can dump all occupied sectors on
the hard disk.
But at dumping time some i/o is still occuring on the disk. So I want
to write a filter in kernel.
If some sector will change at dumping time, I will dump this sector
first and before this sector changed.

I think hook syscall is not enough for me. Because at System Call
layout I can not get the address of the sector what will changed.

Thanks,
Xiongjia Le


On Fri, May 23, 2008 at 12:57 AM, TJ Easter <tjeaster@gmail.com> wrote:
> XiongJia,
>      I am far from a kernel expert, but something you might consider would
> be to write a module that hooks the syscall(s) for I/O, replacing them with
> your own routines, and then passing the altered data along to the original
> syscall.  I am not sure that a module will allow you that deep of access
> into the I/O paths, but it might be your easiest option.    If I may ask,
> why would you want to alter data between the I/O scheduler and the actual
> disk store?   Seems somewhat counter-intuitive to me.
>
> Regards,
> TJ Easter
>
> On Tue, May 20, 2008 at 11:05 PM, XiongJia Le <lexiongjia@gmail.com> wrote:
>>
>> How to filter the Block I/O in 2.6 kernel?
>>
>> I have looked some in blktrace.
>> blktrace can trace the block device I/O info. But that can't
>> filter/change this I/O.
>>
>> Is the Linux kernel have any way to filter/change a block i/o before
>> it write to hard disk?
>> I don't want to change kernel code and re-build. Is Kernel already
>> have any I/O filter interface?
>>
>> Thanks,
>> Xiongjia Le
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel"
>> in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> "Being a humanist means trying to behave decently without expectation of
> rewards or punishment after you are dead."  -- Kurt Vonnegut, 1922 - 2007
> http://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x5EB6E92FE2340DEF

      parent reply	other threads:[~2008-05-23  1:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21  4:05 How to filter the Block I/O in 2.6 kernel? XiongJia Le
     [not found] ` <1d4539510805220957s6954ac7as117cca02bb2077ca@mail.gmail.com>
2008-05-23  1:20   ` XiongJia Le [this message]

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=6f4bf7350805221820p905e9b5n788ca42cab20cfaf@mail.gmail.com \
    --to=lexiongjia@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tjeaster@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;
as well as URLs for NNTP newsgroup(s).