lkml.org 
[lkml]   [2008]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to filter the Block I/O in 2.6 kernel?
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


\
 
 \ /
  Last update: 2008-05-23 03:23    [W:0.136 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site