On Apr 7, 2005 3:40 AM, Martin Jambor <jamborm@xxxxxxxxx> wrote: > On Apr 6, 2005 3:49 AM, Kathy KN (HK) <kathy.kn@xxxxxxxxx> wrote: > > Seems like it is not going to be easy. I don't have much parameters > > required to be able to perform similarly to what generic_file_*[1] did, > > particularly count, ppos, etc. > > > > [1] i.e. > > 2201 ssize_t generic_file_write(struct file *file, const char __user *buf, > > 2202 size_t count, loff_t *ppos) > > I was not suggesting you call the method directly as it copies data to > userspace, I just wanted to show you code that may inspire you. The > function uses pos to find the appropriate page and writes data there. > > Anyway, if marking buffers dirty works for you, go for it. However, > what are you going to do if the part of the file you are intereste in > is not cached in memory yet? The marking buffers dirty and call bdflush work. I have not tried with larger files. I suspect that I might just encounter problems like you mentioned (i.e. what if part of the file is not cached in memory). Thanks for the inspiration tips. Kathy -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/