From patchwork Tue Jul 21 08:37:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Dongsheng X-Patchwork-Id: 6833241 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6B5DE9F380 for ; Tue, 21 Jul 2015 08:43:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F60F20690 for ; Tue, 21 Jul 2015 08:43:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 99EB620678 for ; Tue, 21 Jul 2015 08:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754170AbbGUInq (ORCPT ); Tue, 21 Jul 2015 04:43:46 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:46681 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753622AbbGUIng (ORCPT ); Tue, 21 Jul 2015 04:43:36 -0400 X-IronPort-AV: E=Sophos;i="5.13,665,1427731200"; d="scan'208";a="98671192" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 21 Jul 2015 16:47:11 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t6L8ffvb004990; Tue, 21 Jul 2015 16:41:41 +0800 Received: from yds-PC.g08.fujitsu.local (10.167.226.66) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 21 Jul 2015 16:43:28 +0800 From: Dongsheng Yang To: , , CC: , , Dongsheng Yang Subject: [PATCH 02/25] ubi: introduce a interface to get cdev in ubi_volume Date: Tue, 21 Jul 2015 16:37:33 +0800 Message-ID: <1437467876-22106-3-git-send-email-yangds.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1437467876-22106-1-git-send-email-yangds.fnst@cn.fujitsu.com> References: <1437467876-22106-1-git-send-email-yangds.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.66] Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We want to fill the sb->s_cdev in ubifs_fill_super(), so, we need to add a interface in ubi to get the cdev of an ubi_volume. Signed-off-by: Dongsheng Yang --- drivers/mtd/ubi/kapi.c | 6 ++++++ include/linux/mtd/ubi.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index e844887..d3d1982 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -862,3 +862,9 @@ int ubi_unregister_volume_notifier(struct notifier_block *nb) return blocking_notifier_chain_unregister(&ubi_notifiers, nb); } EXPORT_SYMBOL_GPL(ubi_unregister_volume_notifier); + +inline struct cdev *ubi_get_volume_cdev(struct ubi_volume_desc *desc) +{ + return &(desc->vol->cdev); +} +EXPORT_SYMBOL_GPL(ubi_get_volume_cdev); diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 1e271cb..301c6e9 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h @@ -261,6 +261,7 @@ int ubi_leb_map(struct ubi_volume_desc *desc, int lnum); int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); int ubi_sync(int ubi_num); int ubi_flush(int ubi_num, int vol_id, int lnum); +struct cdev *ubi_get_volume_cdev(struct ubi_volume_desc *desc); /* * This function is the same as the 'ubi_leb_read()' function, but it does not