Linux 4.16 compat: get_disk_and_module()

As of https://github.com/torvalds/linux/commit/fb6d47a, get_disk()
is now get_disk_and_module(). Add a configure check to determine
if we need to use get_disk_and_module().

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #7264
This commit is contained in:
Giuseppe Di Natale
2018-03-05 12:44:35 -08:00
committed by Brian Behlendorf
parent 80d52c3919
commit dd3e1e3083
4 changed files with 29 additions and 1 deletions
+8
View File
@@ -139,6 +139,14 @@ blk_queue_set_read_ahead(struct request_queue *q, unsigned long ra_pages)
#endif
}
#ifndef HAVE_GET_DISK_AND_MODULE
static inline struct kobject *
get_disk_and_module(struct gendisk *disk)
{
return (get_disk(disk));
}
#endif
#ifndef HAVE_GET_DISK_RO
static inline int
get_disk_ro(struct gendisk *disk)