Commit b8ecc3cf authored by Edward Shishkin's avatar Edward Shishkin Committed by James Toy

Use the core library functions set_page_dirty_notag() and

__set_page_dirty_nobuffers() instead of intenal reiser4_set_page_dirty().

Signed-off-by: Edward Shishkin<edward.shishkin@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent fd59286c
...@@ -67,33 +67,12 @@ int reiser4_set_page_dirty(struct page *page) ...@@ -67,33 +67,12 @@ int reiser4_set_page_dirty(struct page *page)
assert("vs-1734", (page->mapping && assert("vs-1734", (page->mapping &&
page->mapping->host && page->mapping->host &&
reiser4_get_super_fake(page->mapping->host->i_sb) != reiser4_get_super_fake(page->mapping->host->i_sb) !=
page->mapping->host page->mapping->host &&
&& reiser4_get_cc_fake(page->mapping->host->i_sb) != reiser4_get_cc_fake(page->mapping->host->i_sb) !=
page->mapping->host page->mapping->host &&
&& reiser4_get_bitmap_fake(page->mapping->host->i_sb) != reiser4_get_bitmap_fake(page->mapping->host->i_sb) !=
page->mapping->host)); page->mapping->host));
return __set_page_dirty_nobuffers(page);
if (!TestSetPageDirty(page)) {
struct address_space *mapping = page->mapping;
if (mapping) {
spin_lock_irq(&mapping->tree_lock);
/* check for race with truncate */
if (page->mapping) {
assert("vs-1652", page->mapping == mapping);
if (mapping_cap_account_dirty(mapping))
inc_zone_page_state(page,
NR_FILE_DIRTY);
radix_tree_tag_set(&mapping->page_tree,
page->index,
PAGECACHE_TAG_REISER4_MOVED);
}
spin_unlock_irq(&mapping->tree_lock);
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
}
}
return 0;
} }
/* ->invalidatepage method for reiser4 */ /* ->invalidatepage method for reiser4 */
......
...@@ -277,7 +277,7 @@ int write_page_by_ent(struct page *page, struct writeback_control *wbc) ...@@ -277,7 +277,7 @@ int write_page_by_ent(struct page *page, struct writeback_control *wbc)
* page. Re-dirty page before unlocking so that if ent thread fails to * page. Re-dirty page before unlocking so that if ent thread fails to
* write it - it will remain dirty * write it - it will remain dirty
*/ */
reiser4_set_page_dirty_internal(page); set_page_dirty_notag(page);
/* /*
* pin inode in memory, unlock page, entd_flush will iput. We can not * pin inode in memory, unlock page, entd_flush will iput. We can not
......
...@@ -458,27 +458,6 @@ static struct bio *page_bio(struct page *page, jnode * node, int rw, gfp_t gfp) ...@@ -458,27 +458,6 @@ static struct bio *page_bio(struct page *page, jnode * node, int rw, gfp_t gfp)
return ERR_PTR(RETERR(-ENOMEM)); return ERR_PTR(RETERR(-ENOMEM));
} }
/* this function is internally called by jnode_make_dirty() */
int reiser4_set_page_dirty_internal(struct page *page)
{
struct address_space *mapping;
mapping = page->mapping;
BUG_ON(mapping == NULL);
if (!TestSetPageDirty(page)) {
if (mapping_cap_account_dirty(mapping))
inc_zone_page_state(page, NR_FILE_DIRTY);
__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
}
/* znode must be dirty ? */
if (mapping->host == reiser4_get_super_fake(mapping->host->i_sb))
assert("", JF_ISSET(jprivate(page), JNODE_DIRTY));
return 0;
}
#if 0 #if 0
static int can_hit_entd(reiser4_context *ctx, struct super_block *s) static int can_hit_entd(reiser4_context *ctx, struct super_block *s)
{ {
......
...@@ -18,8 +18,6 @@ extern void reiser4_done_formatted_fake(struct super_block *); ...@@ -18,8 +18,6 @@ extern void reiser4_done_formatted_fake(struct super_block *);
extern reiser4_tree *reiser4_tree_by_page(const struct page *); extern reiser4_tree *reiser4_tree_by_page(const struct page *);
extern int reiser4_set_page_dirty_internal(struct page *);
#define reiser4_submit_bio(rw, bio) submit_bio((rw), (bio)) #define reiser4_submit_bio(rw, bio) submit_bio((rw), (bio))
extern void reiser4_wait_page_writeback(struct page *); extern void reiser4_wait_page_writeback(struct page *);
......
...@@ -1260,7 +1260,7 @@ static void set_cluster_pages_dirty(struct cluster_handle * clust, ...@@ -1260,7 +1260,7 @@ static void set_cluster_pages_dirty(struct cluster_handle * clust,
assert("edward-968", pg != NULL); assert("edward-968", pg != NULL);
lock_page(pg); lock_page(pg);
assert("edward-1065", PageUptodate(pg)); assert("edward-1065", PageUptodate(pg));
reiser4_set_page_dirty_internal(pg); set_page_dirty_notag(pg);
unlock_page(pg); unlock_page(pg);
mark_page_accessed(pg); mark_page_accessed(pg);
} }
...@@ -2027,7 +2027,7 @@ static int write_hole(struct inode *inode, struct cluster_handle * clust, ...@@ -2027,7 +2027,7 @@ static int write_hole(struct inode *inode, struct cluster_handle * clust,
lock_page(page); lock_page(page);
zero_user(page, pg_off, to_pg); zero_user(page, pg_off, to_pg);
SetPageUptodate(page); SetPageUptodate(page);
reiser4_set_page_dirty_internal(page); set_page_dirty_notag(page);
mark_page_accessed(page); mark_page_accessed(page);
unlock_page(page); unlock_page(page);
...@@ -2747,7 +2747,7 @@ static loff_t do_write_cryptcompress(struct file *file, struct inode *inode, ...@@ -2747,7 +2747,7 @@ static loff_t do_write_cryptcompress(struct file *file, struct inode *inode,
goto err2; goto err2;
} }
SetPageUptodate(clust.pages[i]); SetPageUptodate(clust.pages[i]);
reiser4_set_page_dirty_internal(clust.pages[i]); set_page_dirty_notag(clust.pages[i]);
flush_dcache_page(clust.pages[i]); flush_dcache_page(clust.pages[i]);
mark_page_accessed(clust.pages[i]); mark_page_accessed(clust.pages[i]);
unlock_page(clust.pages[i]); unlock_page(clust.pages[i]);
......
...@@ -912,12 +912,9 @@ int write_end_unix_file(struct file *file, struct page *page, ...@@ -912,12 +912,9 @@ int write_end_unix_file(struct file *file, struct page *page,
* *
* As a result of (3) ->writepage may be called on a dirty page without * As a result of (3) ->writepage may be called on a dirty page without
* jnode. Such page is called "anonymous" in reiser4. Certain work-loads * jnode. Such page is called "anonymous" in reiser4. Certain work-loads
* (iozone) generate huge number of anonymous pages. Emergency flush handles * (iozone) generate huge number of anonymous pages.
* this situation by creating jnode for anonymous page, starting IO on the
* page, and marking jnode with JNODE_KEEPME bit so that it's not thrown out of
* memory. Such jnode is also called anonymous.
* *
* reiser4_sync_sb() method tries to insert anonymous pages and jnodes into * reiser4_sync_sb() method tries to insert anonymous pages into
* tree. This is done by capture_anonymous_*() functions below. * tree. This is done by capture_anonymous_*() functions below.
*/ */
...@@ -996,11 +993,6 @@ capture_anonymous_pages(struct address_space *mapping, pgoff_t *index, ...@@ -996,11 +993,6 @@ capture_anonymous_pages(struct address_space *mapping, pgoff_t *index,
*index = pvec.pages[i - 1]->index + 1; *index = pvec.pages[i - 1]->index + 1;
for (i = 0; i < pagevec_count(&pvec); i++) { for (i = 0; i < pagevec_count(&pvec); i++) {
/*
* tag PAGECACHE_TAG_REISER4_MOVED will be cleared by
* reiser4_set_page_dirty_internal which is called when jnode is
* captured
*/
result = capture_anonymous_page(pvec.pages[i]); result = capture_anonymous_page(pvec.pages[i]);
if (result == 1) if (result == 1)
nr++; nr++;
......
...@@ -1073,7 +1073,7 @@ ssize_t reiser4_write_extent(struct file *file, struct inode * inode, ...@@ -1073,7 +1073,7 @@ ssize_t reiser4_write_extent(struct file *file, struct inode * inode,
} }
flush_dcache_page(page); flush_dcache_page(page);
reiser4_set_page_dirty_internal(page); set_page_dirty_notag(page);
unlock_page(page); unlock_page(page);
nr_dirty++; nr_dirty++;
......
...@@ -2426,7 +2426,7 @@ void znode_make_dirty(znode * z) ...@@ -2426,7 +2426,7 @@ void znode_make_dirty(znode * z)
spin_unlock_jnode(node); spin_unlock_jnode(node);
/* reiser4 file write code calls set_page_dirty for /* reiser4 file write code calls set_page_dirty for
* unformatted nodes, for formatted nodes we do it here. */ * unformatted nodes, for formatted nodes we do it here. */
reiser4_set_page_dirty_internal(page); set_page_dirty_notag(page);
page_cache_release(page); page_cache_release(page);
/* bump version counter in znode */ /* bump version counter in znode */
z->version = znode_build_version(jnode_get_tree(node)); z->version = znode_build_version(jnode_get_tree(node));
......
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
This code guarantees that those blocks that are defined to be part of an This code guarantees that those blocks that are defined to be part of an
atom either all take effect or none of them take effect. atom either all take effect or none of them take effect.
Relocate set nodes are submitted to write by the jnode_flush() routine, and The "relocate set" of nodes are submitted to write by the jnode_flush()
the overwrite set is submitted by reiser4_write_log(). This is because with routine, and the "overwrite set" is submitted by reiser4_write_log().
the overwrite set we seek to optimize writes, and with the relocate set we This is because with the overwrite set we seek to optimize writes, and
seek to cause disk order to correlate with the parent first pre-order. with the relocate set we seek to cause disk order to correlate with the
"parent first order" (preorder).
reiser4_write_log() allocates and writes wandered blocks and maintains reiser4_write_log() allocates and writes wandered blocks and maintains
additional on-disk structures of the atom as wander records (each wander additional on-disk structures of the atom as wander records (each wander
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment