Re: [PATCH 1/6] md: switch to ->check_events for media change notifications

2020-07-08 Thread Matthew Wilcox
On Wed, Jul 08, 2020 at 03:17:31PM +0200, Guoqing Jiang wrote: > On 7/8/20 2:25 PM, Christoph Hellwig wrote: > > -static int md_media_changed(struct gendisk *disk) > > -{ > > - struct mddev *mddev = disk->private_data; > > - > > - return mddev->changed; > > -} > > Maybe we can remove "changed"

Re: [PATCH 1/6] md: switch to ->check_events for media change notifications

2020-07-08 Thread Guoqing Jiang
On 7/8/20 3:23 PM, Matthew Wilcox wrote: On Wed, Jul 08, 2020 at 03:17:31PM +0200, Guoqing Jiang wrote: On 7/8/20 2:25 PM, Christoph Hellwig wrote: -static int md_media_changed(struct gendisk *disk) -{ - struct mddev *mddev = disk->private_data; - - return mddev->changed; -} Maybe

Re: [PATCH 1/6] md: switch to ->check_events for media change notifications

2020-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2020 at 03:17:31PM +0200, Guoqing Jiang wrote: > On 7/8/20 2:25 PM, Christoph Hellwig wrote: >> -static int md_media_changed(struct gendisk *disk) >> -{ >> -struct mddev *mddev = disk->private_data; >> - >> -return mddev->changed; >> -} > > Maybe we can remove "changed" from

Re: [PATCH 1/6] md: switch to ->check_events for media change notifications

2020-07-08 Thread Guoqing Jiang
On 7/8/20 2:25 PM, Christoph Hellwig wrote: -static int md_media_changed(struct gendisk *disk) -{ - struct mddev *mddev = disk->private_data; - - return mddev->changed; -} Maybe we can remove "changed" from struct mddev since no one reads it after the change. Thanks, Guoqing

[PATCH 1/6] md: switch to ->check_events for media change notifications

2020-07-08 Thread Christoph Hellwig
md is the last driver using the legacy media_changed method. Switch it over to (not so) new ->clear_events approach, which also removes the need for the ->revalidate_disk method. Signed-off-by: Christoph Hellwig --- Documentation/filesystems/locking.rst | 4 +--- block/genhd.c