clean up write_begin usage for directories in pagecache
[deliverable/linux.git] / fs / sysv / itree.c
index f2bcccd1d6fcf42fb9ac5db739eaf33d2ad43fc4..4068f485cfd6a04e319c964e7569618a5fd853a6 100644 (file)
@@ -453,23 +453,37 @@ static int sysv_writepage(struct page *page, struct writeback_control *wbc)
 {
        return block_write_full_page(page,get_block,wbc);
 }
+
 static int sysv_readpage(struct file *file, struct page *page)
 {
        return block_read_full_page(page,get_block);
 }
-static int sysv_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to)
+
+int sysv_prepare_chunk(struct page *page, loff_t pos, unsigned len)
 {
-       return block_prepare_write(page,from,to,get_block);
+       return block_write_begin_newtrunc(NULL, page->mapping, pos, len, 0,
+                                         &page, NULL, get_block);
 }
+
+static int sysv_write_begin(struct file *file, struct address_space *mapping,
+                       loff_t pos, unsigned len, unsigned flags,
+                       struct page **pagep, void **fsdata)
+{
+       *pagep = NULL;
+       return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
+                               get_block);
+}
+
 static sector_t sysv_bmap(struct address_space *mapping, sector_t block)
 {
        return generic_block_bmap(mapping,block,get_block);
 }
+
 const struct address_space_operations sysv_aops = {
        .readpage = sysv_readpage,
        .writepage = sysv_writepage,
        .sync_page = block_sync_page,
-       .prepare_write = sysv_prepare_write,
-       .commit_write = generic_commit_write,
+       .write_begin = sysv_write_begin,
+       .write_end = generic_write_end,
        .bmap = sysv_bmap
 };
This page took 0.024792 seconds and 5 git commands to generate.