Skip to contentSkip to conversation

reiser4: writeback_inodes implementation

PATCH In review Edward Shishkin 2 participants 2 messages Feb 2, 2010 – Feb 6, 2010 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 6/7 reiser4: writeback_inodes implementation

. add reiser4 implementation of ->writeback_inodes()
super operation;
. cleanup comments.

---
 fs/reiser4/context.c    |    3 +-
 fs/reiser4/context.h    |    2 -
 fs/reiser4/entd.c       |    7 ++++--
 fs/reiser4/page_cache.c |   12 +++++------
 fs/reiser4/super_ops.c  |   49 +++++++++++++++++++++++++++++-------------------
 fs/reiser4/txnmgr.c     |    2 -
 6 files changed, 45 insertions(+), 30 deletions(-)
fs/reiser4/context.c +2 -1
Index: linux-2.6.33-rc5-mm1/fs/reiser4/context.c
===================================================================
@@ -151,7 +151,8 @@ static void reiser4_throttle_write_at(re
 	 */
 	if (sbinfo != NULL && sbinfo->fake != NULL &&
 	    context->nr_marked_dirty != 0 &&
-	    !(current->flags & PF_MEMALLOC))
+	    !(current->flags & PF_MEMALLOC) &&
+	    !current_is_flush_bd_task())
 		/* FIXME-EDWARD: throttle with nr_marked_dirty? */
 		reiser4_throttle_write(sbinfo->fake, 1);
 }
fs/reiser4/context.h +1 -1
Index: linux-2.6.33-rc5-mm1/fs/reiser4/context.h
===================================================================
@@ -66,7 +66,7 @@ struct reiser4_context {
 	/* count non-trivial jnode_set_dirty() calls */
 	unsigned long nr_marked_dirty;
 
-	/* reiser4_sync_inodes calls (via generic_sync_sb_inodes)
+	/* reiser4_writeback_inodes calls (via generic_writeback_sb_inodes)
 	 * reiser4_writepages for each of dirty inodes. Reiser4_writepages
 	 * captures pages. When number of pages captured in one
 	 * reiser4_sync_inodes reaches some threshold - some atoms get
fs/reiser4/entd.c +5 -2
Index: linux-2.6.33-rc5-mm1/fs/reiser4/entd.c
===================================================================
@@ -236,16 +236,19 @@ static void entd_flush(struct super_bloc
 	rq->wbc->range_end = rq->wbc->range_start +
 		(ENTD_CAPTURE_APAGE_BURST << PAGE_CACHE_SHIFT);
 	tmp = rq->wbc->nr_to_write;
+
+	assert("edward-1561", super == rq->wbc->sb);
+
 	rq->mapping->a_ops->writepages(rq->mapping, rq->wbc);
 
 	if (rq->wbc->nr_to_write > 0) {
 		rq->wbc->range_start = 0;
 		rq->wbc->range_end = LLONG_MAX;
-		generic_sync_sb_inodes(rq->wbc);
+		writeback_inodes_wbc(rq->wbc);
 	}
 	rq->wbc->nr_to_write = ENTD_CAPTURE_APAGE_BURST;
-	reiser4_writeout(super, rq->wbc);
 
+	reiser4_writeout(super, rq->wbc);
 	context_set_commit_async(&ctx);
 	reiser4_exit_context(&ctx);
 }
fs/reiser4/page_cache.c +6 -6
Index: linux-2.6.33-rc5-mm1/fs/reiser4/page_cache.c
===================================================================
@@ -486,15 +486,15 @@ static int can_hit_entd(reiser4_context 
 int reiser4_writepage(struct page *page,
 		      struct writeback_control *wbc)
 {
-	struct super_block *s;
-	reiser4_context *ctx;
-
+	/*
+	 * assert("edward-1562",
+	 * can_hit_entd(get_current_context_check(), sb));
+	 */
 	assert("vs-828", PageLocked(page));
 
-	s = page->mapping->host->i_sb;
-	ctx = get_current_context_check();
+	wbc->sb = page->mapping->host->i_sb;
+	wbc->bdi = page->mapping->backing_dev_info;
 
-	/* assert("", can_hit_entd(ctx, s)); */
 	return write_page_by_ent(page, wbc);
 }
 
fs/reiser4/super_ops.c +30 -19

85 lines not on this page · raw message

fs/reiser4/txnmgr.c +1 -1
Index: linux-2.6.33-rc5-mm1/fs/reiser4/txnmgr.c
===================================================================
@@ -1410,7 +1410,7 @@ flush_some_atom(jnode * start, long *nr_
 		 * Write throttling is case of no one atom can be
 		 * flushed/committed.
 		 */
-		if (!wbc->nonblocking) {
+		if (!wbc->nonblocking && !current_is_flush_bd_task()) {
 			list_for_each_entry(atom, &tmgr->atoms_list, atom_link) {
 				spin_lock_atom(atom);
 				/* Repeat the check from the above. */

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

Hi Edward,

Quoted 14 lines · Edward Shishkin

. add reiser4 implementation of ->writeback_inodes()
super operation;
. cleanup comments.

---
 fs/reiser4/context.c    |    3 +-
 fs/reiser4/context.h    |    2 -
 fs/reiser4/entd.c       |    7 ++++--
 fs/reiser4/page_cache.c |   12 +++++------
 fs/reiser4/super_ops.c  |   49 +++++++++++++++++++++++++++++-------------------
 fs/reiser4/txnmgr.c     |    2 -
 6 files changed, 45 insertions(+), 30 deletions(-)

[...]

Quoted 6 lines

Index: linux-2.6.33-rc5-mm1/fs/reiser4/super_ops.c
===================================================================

fs/reiser4/super_ops.c +0 -0
@@ -379,48 +379,59 @@ static void reiser4_clear_inode(struct i

[...]

Quoted 10 lines
fs/reiser4/super_ops.c +5 -3
-static void reiser4_sync_inodes(struct super_block *super,
-			       struct writeback_control *wbc)
+static int reiser4_writeback_inodes(struct super_block *super,
+				    struct bdi_writeback *wb,
+				    struct writeback_control *wbc)
 {
-	reiser4_context *ctx;
+	int ret;
 	long to_write;
+	reiser4_context *ctx;

fs/reiser4/super_ops.c static void reiser4_clear_inode(struct i · line 405

Quoted 10 lines
fs/reiser4/super_ops.c +2 -3
 
 	if (wbc->for_kupdate)
 		/* reiser4 has its own means of periodical write-out */
-		return;
-
-	to_write = wbc->nr_to_write;
+		goto skip;
 	assert("vs-49", wbc->older_than_this == NULL);
 
+	spin_unlock(&inode_lock);

It seems that reiser4 can't be built as a module because of these access to inode_lock...

Kernel: arch/x86/boot/bzImage is ready (#13)
Building modules, stage 2.
MODPOST 188 modules
ERROR: "inode_lock" [fs/reiser4/reiser4.ko] undefined! make[1]: *** [__modpost] Erreur 1
make: *** [modules] Erreur 2

~~
laurent