[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e0fb2d40ab7314049654d85b86a4c27e9a1801ef.1306780983.git.bengardiner@nanometrics.ca>
Date: Mon, 30 May 2011 14:56:15 -0400
From: Ben Gardiner <bengardiner@...ometrics.ca>
To: Artem Bityutskiy <dedekind1@...il.com>,
Adrian Hunter <adrian.hunter@...ia.com>
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
"Matthew L. Creech" <mlcreech@...il.com>
Subject: [PATCH 2/3] UBIFS: intialize the LPT earlier
The current mount_ubifs() implementation does not initialize the LPT until the
check for recovery is completed and the dirty flag is written.
Move the LPT initializtion to before the check for recovery and dirty flag in
preparation for the next patch which will move the free-space-fixup check to
directly after this allocation.
Signed-off-by: Ben Gardiner <bengardiner@...ometrics.ca>
---
fs/ubifs/super.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 6db0bdaa..89c8d33 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1281,13 +1281,17 @@ static int mount_ubifs(struct ubifs_info *c)
init_constants_master(c);
+ err = ubifs_lpt_init(c, 1, !c->ro_mount);
+ if (err)
+ goto out_lpt;
+
if ((c->mst_node->flags & cpu_to_le32(UBIFS_MST_DIRTY)) != 0) {
ubifs_msg("recovery needed");
c->need_recovery = 1;
if (!c->ro_mount) {
err = ubifs_recover_inl_heads(c, c->sbuf);
if (err)
- goto out_master;
+ goto out_lpt;
}
} else if (!c->ro_mount) {
/*
@@ -1297,13 +1301,9 @@ static int mount_ubifs(struct ubifs_info *c)
c->mst_node->flags |= cpu_to_le32(UBIFS_MST_DIRTY);
err = ubifs_write_master(c);
if (err)
- goto out_master;
+ goto out_lpt;
}
- err = ubifs_lpt_init(c, 1, !c->ro_mount);
- if (err)
- goto out_lpt;
-
err = dbg_check_idx_size(c, c->bi.old_idx_sz);
if (err)
goto out_lpt;
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists