From patchwork Wed Jan 6 07:23:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7965131 Return-Path: X-Original-To: patchwork-linux-nvdimm@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 EB7669F1CC for ; Wed, 6 Jan 2016 07:24:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29106201E4 for ; Wed, 6 Jan 2016 07:24:03 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4EC1F201EC for ; Wed, 6 Jan 2016 07:24:02 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 438261A1F1D; Tue, 5 Jan 2016 23:24:02 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ml01.01.org (Postfix) with ESMTP id 3EB321A2027 for ; Tue, 5 Jan 2016 23:24:01 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 05 Jan 2016 23:24:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,528,1444719600"; d="scan'208";a="24383498" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.136]) by fmsmga004.fm.intel.com with ESMTP; 05 Jan 2016 23:24:00 -0800 Subject: [PATCH 9/9] block: kill disk_{check|set|clear|alloc}_badblocks From: Dan Williams To: linux-nvdimm@lists.01.org Date: Tue, 05 Jan 2016 23:23:35 -0800 Message-ID: <20160106072334.40900.6497.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20160106072246.40900.8851.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20160106072246.40900.8851.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 Cc: linux-block@vger.kernel.org, x86@kernel.org X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 These actions are completely managed by a block driver or can use the badblocks api directly. Signed-off-by: Dan Williams --- block/genhd.c | 43 ------------------------------------------- include/linux/genhd.h | 5 ----- 2 files changed, 48 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 1118369ab2fd..eae2971a6d91 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -506,17 +506,6 @@ static int exact_lock(dev_t devt, void *data) return 0; } -int disk_alloc_badblocks(struct gendisk *disk) -{ - struct badblocks *bb = badblocks_alloc(); - - if (IS_ERR(bb)) - return PTR_ERR(bb); - disk->bb = bb; - return 0; -} -EXPORT_SYMBOL(disk_alloc_badblocks); - static void register_disk(struct gendisk *disk) { struct device *ddev = disk_to_dev(disk); @@ -696,38 +685,6 @@ void del_gendisk(struct gendisk *disk) } EXPORT_SYMBOL(del_gendisk); -/* - * The gendisk usage of badblocks does not track acknowledgements for - * badblocks. We always assume they are acknowledged. - */ -int disk_check_badblocks(struct gendisk *disk, sector_t s, int sectors, - sector_t *first_bad, int *bad_sectors) -{ - if (!disk->bb) - return 0; - - return badblocks_check(disk->bb, s, sectors, first_bad, bad_sectors); -} -EXPORT_SYMBOL(disk_check_badblocks); - -int disk_set_badblocks(struct gendisk *disk, sector_t s, int sectors) -{ - if (!disk->bb) - return 0; - - return badblocks_set(disk->bb, s, sectors, 1); -} -EXPORT_SYMBOL(disk_set_badblocks); - -int disk_clear_badblocks(struct gendisk *disk, sector_t s, int sectors) -{ - if (!disk->bb) - return 0; - - return badblocks_clear(disk->bb, s, sectors); -} -EXPORT_SYMBOL(disk_clear_badblocks); - /* sysfs access to bad-blocks list. */ static ssize_t disk_badblocks_show(struct device *dev, struct device_attribute *attr, diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 34dbcd90a8fd..38b4d5d32581 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -436,11 +436,6 @@ extern void del_gendisk(struct gendisk *gp); extern void del_gendisk_queue(struct gendisk *disk); extern struct gendisk *get_gendisk(dev_t dev, int *partno); extern struct block_device *bdget_disk(struct gendisk *disk, int partno); -int disk_alloc_badblocks(struct gendisk *disk); -extern int disk_check_badblocks(struct gendisk *disk, sector_t s, int sectors, - sector_t *first_bad, int *bad_sectors); -extern int disk_set_badblocks(struct gendisk *disk, sector_t s, int sectors); -extern int disk_clear_badblocks(struct gendisk *disk, sector_t s, int sectors); extern void set_device_ro(struct block_device *bdev, int flag); extern void set_disk_ro(struct gendisk *disk, int flag);