[patch 4/4] reiser4: capture superblock when syncing fs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

Signed-off-by: Edward Shishkin <edward.shishkin@xxxxxxxxx>
---
 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;

[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux