Write calls
Hello,
Just want to confirm that the following are the only kernel functions that are called to write to files(VFS):
- do_sync_write
- vfs_write (calls do_sync_write)
- sys_write (calls vfs_write)
- sys_pwrite64 (calls vfs_write)
- vfs_writev
- sys_writev
- do_readv_writev
Basically, I want to find out the all kernel functions thru which every write call (not FS dependant) passes.
Disclaimer: I am newbie.
Thanks,
Siddhartha
Quoted 2 lines · Siddhartha Jain
Basically, I want to find out the all kernel functions thru which every write call (not FS dependant) passes.
mmap?
Signature · 1 line
dwmw2
Quoted 8 lines · Siddhartha Jain
Quoted 2 lines
Basically, I want to find out the all kernel functions thru which every write call (not FS dependant) passes.
mmap?
I am sorry. To put it differently, if I wanted to *snoop* on all bytes written to all/any files on the system, irrespective of the FS, what functions would I need to modify in the kernel? The objective is to be able to replicate directories.
Thanks,
Siddhartha
Quoted 1 line · Siddhartha Jain
The objective is to be able to replicate directories.
There was a thread on linux-kernel about this recently. Look for "COW files".
What you want to do is not trivial to do correctly. mmap() and hard links both make it complicated.
Fortunately there was lots of good design in that thread, and we figured out how to do it properly. It's just waiting for someone to implement it properly :)
Meanwhile, a patch is already available which handles simpler cases.
-- Jamie
Thanks for the pointers Jamie.
Can someone tell me how are the functions in fs/read_write.c (do_sync_write, vfs_write etc) related to functions like ioctl, mmap and aio_write.
In the layered structure, application -> vfs -> FS Layer -> Generic Block device layer, what call belongs where?
Thanks,
Siddhartha
Quoted 20 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]]On Behalf Of Jamie LokierQuoted 1 line · Siddhartha Jain
The objective is to be able to replicate directories.
There was a thread on linux-kernel about this recently. Look for "COW files".
What you want to do is not trivial to do correctly.
mmap()and hard links both make it complicated.Fortunately there was lots of good design in that thread, and we figured out how to do it properly. It's just waiting for someone to implement it properly :)
Meanwhile, a patch is already available which handles simpler cases.
-- Jamie