From: Johannes Buchner some changes from reiser4-2.6.31 patch from http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/ Index: linux/fs/reiser4/carry.c =================================================================== --- linux.orig/fs/reiser4/carry.c +++ linux/fs/reiser4/carry.c @@ -1095,7 +1095,7 @@ static void fatal_carry_error(carry_leve * * This function itself only manages changes in carry structures and delegates * all hard work (allocation of znode for new root, changes of parent and - * sibling pointers to the reiser4_add_tree_root(). + * sibling pointers) to the reiser4_add_tree_root(). * * Locking: old tree root is locked by carry at this point. Fake znode is also * locked. Index: linux/fs/reiser4/carry_ops.c =================================================================== --- linux.orig/fs/reiser4/carry_ops.c +++ linux/fs/reiser4/carry_ops.c @@ -2015,7 +2015,7 @@ static int carry_estimate_bitmaps(void) int bytes; bytes = capped_height() * (0 + /* bnode should be added, but - * its is private to bitmap.c, + * it is private to bitmap.c, * skip for now. */ 2 * sizeof(jnode)); /* working and commit jnodes */ Index: linux/fs/reiser4/coord.c =================================================================== --- linux.orig/fs/reiser4/coord.c +++ linux/fs/reiser4/coord.c @@ -36,12 +36,12 @@ void coord_normalize(coord_t *coord) coord_clear_iplug(coord); - if (node_is_empty(node)) + if (node_is_empty(node)) { coord_init_first_unit(coord, node); - else if ((coord->between == AFTER_ITEM) - || (coord->between == AFTER_UNIT)) + } else if ((coord->between == AFTER_ITEM) + || (coord->between == AFTER_UNIT)) { return; - else if (coord->item_pos == coord_num_items(coord) + } else if (coord->item_pos == coord_num_items(coord) && coord->between == BEFORE_ITEM) { coord_dec_item_pos(coord); coord->between = AFTER_ITEM; Index: linux/fs/reiser4/entd.c =================================================================== --- linux.orig/fs/reiser4/entd.c +++ linux/fs/reiser4/entd.c @@ -241,7 +241,7 @@ static void entd_flush(struct super_bloc if (rq->wbc->nr_to_write > 0) { rq->wbc->range_start = 0; rq->wbc->range_end = LLONG_MAX; - generic_sync_sb_inodes(rq->wbc); + generic_sync_sb_inodes(super, rq->wbc); } rq->wbc->nr_to_write = ENTD_CAPTURE_APAGE_BURST; reiser4_writeout(super, rq->wbc); Index: linux/fs/reiser4/super_ops.c =================================================================== --- linux.orig/fs/reiser4/super_ops.c +++ linux/fs/reiser4/super_ops.c @@ -412,7 +412,7 @@ static void reiser4_sync_inodes(struct s * call reiser4_writepages for each of dirty inodes to turn dirty pages * into transactions if they were not yet. */ - generic_sync_sb_inodes(wbc); + generic_sync_sb_inodes(super, wbc); /* flush goes here */ wbc->nr_to_write = to_write; Index: linux/fs/reiser4/znode.h =================================================================== --- linux.orig/fs/reiser4/znode.h +++ linux/fs/reiser4/znode.h @@ -18,7 +18,6 @@ #include #include -#include #include /* for PAGE_CACHE_SIZE */ #include Index: linux/include/linux/mm.h =================================================================== --- linux.orig/include/linux/mm.h +++ linux/include/linux/mm.h @@ -836,6 +836,7 @@ int redirty_page_for_writepage(struct wr void account_page_dirtied(struct page *page, struct address_space *mapping); int set_page_dirty(struct page *page); int set_page_dirty_lock(struct page *page); +int set_page_dirty_notag(struct page *page); int clear_page_dirty_for_io(struct page *page); extern unsigned long move_page_tables(struct vm_area_struct *vma, Index: linux/mm/filemap.c =================================================================== --- linux.orig/mm/filemap.c +++ linux/mm/filemap.c @@ -139,6 +139,7 @@ void __remove_from_page_cache(struct pag dec_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE); } } +EXPORT_SYMBOL(__remove_from_page_cache); void remove_from_page_cache(struct page *page) { @@ -151,6 +152,7 @@ void remove_from_page_cache(struct page spin_unlock_irq(&mapping->tree_lock); mem_cgroup_uncharge_cache_page(page); } +EXPORT_SYMBOL(remove_from_page_cache); static int sync_page(void *word) { @@ -800,7 +802,6 @@ repeat: rcu_read_unlock(); return ret; } -EXPORT_SYMBOL(find_get_pages); /** * find_get_pages_contig - gang contiguous pagecache lookup @@ -970,6 +971,7 @@ static void shrink_readahead_size_eio(st { ra->ra_pages /= 4; } +EXPORT_SYMBOL(find_get_pages); /** * do_generic_file_read - generic file read routine Index: linux/mm/page-writeback.c =================================================================== --- linux.orig/mm/page-writeback.c +++ linux/mm/page-writeback.c @@ -1143,6 +1143,32 @@ int __set_page_dirty_nobuffers(struct pa EXPORT_SYMBOL(__set_page_dirty_nobuffers); /* + * set_page_dirty_notag() -- similar to __set_page_dirty_nobuffers() + * except it doesn't tag the page dirty in the page-cache radix tree. + * This means that the address space using this cannot use the regular + * filemap ->writepages() helpers and must provide its own means of + * tracking and finding non-tagged dirty pages. + * + * NOTE: furthermore, this version also doesn't handle truncate races. + */ +int set_page_dirty_notag(struct page *page) +{ + struct address_space *mapping = page->mapping; + + if (!TestSetPageDirty(page)) { + unsigned long flags; + WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page)); + local_irq_save(flags); + account_page_dirtied(page, mapping); + local_irq_restore(flags); + __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + return 1; + } + return 0; +} +EXPORT_SYMBOL(set_page_dirty_notag); + +/* * When a writepage implementation decides that it doesn't want to write this * page for some reason, it should redirty the locked page via * redirty_page_for_writepage() and it should then unlock the page and return 0