From patchwork Wed Mar 27 13:51:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 10873509 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 588151390 for ; Wed, 27 Mar 2019 13:52:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4347128CFD for ; Wed, 27 Mar 2019 13:52:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4186528D99; Wed, 27 Mar 2019 13:52:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9EE328D92 for ; Wed, 27 Mar 2019 13:52:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729435AbfC0NwA (ORCPT ); Wed, 27 Mar 2019 09:52:00 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:38596 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbfC0Nv7 (ORCPT ); Wed, 27 Mar 2019 09:51:59 -0400 Received: from apollon.suse.de.de (prva10-snat226-2.provo.novell.com [137.65.226.36]) by smtp2.provo.novell.com with ESMTP (TLS encrypted); Wed, 27 Mar 2019 07:51:46 -0600 From: Martin Wilck To: Jens Axboe , Tejun Heo , Hannes Reinecke , "Martin K. Petersen" , Christoph Hellwig Cc: James Bottomley , Bart Van Assche , Martin Wilck , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org Subject: [PATCH v3 1/5] block: genhd: remove async_events field Date: Wed, 27 Mar 2019 14:51:01 +0100 Message-Id: <20190327135105.30893-2-mwilck@suse.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190327135105.30893-1-mwilck@suse.com> References: <20190327135105.30893-1-mwilck@suse.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The async_events field, intended to be used for drivers that support asynchronous notifications about disk events (aka media change events), isn't currently used by any driver, and apparently that has been that way for a long time (if not forever). Remove it. Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Martin Wilck --- block/genhd.c | 10 ++++------ drivers/block/pktcdvd.c | 1 - include/linux/genhd.h | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/block/genhd.c b/block/genhd.c index 7032678..ee76de0 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1628,12 +1628,11 @@ static unsigned long disk_events_poll_jiffies(struct gendisk *disk) /* * If device-specific poll interval is set, always use it. If - * the default is being used, poll iff there are events which - * can't be monitored asynchronously. + * the default is being used, poll if the POLL flag is set. */ if (ev->poll_msecs >= 0) intv_msecs = ev->poll_msecs; - else if (disk->events & ~disk->async_events) + else if (disk->events) intv_msecs = disk_events_dfl_poll_msecs; return msecs_to_jiffies(intv_msecs); @@ -1860,6 +1859,7 @@ static void disk_check_events(struct disk_events *ev, * * events : list of all supported events * events_async : list of events which can be detected w/o polling + * (always empty, only for backwards compatibility) * events_poll_msecs : polling interval, 0: disable, -1: system default */ static ssize_t __disk_events_show(unsigned int events, char *buf) @@ -1890,9 +1890,7 @@ static ssize_t disk_events_show(struct device *dev, static ssize_t disk_events_async_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct gendisk *disk = dev_to_disk(dev); - - return __disk_events_show(disk->async_events, buf); + return 0; } static ssize_t disk_events_poll_msecs_show(struct device *dev, diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index f5a7102..0240601 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c @@ -2761,7 +2761,6 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) /* inherit events of the host device */ disk->events = pd->bdev->bd_disk->events; - disk->async_events = pd->bdev->bd_disk->async_events; add_disk(disk); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 06c0fd59..5f78edb 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -185,7 +185,6 @@ struct gendisk { char *(*devnode)(struct gendisk *gd, umode_t *mode); unsigned int events; /* supported events */ - unsigned int async_events; /* async events, subset of all */ /* Array of pointers to partitions indexed by partno. * Protected with matching bdev lock but stat and other