From patchwork Thu Sep 24 22:47:57 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 34240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DD198B7B69 for ; Fri, 25 Sep 2009 08:52:04 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Mqx69-0008QA-T0; Thu, 24 Sep 2009 22:47:37 +0000 Received: from iksaif.net ([88.191.73.63]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1Mqx64-0008PD-8B for linux-mtd@lists.infradead.org; Thu, 24 Sep 2009 22:47:36 +0000 Received: from localhost.localdomain (cxr69-11-88-180-139-205.fbx.proxad.net [88.180.139.205]) (Authenticated sender: corentincj@iksaif.net) by iksaif.net (Postfix) with ESMTPA id B9F01C9000E; Fri, 25 Sep 2009 00:48:44 +0200 (CEST) From: Corentin Chary To: dedekind1@gmail.com Subject: [PATCH] UBIFS: Add /dev/ubiX_Y naming scheme in open_ubi Date: Fri, 25 Sep 2009 00:47:57 +0200 Message-Id: <1253832477-29064-1-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.5.rc1 In-Reply-To: <71cd59b00909241541y645c40farac56a7eadb84c02b@mail.gmail.com> References: <71cd59b00909241541y645c40farac56a7eadb84c02b@mail.gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.5 (LGPL) ) MR-646709E3 X-CRM114-CacheID: sfid-20090924_184732_415686_C231C05F X-CRM114-Status: UNSURE ( 6.88 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- _SUMMARY_ Cc: Corentin Chary , util-linux-ng@vger.kernel.org, linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This is needed to use $ mount /dev/ubi0_0 /mnt/nand You'll also need a recent libblkid with UBI and UBIFS support. Signed-off-by: Corentin Chary --- fs/ubifs/super.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 7e2b3d4..38320ad 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -1843,10 +1843,11 @@ const struct super_operations ubifs_super_operations = { * @mode: UBI volume open mode * * There are several ways to specify UBI volumes when mounting UBIFS: - * o ubiX_Y - UBI device number X, volume Y; - * o ubiY - UBI device number 0, volume Y; - * o ubiX:NAME - mount UBI device X, volume with name NAME; - * o ubi:NAME - mount UBI device 0, volume with name NAME. + * o /dev/ubiX_Y - UBI device number X, volume Y; + * o ubiX_Y - UBI device number X, volume Y; + * o ubiY - UBI device number 0, volume Y; + * o ubiX:NAME - mount UBI device X, volume with name NAME; + * o ubi:NAME - mount UBI device 0, volume with name NAME. * * Alternative '!' separator may be used instead of ':' (because some shells * like busybox may interpret ':' as an NFS host name separator). This function @@ -1858,6 +1859,9 @@ static struct ubi_volume_desc *open_ubi(const char *name, int mode) int dev, vol; char *endptr; + if (!strncmp("/dev/", name, 5)) + name = name + 5; + if (name[0] != 'u' || name[1] != 'b' || name[2] != 'i') return ERR_PTR(-EINVAL);