diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-02 14:51:17 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-05-13 12:23:57 -0400 |
commit | 69f8a75a7d9db05a7ee708514d605ab74956c73e (patch) | |
tree | 13ed17ef36eb390a187feb34beafc2a266dda288 /fs/ubifs | |
parent | 4c9545200a3bd9e87b36475c263034a38be02e44 (diff) |
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: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/recovery.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ubifs/recovery.c b/fs/ubifs/recovery.c index 596dede32611..d6c8ce3c722e 100644 --- a/fs/ubifs/recovery.c +++ b/fs/ubifs/recovery.c | |||
@@ -1436,7 +1436,7 @@ static int fix_size_in_place(struct ubifs_info *c, struct size_entry *e) | |||
1436 | err = ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN); | 1436 | err = ubi_leb_change(c->ubi, lnum, c->sbuf, len, UBI_UNKNOWN); |
1437 | if (err) | 1437 | if (err) |
1438 | goto out; | 1438 | goto out; |
1439 | dbg_rcvry("inode %lu at %d:%d size %lld -> %lld ", | 1439 | dbg_rcvry("inode %lu at %d:%d size %lld -> %lld", |
1440 | (unsigned long)e->inum, lnum, offs, i_size, e->d_size); | 1440 | (unsigned long)e->inum, lnum, offs, i_size, e->d_size); |
1441 | return 0; | 1441 | return 0; |
1442 | 1442 | ||
@@ -1485,11 +1485,14 @@ int ubifs_recover_size(struct ubifs_info *c) | |||
1485 | e->i_size = le64_to_cpu(ino->size); | 1485 | e->i_size = le64_to_cpu(ino->size); |
1486 | } | 1486 | } |
1487 | } | 1487 | } |
1488 | |||
1488 | if (e->exists && e->i_size < e->d_size) { | 1489 | if (e->exists && e->i_size < e->d_size) { |
1489 | if (!e->inode && c->ro_mount) { | 1490 | if (c->ro_mount) { |
1490 | /* Fix the inode size and pin it in memory */ | 1491 | /* Fix the inode size and pin it in memory */ |
1491 | struct inode *inode; | 1492 | struct inode *inode; |
1492 | 1493 | ||
1494 | ubifs_assert(!e->inode); | ||
1495 | |||
1493 | inode = ubifs_iget(c->vfs_sb, e->inum); | 1496 | inode = ubifs_iget(c->vfs_sb, e->inum); |
1494 | if (IS_ERR(inode)) | 1497 | if (IS_ERR(inode)) |
1495 | return PTR_ERR(inode); | 1498 | return PTR_ERR(inode); |
@@ -1513,9 +1516,11 @@ int ubifs_recover_size(struct ubifs_info *c) | |||
1513 | iput(e->inode); | 1516 | iput(e->inode); |
1514 | } | 1517 | } |
1515 | } | 1518 | } |
1519 | |||
1516 | this = rb_next(this); | 1520 | this = rb_next(this); |
1517 | rb_erase(&e->rb, &c->size_tree); | 1521 | rb_erase(&e->rb, &c->size_tree); |
1518 | kfree(e); | 1522 | kfree(e); |
1519 | } | 1523 | } |
1524 | |||
1520 | return 0; | 1525 | return 0; |
1521 | } | 1526 | } |