Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2936436pxk; Mon, 21 Sep 2020 00:25:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsPTY/ZFInhhhO/KIvwAFm0NtHbQmcKbnTaMz2df4jG4nF/859j7lJ6JgIKt/+9s5M8zHH X-Received: by 2002:a50:e68a:: with SMTP id z10mr52847013edm.100.1600673118347; Mon, 21 Sep 2020 00:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600673118; cv=none; d=google.com; s=arc-20160816; b=cLQjmgcqVpz7a1Us++lDpLBiu/LHtuMM98C/BM3S0gEE0LCAL7VeFR/41Cl39FxGaK 5cofd3Bplvfa3lOhAW0gUDc0HZKg4j8SUIRHicxNt/rYc+7DT1n4NuYJNZ652sw2wKvE BLVBK7STiXqEXBHfWqzuZeW1A5QMIRLeB6UEBSjn8/+FAaAsPUMs1MYHuvUdrSjUmaYl G2P9dVJszm1y8/f7MdpWqcuBP7u/d/uaRuUZz0xv6Ek4qxG74Y85CW4W/L94IG2mGz+K M7MoT6iY2t12JYjL7MCV+JsYpeSh487YAyau+et4ZR8ukiunxcKKmuK9tM1I8ABgjOMF 1jeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kKrnsk0G0+/53OYcI1nKBJAYP0PP2drQYHczMU8H8l8=; b=Y+QeheT8LeVCyBYRMg+LqHVw6hGkliqgBWKs7crb9EmeH7enI+IfqRrGfr6T7SSb+Y B5b0Z3a/3xRu/WIDiSyL5jHpYk9A/BXXS05npwnThqZhGMV7lHPKXBm1MVZdr66duUss NxOke4LWIcUepmCPhSTOBdbpDTwq4JKWxpFcxprp02SZQa+WwFQHr73aV/KQIHlx1k5Y aBqlAA0FUAdwfInxp+qSmPrw5INp/WP0xpjntNlqTxZe3DKLIFryaqxS0VPDNXbz9nHA D5HfvuAcpVGaU/PUVP3RGQNVQtVn6LLJTFKfv4XttMIGfb9wlKMPe5BAE9KyJy25Lh4u AHIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=h1Wymipw; 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 ch14si7766911ejb.360.2020.09.21.00.24.55; Mon, 21 Sep 2020 00:25:18 -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=pass header.i=@infradead.org header.s=casper.20170209 header.b=h1Wymipw; 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 S1726734AbgIUHVP (ORCPT + 99 others); Mon, 21 Sep 2020 03:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726486AbgIUHUH (ORCPT ); Mon, 21 Sep 2020 03:20:07 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A3C5C0613CE; Mon, 21 Sep 2020 00:20:06 -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: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=kKrnsk0G0+/53OYcI1nKBJAYP0PP2drQYHczMU8H8l8=; b=h1WymipwzsfQg6HGoHFnSqm2lG lSXGTKndViTtD3Wqt+Prxiv9pPXKbXQhDojOLblOFVeTB6V5u0uTDKJccl4Yuj8auFwmoVkRVu8Ph OC4Ld6W8CSLSh8alUcRHew6l5j5n/oheWAmJxIkUZrGkDuwMeXX7eQvBUwlquYOi6qEXAmIBthDJO rxUP7OtZoBoTroj/4cKed9bAf5MrfY7nVCYa+Rzutl1yvPIkC83ZFIAFrBRPUAmEJoV6Fu4GmaHpe VHMSAXpnpQAkXRZxUjr+0vzqQmstuZnM2+5oSlYyMisXcqZC8c2nK5u9kpyXtAeJtWD6QgWv2dOwk Anv6OZNQ==; 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 1kKG7A-0003Ex-FW; Mon, 21 Sep 2020 07:19:56 +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: [PATCH 06/14] zram: cleanup backing_dev_store Date: Mon, 21 Sep 2020 09:19:50 +0200 Message-Id: <20200921071958.307589-7-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921071958.307589-1-hch@lst.de> References: <20200921071958.307589-1-hch@lst.de> 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-kernel@vger.kernel.org Use blkdev_get_by_dev instead of bdgrab + blkdev_get. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index a356275605b104..91ccfe444525b4 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -491,9 +491,10 @@ static ssize_t backing_dev_store(struct device *dev, goto out; } - bdev = bdgrab(I_BDEV(inode)); - err = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram); - if (err < 0) { + bdev = blkdev_get_by_dev(inode->i_rdev, + FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram); + if (IS_ERR(bdev)) { + err = PTR_ERR(bdev); bdev = NULL; goto out; } -- 2.28.0