Skip to content

Commit

Permalink
block: genhd: remove async_events field
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Martin Wilck <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
mwilck authored and axboe committed Apr 12, 2019
1 parent 52d52d1 commit 673387a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
10 changes: 4 additions & 6 deletions block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 673387a

Please sign in to comment.