[PATCH 2/4] introduce sb_unlock_frozen()
From: Oleg Nesterov
Date: Mon Jul 13 2015 - 17:27:41 EST
Preaparation. Add the trivial helper which does the wakeup.
---
fs/super.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/fs/super.c b/fs/super.c
index 5ea0edd..c23bafc 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1254,6 +1254,12 @@ static void sb_wait_write(struct super_block *sb, int level)
} while (writers);
}
+static void sb_unlock_frozen(struct super_block *sb)
+{
+ smp_wmb();
+ wake_up(&sb->s_writers.wait_unfrozen);
+}
+
/**
* freeze_super - lock the filesystem and force it into a consistent state
* @sb: the super to lock
@@ -1340,8 +1346,7 @@ int freeze_super(struct super_block *sb)
printk(KERN_ERR
"VFS:Filesystem freeze failed\n");
sb->s_writers.frozen = SB_UNFROZEN;
- smp_wmb();
- wake_up(&sb->s_writers.wait_unfrozen);
+ sb_unlock_frozen(sb);
deactivate_locked_super(sb);
return ret;
}
@@ -1387,8 +1392,7 @@ int thaw_super(struct super_block *sb)
out:
sb->s_writers.frozen = SB_UNFROZEN;
- smp_wmb();
- wake_up(&sb->s_writers.wait_unfrozen);
+ sb_unlock_frozen(sb);
deactivate_locked_super(sb);
return 0;
--
1.5.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/