Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757796Ab1E3S4Z (ORCPT ); Mon, 30 May 2011 14:56:25 -0400 Received: from na3sys009aog113.obsmtp.com ([74.125.149.209]:38182 "EHLO na3sys009aog113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753174Ab1E3S4W (ORCPT ); Mon, 30 May 2011 14:56:22 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=nanometrics.ca; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=QihhUj0eDIrZupfqm5nPk7QE23HbVqXkKisqyycXue5bLReSGXaSQlWeftBLWq4vgs 7IIXB9+KvdPLrhUxsKO6zAiFVUPmodn0I5cwfI6d4Vjo+KptP565sR6E1FIMBShfOJSU 4qqbm1V+Xox+9IuD4wlLtYgnKrKdLUIyZeObA= From: Ben Gardiner To: Artem Bityutskiy , Adrian Hunter Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, "Matthew L. Creech" Subject: [PATCH 2/3] UBIFS: intialize the LPT earlier Date: Mon, 30 May 2011 14:56:15 -0400 Message-Id: X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1692 Lines: 59 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 --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/