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

Commit 69f8a75a authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBIFS: remove an unneeded check



In 'ubifs_recover_size()' we have an "if (!e->inode && c->ro_mount)" statement.
But if 'c->ro_mount' is true, then '!e->inode' must always be true as well. So
we can remove the unnecessary '!e->inode' test and put an
'ubifs_assert(!e->inode)' instead.

This patch also removes an extra trailing white-space in a debugging print,
as well as adds few empty lines to 'ubifs_recover_size()' to make it a bit more
readable.

Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 4c954520
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1485,11 +1485,14 @@ int ubifs_recover_size(struct ubifs_info *c)
				e->i_size = le64_to_cpu(ino->size);
			}
		}

		if (e->exists && e->i_size < e->d_size) {
			if (!e->inode && c->ro_mount) {
			if (c->ro_mount) {
				/* Fix the inode size and pin it in memory */
				struct inode *inode;

				ubifs_assert(!e->inode);

				inode = ubifs_iget(c->vfs_sb, e->inum);
				if (IS_ERR(inode))
					return PTR_ERR(inode);
@@ -1513,9 +1516,11 @@ int ubifs_recover_size(struct ubifs_info *c)
					iput(e->inode);
			}
		}

		this = rb_next(this);
		rb_erase(&e->rb, &c->size_tree);
		kfree(e);
	}

	return 0;
}