From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 220D9C43466 for ; Mon, 21 Sep 2020 07:21:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5C6E207DE for ; Mon, 21 Sep 2020 07:21:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WlAvqo0P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726550AbgIUHUR (ORCPT ); Mon, 21 Sep 2020 03:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbgIUHUI (ORCPT ); Mon, 21 Sep 2020 03:20:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA5E8C0613D1; Mon, 21 Sep 2020 00:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=uiln3MtorCIt+OqTbXUWnLiMXWC8lUgm2hs2JozLc28=; b=WlAvqo0PcB605+Hw0QLRuD1pQx BdyYtsNFPR3wMN5n8f93MPj6oeQPqy60GRR7KR8bYAlYCuZAV8luCL8w+E8yqR9ni0BMRscRRY/iW BUZ16kWwXlC+tHFzJzi9sWaMYwaug6V8SIOW0b0kfNVKHHE181qPrix3SHrySoGyTgz1fO3D0O/W9 eeIwVaKs6zgWS3g2U3WN1SDQBNkp6w54ecHbNf+X36dRXVbSVKkTJOoOuUWusZDlmIpfwewvJnGpm EjjwNpfnPKmsjgRiOI+gFhBvsYdAesrUy9JAiGqPs0teXQE5Ceg8fqbMPBSPgzUQ8Sy1TQ1zYmQyy CsavluHw==; Received: from p4fdb0c34.dip0.t-ipconnect.de ([79.219.12.52] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKG73-0003Dm-IT; Mon, 21 Sep 2020 07:19:49 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Josef Bacik , Minchan Kim , Stefan Haberland , Jan Hoeppner , Joseph Qi , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , linux-kernel@vger.kernel.org, nbd@other.debian.org, linux-ide@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org Subject: remove blkdev_get as a public API v2 Date: Mon, 21 Sep 2020 09:19:44 +0200 Message-Id: <20200921071958.307589-1-hch@lst.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Hi Jens, this series removes blkdev_get as a public API, leaving it as just an implementation detail of blkdev_get_by_path and blkdev_get_by_dev. The reason for that is that blkdev_get is a very confusing API that requires a struct block_device to be fed in, but then actually consumes the reference. And it turns out just using the two above mentioned APIs actually significantly simplifies the code as well. Changes since v1: - fix a mismerged that left a stray bdget_disk around - factour the partition scan at registration time code into a new helper. Diffstat: block/genhd.c | 35 ++++++--------- block/ioctl.c | 13 ++--- drivers/block/nbd.c | 8 +-- drivers/block/pktcdvd.c | 92 +++++----------------------------------- drivers/block/zram/zram_drv.c | 7 +-- drivers/char/raw.c | 51 ++++++++-------------- drivers/ide/ide-gd.c | 2 drivers/s390/block/dasd_genhd.c | 15 +----- fs/block_dev.c | 12 ++--- fs/ocfs2/cluster/heartbeat.c | 28 ++++-------- include/linux/blk_types.h | 4 - include/linux/blkdev.h | 1 include/linux/genhd.h | 2 include/linux/suspend.h | 4 - include/linux/swap.h | 3 - kernel/power/swap.c | 21 +++------ kernel/power/user.c | 26 +++-------- mm/swapfile.c | 45 ++++++++++--------- 18 files changed, 130 insertions(+), 239 deletions(-) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Mon, 21 Sep 2020 09:19:44 +0200 Subject: [Ocfs2-devel] remove blkdev_get as a public API v2 Message-ID: <20200921071958.307589-1-hch@lst.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jens Axboe Cc: Josef Bacik , Minchan Kim , Stefan Haberland , Jan Hoeppner , Joseph Qi , "Rafael J. Wysocki" , Pavel Machek , Len Brown , Andrew Morton , linux-kernel@vger.kernel.org, nbd@other.debian.org, linux-ide@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-pm@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org Hi Jens, this series removes blkdev_get as a public API, leaving it as just an implementation detail of blkdev_get_by_path and blkdev_get_by_dev. The reason for that is that blkdev_get is a very confusing API that requires a struct block_device to be fed in, but then actually consumes the reference. And it turns out just using the two above mentioned APIs actually significantly simplifies the code as well. Changes since v1: - fix a mismerged that left a stray bdget_disk around - factour the partition scan at registration time code into a new helper. Diffstat: block/genhd.c | 35 ++++++--------- block/ioctl.c | 13 ++--- drivers/block/nbd.c | 8 +-- drivers/block/pktcdvd.c | 92 +++++----------------------------------- drivers/block/zram/zram_drv.c | 7 +-- drivers/char/raw.c | 51 ++++++++-------------- drivers/ide/ide-gd.c | 2 drivers/s390/block/dasd_genhd.c | 15 +----- fs/block_dev.c | 12 ++--- fs/ocfs2/cluster/heartbeat.c | 28 ++++-------- include/linux/blk_types.h | 4 - include/linux/blkdev.h | 1 include/linux/genhd.h | 2 include/linux/suspend.h | 4 - include/linux/swap.h | 3 - kernel/power/swap.c | 21 +++------ kernel/power/user.c | 26 +++-------- mm/swapfile.c | 45 ++++++++++--------- 18 files changed, 130 insertions(+), 239 deletions(-)