On Apr 5, 2005 6:59 PM, Martin Jambor <jamborm@xxxxxxxxx> wrote: > On Apr 5, 2005 10:04 AM, Kathy KN (HK) <kathy.kn@xxxxxxxxx> wrote: > > This may sound silly, but I am trying to find a way to commit these > > changes. Any idea how? I believe this is why the data is still located > > in the hard disk device somehow, afterall, I am modifying b_data that > > belongs to buffer_head. > > I suppose you're using a 2.6.x kernel. Things were different in 2.4 > and that's about all I know about them. > > I would suggest you forget about blocks and buffers and try to read > files using pages, just like the generic fs routines do. Have a look > at what generic_file_read and generic_file_write functions in > filemap.c do. Please note that for the sake of efficiency, the data > that are written to the file are kept in cache (i.e. memory) for some > time an only later on written to the disk (when kernel needs to free a > page or it's been dirty for too long). Therefore, i you really need to > be sure the data are on the disk, sync the file or the page or > something appropriate after you've done the changes. 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) Kathy -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/