From mboxrd@z Thu Jan 1 00:00:00 1970 From: "XiongJia Le" Subject: Re: How to filter the Block I/O in 2.6 kernel? Date: Fri, 23 May 2008 09:20:21 +0800 Message-ID: <6f4bf7350805221820p905e9b5n788ca42cab20cfaf@mail.gmail.com> References: <6f4bf7350805202105g2594d85dt1ae3b650e3e3671@mail.gmail.com> <1d4539510805220957s6954ac7as117cca02bb2077ca@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: "TJ Easter" , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Return-path: In-Reply-To: <1d4539510805220957s6954ac7as117cca02bb2077ca@mail.gmail.com> Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 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 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