From patchwork Thu Sep 17 16:57:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11783139 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67F79139A for ; Thu, 17 Sep 2020 17:28:26 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30988221EE for ; Thu, 17 Sep 2020 17:28:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30988221EE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=ocfs2-devel-bounces@oss.oracle.com Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08HHOact044287; Thu, 17 Sep 2020 17:28:10 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 33j91dvcpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 17 Sep 2020 17:28:10 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08HHOoG5132762; Thu, 17 Sep 2020 17:28:10 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3030.oracle.com with ESMTP id 33h8945uck-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Thu, 17 Sep 2020 17:28:09 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1kIxhY-00081O-Tg; Thu, 17 Sep 2020 10:28:08 -0700 Received: from userp3020.oracle.com ([156.151.31.79]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1kIxhW-00081A-Iw for ocfs2-devel@oss.oracle.com; Thu, 17 Sep 2020 10:28:06 -0700 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08HHPumV082837 for ; Thu, 17 Sep 2020 17:28:06 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by userp3020.oracle.com with ESMTP id 33hm3587qt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 Sep 2020 17:28:06 +0000 Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 08HHNDGm012697 for ; Thu, 17 Sep 2020 17:28:05 GMT Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by userp2040.oracle.com with ESMTP id 33gmxv6s1f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 17 Sep 2020 17:28:05 +0000 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 1kIxhM-0002QQ-Le; Thu, 17 Sep 2020 17:27:56 +0000 From: Christoph Hellwig To: Jens Axboe Date: Thu, 17 Sep 2020 18:57:19 +0200 Message-Id: <20200917165720.3285256-14-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200917165720.3285256-1-hch@lst.de> References: <20200917165720.3285256-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-PDR: PASS X-Source-IP: 90.155.50.34 X-ServerName: casper.infradead.org X-Proofpoint-SPF-Result: None X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 spamscore=0 clxscore=128 lowpriorityscore=0 priorityscore=0 adultscore=0 mlxscore=0 impostorscore=0 mlxlogscore=899 malwarescore=0 phishscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009170130 X-Spam: Clean Cc: linux-ide@vger.kernel.org, Len Brown , Jan Hoeppner , Minchan Kim , linux-s390@vger.kernel.org, linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Josef Bacik , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-block@vger.kernel.org, Stefan Haberland , Pavel Machek , linux-fsdevel@vger.kernel.org, nbd@other.debian.org, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 13/14] PM: mm: cleanup swsusp_swap_check X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009170130 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9747 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 mlxlogscore=999 clxscore=1034 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009170130 Use blkdev_get_by_dev instead of bdget + blkdev_get. Signed-off-by: Christoph Hellwig Acked-by: Rafael J. Wysocki Acked-by: Pavel Machek --- kernel/power/swap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 9d3ffbfe08dbf6..71385bedcc3a49 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -343,12 +343,10 @@ static int swsusp_swap_check(void) return res; root_swap = res; - hib_resume_bdev = bdget(swsusp_resume_device); - if (!hib_resume_bdev) - return -ENOMEM; - res = blkdev_get(hib_resume_bdev, FMODE_WRITE, NULL); - if (res) - return res; + hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, FMODE_WRITE, + NULL); + if (IS_ERR(hib_resume_bdev)) + return PTR_ERR(hib_resume_bdev); res = set_blocksize(hib_resume_bdev, PAGE_SIZE); if (res < 0)