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 8C61AC2D0E3 for ; Thu, 17 Sep 2020 17:00:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3670F20838 for ; Thu, 17 Sep 2020 17:00:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vGDEFPJ7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728833AbgIQQ7u (ORCPT ); Thu, 17 Sep 2020 12:59:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728789AbgIQQ7r (ORCPT ); Thu, 17 Sep 2020 12:59:47 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E947EC06174A; Thu, 17 Sep 2020 09:59:46 -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=HSelo8V/K+50+NYuLpI9PLlnsmvIK7gx8VI0Sz6V4PU=; b=vGDEFPJ707ptXPX4+9i9781old xsNpeVCD4XZDVGcYjA+MbX7KhnFmO2+Yd5n3Vf0yEESEKcsLUbPxWwT15jA3buY1zl2MK6FfS0ROG DZUMm0K5g0YSc9P06hadFGy4ElAsekq4P3uCLR9redzUX1H6V5ppdPeHjga6HRevxK+UAaYumvD8o R5K7DdkgyGf6GvPxLtWtBVeQWFoLGRZBOJTo44ytDXTkLWYOsxYjrnPmoMNQVn2ULA+FN5FXWvO3M cN0C195atpvFDiNWRYEw+cffFy3bh6UD8Gmx+H0YzX1600akIqtqGsy5vnbcTdZL0KnAsu+TLFfRq x88nyRIw==; Received: from 089144214092.atnat0023.highway.a1.net ([89.144.214.92] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIxFq-0000Af-QF; Thu, 17 Sep 2020 16:59:31 +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 Date: Thu, 17 Sep 2020 18:57:06 +0200 Message-Id: <20200917165720.3285256-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-fsdevel@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. Diffstat: block/genhd.c | 11 ++-- 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 | 13 +---- 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, 119 insertions(+), 224 deletions(-)