aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs
diff options
context:
space:
mode:
authorshengyong <shengyong1@huawei.com>2015-09-23 05:11:39 -0400
committerRichard Weinberger <richard@nod.at>2015-10-03 14:40:21 -0400
commit8f6983abe31f37d953197c3ede14b1d1321affee (patch)
tree8842fa91979790d7688c88cfeb10b0d7fe7a53f4 /fs/ubifs
parentf9a113d65fa56d8e8e662e37ec2fbeac0d52aa01 (diff)
UBIFS: call dbg_is_power_cut() instead of reading c->dbg->pc_happened
Call dbg_is_power_cut() to emulate power cut instead of reading c->dbg->pc_happened. Otherwise, the function becomes dead code. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs')
-rw-r--r--fs/ubifs/debug.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 4c46a9865fa7..595ca0debe11 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2573,7 +2573,7 @@ int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf,
2573{ 2573{
2574 int err, failing; 2574 int err, failing;
2575 2575
2576 if (c->dbg->pc_happened) 2576 if (dbg_is_power_cut(c))
2577 return -EROFS; 2577 return -EROFS;
2578 2578
2579 failing = power_cut_emulated(c, lnum, 1); 2579 failing = power_cut_emulated(c, lnum, 1);
@@ -2595,7 +2595,7 @@ int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf,
2595{ 2595{
2596 int err; 2596 int err;
2597 2597
2598 if (c->dbg->pc_happened) 2598 if (dbg_is_power_cut(c))
2599 return -EROFS; 2599 return -EROFS;
2600 if (power_cut_emulated(c, lnum, 1)) 2600 if (power_cut_emulated(c, lnum, 1))
2601 return -EROFS; 2601 return -EROFS;
@@ -2611,7 +2611,7 @@ int dbg_leb_unmap(struct ubifs_info *c, int lnum)
2611{ 2611{
2612 int err; 2612 int err;
2613 2613
2614 if (c->dbg->pc_happened) 2614 if (dbg_is_power_cut(c))
2615 return -EROFS; 2615 return -EROFS;
2616 if (power_cut_emulated(c, lnum, 0)) 2616 if (power_cut_emulated(c, lnum, 0))
2617 return -EROFS; 2617 return -EROFS;
@@ -2627,7 +2627,7 @@ int dbg_leb_map(struct ubifs_info *c, int lnum)
2627{ 2627{
2628 int err; 2628 int err;
2629 2629
2630 if (c->dbg->pc_happened) 2630 if (dbg_is_power_cut(c))
2631 return -EROFS; 2631 return -EROFS;
2632 if (power_cut_emulated(c, lnum, 0)) 2632 if (power_cut_emulated(c, lnum, 0))
2633 return -EROFS; 2633 return -EROFS;