Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4403341ybz; Mon, 20 Apr 2020 23:15:21 -0700 (PDT) X-Google-Smtp-Source: APiQypLJW+fqGU19hQGF7kSMrwR0TMNRQW0G8oME+h+/hhR6NEniqGkVfFNojB6nkXg93280ZTiB X-Received: by 2002:a17:906:edc2:: with SMTP id sb2mr17383280ejb.129.1587449721064; Mon, 20 Apr 2020 23:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587449721; cv=none; d=google.com; s=arc-20160816; b=0WLCB9Pi7gx9WsWvHeXosbLCgV7Atqg9oB6VmAcFKsvuDo/omZO5a3K/52A7hjWlZD n4dNi2R42/xNQym53DcjcoF1CZSMT1rPkP3OorZMKq8CzX3CkieUvWl/CNxlNT7zi4T1 RddCyVc34Q8YjJDxI03ChgYjC9Ko5Aws3b/274OsYk88TLrjtU2r4Q2pqfhKtBaR52Xw FAbACYvda5/sSzAjGjQzz4npi9szhUQS6HMg6+jxUdtua3qojxyRxBjN7c0qZ2dfZAiG 9uMg/n0QGWrw164TvaShYbdyI8whGI4FvnoFC/cv6rPzkAASFhFTr6w+f/ymhDMzUrsS XU3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Fs0wPMYxvGmO2IT3Wvj2CTBXvnvcNivwuYu4FRE1SCI=; b=BSsbAc8KVs4/1YKgJvCOLnbMv9OTjeT4RO3SrcvDPeVAsvjrDMEWNcXgX2HxT4i6lA EYoEJGWARvT6c/6Fct/Nr7fKYz2YKwrp+HmnlGASerULbU271TM3PQUIan46VMvYkum6 DDN2yxxL12QEceG/TkziELKselNCNVfBQuaNthDIHimMqHk7MzIN6e3A8FEE2dfvtG29 oxl4mOG0yPXXSTNv9bLRX7DFh06gbL7O0MSUu46/8rTe4Ix9ZLGw/XpcbZzVDjoqnI2W f8Y0Hca+r0LE/dfI67IQgkXtZDU4+KCX9OF3HTIL4Tb/osdm1JIW1H/qTk8DWwKS9iZm P36w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=bcdEPkBf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq12si941982ejb.472.2020.04.20.23.14.55; Mon, 20 Apr 2020 23:15:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=bcdEPkBf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727015AbgDUGMn (ORCPT + 99 others); Tue, 21 Apr 2020 02:12:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726628AbgDUGMm (ORCPT ); Tue, 21 Apr 2020 02:12:42 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 844C3C061A0F; Mon, 20 Apr 2020 23:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Fs0wPMYxvGmO2IT3Wvj2CTBXvnvcNivwuYu4FRE1SCI=; b=bcdEPkBfhKOPABDQ5Dsha37HM3 eiUij9xN/DG0iEUE2o4+ymVZLXy4WTHEZ93i2poYzXi35OEw0UaBNRCm3UsBgg7WNR3KoPmruhr/f Tt1f1l2KDEI5rtmjNRHaRnSEi8NEoX+foGuKXs/UKBrK4hLSFO5WKIx+MuLWRFDoBZl9/tom0LjvL cMc+fqi77vKCxaNuCR0ezJ69UZ4M47yK9VJWZ+NadNl/qN521hJSN1uCz91OFkf2D96u10vgrxuDg afXttZeFQSKeSpoFZG8emNnEtWtBBpYYGRPESwFvXeXzwCtxh0SUBj/5wVxPD7Kij8oDkhJIYT/m9 Ni0TgIVQ==; Received: from [2001:4bb8:191:e12c:292e:7dec:cf13:becd] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQm9B-0000MF-HQ; Tue, 21 Apr 2020 06:12:41 +0000 From: Christoph Hellwig To: Stefan Haberland , Jan Hoeppner , Jens Axboe , Heiko Carstens , Vasily Gorbik , Christian Borntraeger Cc: linux-s390@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] partitions/ibm: stop using ioctl_by_bdev Date: Tue, 21 Apr 2020 08:12:26 +0200 Message-Id: <20200421061226.33731-4-hch@lst.de> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200421061226.33731-1-hch@lst.de> References: <20200421061226.33731-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just call the getgeo and biodasdinfo methods directly. Signed-off-by: Christoph Hellwig --- block/partitions/ibm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/partitions/ibm.c b/block/partitions/ibm.c index 073faa6a69b8..21dc6da20ff2 100644 --- a/block/partitions/ibm.c +++ b/block/partitions/ibm.c @@ -289,6 +289,7 @@ static int find_cms1_partitions(struct parsed_partitions *state, int ibm_partition(struct parsed_partitions *state) { struct block_device *bdev = state->bdev; + struct gendisk *disk = bdev->bd_disk; int blocksize, res; loff_t i_size, offset, size; dasd_information2_t *info; @@ -308,15 +309,16 @@ int ibm_partition(struct parsed_partitions *state) info = kmalloc(sizeof(dasd_information2_t), GFP_KERNEL); if (info == NULL) goto out_exit; - geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL); + geo = kzalloc(sizeof(struct hd_geometry), GFP_KERNEL); if (geo == NULL) goto out_nogeo; label = kmalloc(sizeof(union label_t), GFP_KERNEL); if (label == NULL) goto out_nolab; - if (ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) + geo->start = get_start_sect(bdev); + if (!disk->fops->getgeo || disk->fops->getgeo(bdev, geo)) goto out_freeall; - if (ioctl_by_bdev(bdev, BIODASDINFO2, (unsigned long)info) != 0) { + if (!disk->fops->biodasdinfo || disk->fops->biodasdinfo(disk, info)) { kfree(info); info = NULL; } -- 2.26.1