DEVELOPMENT


    As for previous patches, most interesting happens when reading in ext2_readpage() and when writing in ext2_writepage() and ext2_file_write(). In fact, in 2.2 kernel, compression occures on cluster of blocks. So when reading or writing a part of a file, we first have to compute the cluster on which I/O occures, then we have to get every buffers of the cluster, uncompress the data if needed, then reading/writing happens "as for normal files". In 2.4 kernels, I/O occures through page cache: i.e. when reading/writing to  part of the file, first the corresponding page is get, we then get the needed buffers, which point to the page; this means that for keeping same work as for 2.2, we have to use the notion of cluster of page. For getting every buffers of a cluster, we first get every pages of the cluster, then get buffers of every pages...

    So, things happens as follow :

  • Note : Another implentation could have been to keep generic_file_write(), and add an overhead to ext2_prepare_write() and ext2_commit_write(), on the first access to a page of a compressed cluster, whole cluster will be uncompressed (i.e. all pages of the cluster will be read and uncompressed in ext2_prepare_write) and when commiting the last page of the cluster, compression occures...


  •  Back to main

    Last modification :Mon Jun  3 14:18:33 MEST 2002

    maintainer