writepage in inode_operations - never used?

Maciej Stachowiak (mstachow@mit.edu)
Fri, 21 Feb 1997 20:38:17 EST


I was expecting that the writepage member of inode_operations was used
to write out pages to disk, presumably after they had been written by
readpage. However, examination of existing code in 2.1.26 (find
/usr/src/linux -name *.[ch] -exec grep writepage "{}" \; -print)
reveals that no filesystem code implements it (it is always set to
NULL) and furthermore, that nothing in the kernel ever calls it. I
looked in fs/buffer.c and mm/filemap.c where I expected stuff would
get flushed to disk, and it seems this always happens with ll_rw_block
to flush buffers directly to the block device they come from, without
checking for or ever using writepage. Is this functionality that was
planned but never implemented? I have one additional question. My goal
in investigating this is that I would like to write a filesystem that
wants to do something other than the default when buffers it read get
flushed to disk. NFS clearly manages to achieve this somehow, despite
the lack of writepage, but how this happens was not clear to me from
the NFS and buffer cache/page cache code.

- Maciej Stachowiak