Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp517256pxk; Wed, 2 Sep 2020 07:48:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/lsj/v2Pmu1qbyqLqJHkBV2rTsuDsX+f7VcQSJwEe8CTMNPA6T83MTQGYyVVX+tfx3BFJ X-Received: by 2002:a17:906:6415:: with SMTP id d21mr368182ejm.550.1599058081289; Wed, 02 Sep 2020 07:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599058081; cv=none; d=google.com; s=arc-20160816; b=z115nAzkM9St9QSEDqbydHyoEbSrxIKlqlolaIpgIbGgEZgMaeBcHTu1COmkzpc9St yA2APDA0YLxIMd79bneZK5Uj7RxhRu4uHHieeNfsOL1lRMYbfr9HPAvQXFetXTqhpmem cWZCBTapX9O9OM0O3FSd5ot8JdvDT7yaKVMvZQTUID4Mo1TUP6J2p4ydg6IDRIDQM2jo AUb8Wp0vYApes+z3pRAyHhl60g/FDB+bICZqQOYjUtP08wuQ4cbNgj78ouyO2NT1qiHk nzTAZ8M0T2XJI00wex6/zZ2UJgx5lA7Tf9/4YRXB8gIwDFRwf8f6QfwdvSR/dGEbFqFd 0NsQ== 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=/5SAWZk6icJ/MBm6T7B/yGzjpfvARn7uvD55NqOY+BE=; b=kSMF6df6FzCg1JPmfmXBicgkjm424Geyamtl+GuNy6ywJnxsMvdDyqG1A+Tff9jpeB m+hHG4/f9ankYrnch+37l/4iIPSytGNAoMdTkz1k7j/BJwyZuX0YgDocSblTuseH+Oj2 aUh4kfA8/zOggGR6+fYXrIjSHcvEAbldpChtOPym1uGmsUi00Y+h8HeMj5pSM345Us4G KiniRWYBPGE8bHd2DufrSObpBG5A3M19kbo7cffUtdLtAy0BVTG/ppqX9dWO2aGZ9DKV CfaI1GD2Mn5kFiWqAL/39qWefD5UhTj78errATPh5owmfSV9PIbILyP+AhMq+EttGUBY hrGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=EWDvdMIv; 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 z14si2694129eja.502.2020.09.02.07.47.37; Wed, 02 Sep 2020 07:48:01 -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=casper.20170209 header.b=EWDvdMIv; 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 S1728101AbgIBOqX (ORCPT + 99 others); Wed, 2 Sep 2020 10:46:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727972AbgIBONL (ORCPT ); Wed, 2 Sep 2020 10:13:11 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7343C061251; Wed, 2 Sep 2020 07:12:53 -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=/5SAWZk6icJ/MBm6T7B/yGzjpfvARn7uvD55NqOY+BE=; b=EWDvdMIvlQWYwV73Cx9dI0xu7i sWu2vGTiz7z10ZM+OfMHq7tF7ljG9yCO3BgQgp251yW7D6Jo7iM/6uv4WyMQGc6dKe985svnO6mlj yqykq1p+7ju22/KtWrLP/3AGX8cA9Fv2n0pVym7W7+uIuWxjz9eICjqdkJ+YCGTJBl/bZfTs9wpVC yuAWuJnKNHtwuErm9tMSuSi4jcO98Y92Ql0Ck+/nHfS3VrwrGN0Z3+Lmz6G4LrCbDl2jdEv/bfmmt vJ4QrEuk3yfDtfx3be/GtJ6gNOM2oesokgEE1uOYM7Y+Rcl7L6oVZ6k6SBnLqJlOPDHOMUgr6eQZB W/q/PVxA==; Received: from [2001:4bb8:184:af1:6a63:7fdb:a80e:3b0b] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDTUu-0005cr-4h; Wed, 02 Sep 2020 14:12:24 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Denis Efremov , Tim Waugh , Michal Simek , Borislav Petkov , "David S. Miller" , Song Liu , "Martin K. Petersen" , Finn Thain , Michael Schmitz , linux-m68k@lists.linux-m68k.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-raid@vger.kernel.org, linux-scsi@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 03/19] ataflop: use bdev_check_media_change Date: Wed, 2 Sep 2020 16:12:02 +0200 Message-Id: <20200902141218.212614-4-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200902141218.212614-1-hch@lst.de> References: <20200902141218.212614-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Switch to use bdev_check_media_change instead of check_disk_change and call floppy_revalidate manually. Given that floppy_revalidate only deals with media change events, the extra call into ->revalidate_disk from bdev_disk_changed is not required either, so stop wiring up the method. Signed-off-by: Christoph Hellwig --- drivers/block/ataflop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index a50e13af030526..3e881fdb06e0ad 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c @@ -1732,7 +1732,8 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, /* invalidate the buffer track to force a reread */ BufferDrive = -1; set_bit(drive, &fake_change); - check_disk_change(bdev); + if (bdev_check_media_change(bdev)) + floppy_revalidate(bdev->bd_disk); return 0; default: return -EINVAL; @@ -1909,7 +1910,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) return 0; if (mode & (FMODE_READ|FMODE_WRITE)) { - check_disk_change(bdev); + if (bdev_check_media_change(bdev)) + floppy_revalidate(bdev->bd_disk); if (mode & FMODE_WRITE) { if (p->wpstat) { if (p->ref < 0) @@ -1953,7 +1955,6 @@ static const struct block_device_operations floppy_fops = { .release = floppy_release, .ioctl = fd_ioctl, .check_events = floppy_check_events, - .revalidate_disk= floppy_revalidate, }; static const struct blk_mq_ops ataflop_mq_ops = { -- 2.28.0