On 1/7/06, prasad Musale <prasad.musale@xxxxxxxxx> wrote: > > Hello Friends, > I am doing work on stackable file system RAIF, which implements the RAID functionality at file system level. I got confused about where to put my stackable functions. E.g. for reading a file sys_read calls the vfs_read(), which in turn calls the lower level fs read() function(In most of the fs it's generic_file_read()). Generic_file_read() uses page cache & get page from disk .Now if I want to add my functionality(Stripping or mirroring), where should I add it? In generic_file_read() or before generic_file_read(that means capturing the pointer from vfs, adding our function & then calling generic_file_read.)? vfs interface allows you to change add your own functionality without changing the kernel code and recompile it i.e. without modifying generic_file_read lets say you wanna modify read operation .. then you have to write your own "file_op-_read" function when sys_read is called it'll call vfs_read which in turn will call your "file->file_op->read" if it was declared as in: if (file->f_op->read) 238 ret = file->f_op->read(file, buf, count, pos); 239 else 240 ret = do_sync_read(file, buf, count, pos); so you have to put your functionality in a function like read(file, buf, count, pos) and the same logic applies to all calls ... you can check all fs syscalls .. they all "at some point" check if you have declared your own function and will call it if it was hope it helps MHD.Tayseer -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/