Re: [PATCH v3] block: genhd: don't call probe function with major_names_lock held

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 15, 2021 at 03:52:45PM +0900, Tetsuo Handa wrote:
> --- a/include/linux/genhd.h
> +++ b/include/linux/genhd.h
> @@ -303,9 +303,9 @@ struct gendisk *__blk_alloc_disk(int node);
>  void blk_cleanup_disk(struct gendisk *disk);
>  
>  int __register_blkdev(unsigned int major, const char *name,
> -		void (*probe)(dev_t devt));
> +		      void (*probe)(dev_t devt), struct module *owner);
>  #define register_blkdev(major, name) \
> -	__register_blkdev(major, name, NULL)
> +	__register_blkdev(major, name, NULL, NULL)
>  void unregister_blkdev(unsigned int major, const char *name);

Do not force modules to put their own THIS_MODULE macro as a parameter,
put it in the .h file so that it happens automagically, much like the
usb_register() define in include/linux/usb.h is created.

If you do that, you can probably get rid of the __register_blkdev()
direct calls as well...

thanks,

greg k-h



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux