]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/buffer.c
mm: page_mkwrite change prototype to match fault
[linux-2.6-omap-h63xx.git] / fs / buffer.c
index a2fd743d97cb85380b5140e5d84ba9c50c383b84..6d51a3da362c9f110882374ceb22733113d24255 100644 (file)
@@ -621,14 +621,7 @@ static void __set_page_dirty(struct page *page,
        spin_lock_irq(&mapping->tree_lock);
        if (page->mapping) {    /* Race with truncate? */
                WARN_ON_ONCE(warn && !PageUptodate(page));
-
-               if (mapping_cap_account_dirty(mapping)) {
-                       __inc_zone_page_state(page, NR_FILE_DIRTY);
-                       __inc_bdi_stat(mapping->backing_dev_info,
-                                       BDI_RECLAIMABLE);
-                       task_dirty_inc(current);
-                       task_io_account_write(PAGE_CACHE_SIZE);
-               }
+               account_page_dirtied(page, mapping);
                radix_tree_tag_set(&mapping->page_tree,
                                page_index(page), PAGECACHE_TAG_DIRTY);
        }
@@ -2320,9 +2313,10 @@ int block_commit_write(struct page *page, unsigned from, unsigned to)
  * unlock the page.
  */
 int
-block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
+block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
                   get_block_t get_block)
 {
+       struct page *page = vmf->page;
        struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
        unsigned long end;
        loff_t size;
@@ -2347,6 +2341,9 @@ block_page_mkwrite(struct vm_area_struct *vma, struct page *page,
                ret = block_commit_write(page, 0, end);
 
 out_unlock:
+       if (ret)
+               ret = VM_FAULT_SIGBUS;
+
        unlock_page(page);
        return ret;
 }