reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Shishkin <edward.shishkin@gmail.com>
To: reiserfs-devel@vger.kernel.org
Subject: [patch 4/4] reiser4: capture superblock when syncing fs
Date: Sun, 21 Oct 2012 19:59:38 +0200	[thread overview]
Message-ID: <5084380A.9070502@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: reiser4-capture-superblock-when-syncing-fs.patch --]
[-- Type: text/x-patch, Size: 2394 bytes --]

. Capture super block when syncing fs to synchronize
  the superblock with the other stuff;
. Make gcc happy.

Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
---
 fs/reiser4/carry_ops.c |    4 ++--
 fs/reiser4/super_ops.c |   13 ++++++++++++-
 fs/reiser4/tree.h      |    2 +-
 3 files changed, 15 insertions(+), 4 deletions(-)

--- linux-3.6.2_.orig/fs/reiser4/super_ops.c
+++ linux-3.6.2_/fs/reiser4/super_ops.c
@@ -397,6 +397,7 @@ static long reiser4_writeback_inodes(str
 /* ->sync_fs() of super operations */
 static int reiser4_sync_fs(struct super_block *super, int wait)
 {
+	int ret;
 	reiser4_context *ctx;
 	struct bdi_writeback *wb;
 	struct wb_writeback_work work = {
@@ -417,13 +418,23 @@ static int reiser4_sync_fs(struct super_
 		warning("edward-1567", "failed to init context");
 		return PTR_ERR(ctx);
 	}
+	/*
+	 * Capture znode associated with super block
+	 */
+	ret = reiser4_capture_super_block(super);
+	if (ret != 0)
+		warning("vs-1701",
+			"reiser4_capture_super_block failed in write_super: %d",
+			ret);
+
 	wb = &reiser4_get_super_fake(super)->i_mapping->backing_dev_info->wb;
 	spin_lock(&wb->list_lock);
 	generic_writeback_sb_inodes(super, wb, &wbc, &work, true);
 	spin_unlock(&wb->list_lock);
 	wbc.nr_to_write = LONG_MAX;
 	/*
-	 * flush goes here
+	 * (flush goes here)
+	 * commit all transactions
 	 */
 	reiser4_writeout(super, &wbc);
 
--- linux-3.6.2_.orig/fs/reiser4/carry_ops.c
+++ linux-3.6.2_/fs/reiser4/carry_ops.c
@@ -1339,7 +1339,7 @@ static int carry_delete(carry_op * op /*
 	    node_num_items(parent) == 1)
 		result = reiser4_kill_tree_root(coord.node);
 
-	return result < 0 ? : 0;
+	return result < 0 ? result : 0;
 }
 
 /* implements COP_CUT opration
@@ -1369,7 +1369,7 @@ static int carry_cut(carry_op * op /* op
 		result = nplug->cut_and_kill(op->u.cut_or_kill.u.kill, &info);
 
 	doing->restartable = 0;
-	return result < 0 ? : 0;
+	return result < 0 ? result : 0;
 }
 
 /* helper function for carry_paste(): returns true if @op can be continued as
--- linux-3.6.2_.orig/fs/reiser4/tree.h
+++ linux-3.6.2_/fs/reiser4/tree.h
@@ -405,7 +405,7 @@ typedef struct cbk_handle {
 	/* put here error message to be printed by caller */
 	const char *error;
 	/* result passed back to caller */
-	lookup_result result;
+	int result;
 	/* lock handles for active and parent */
 	lock_handle *parent_lh;
 	lock_handle *active_lh;

                 reply	other threads:[~2012-10-21 17:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5084380A.9070502@gmail.com \
    --to=edward.shishkin@gmail.com \
    --cc=reiserfs-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).