Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f6983ab authored by shengyong's avatar shengyong Committed by Richard Weinberger
Browse files

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: default avatarSheng Yong <shengyong1@huawei.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent f9a113d6
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -2573,7 +2573,7 @@ int dbg_leb_write(struct ubifs_info *c, int lnum, const void *buf,
{
{
	int err, failing;
	int err, failing;


	if (c->dbg->pc_happened)
	if (dbg_is_power_cut(c))
		return -EROFS;
		return -EROFS;


	failing = power_cut_emulated(c, lnum, 1);
	failing = power_cut_emulated(c, lnum, 1);
@@ -2595,7 +2595,7 @@ int dbg_leb_change(struct ubifs_info *c, int lnum, const void *buf,
{
{
	int err;
	int err;


	if (c->dbg->pc_happened)
	if (dbg_is_power_cut(c))
		return -EROFS;
		return -EROFS;
	if (power_cut_emulated(c, lnum, 1))
	if (power_cut_emulated(c, lnum, 1))
		return -EROFS;
		return -EROFS;
@@ -2611,7 +2611,7 @@ int dbg_leb_unmap(struct ubifs_info *c, int lnum)
{
{
	int err;
	int err;


	if (c->dbg->pc_happened)
	if (dbg_is_power_cut(c))
		return -EROFS;
		return -EROFS;
	if (power_cut_emulated(c, lnum, 0))
	if (power_cut_emulated(c, lnum, 0))
		return -EROFS;
		return -EROFS;
@@ -2627,7 +2627,7 @@ int dbg_leb_map(struct ubifs_info *c, int lnum)
{
{
	int err;
	int err;


	if (c->dbg->pc_happened)
	if (dbg_is_power_cut(c))
		return -EROFS;
		return -EROFS;
	if (power_cut_emulated(c, lnum, 0))
	if (power_cut_emulated(c, lnum, 0))
		return -EROFS;
		return -EROFS;