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
+1 -1
View File
@@ -1589,7 +1589,7 @@ zvol_probe(dev_t dev, int *part, void *arg)
struct kobject *kobj;
zv = zvol_find_by_dev(dev);
kobj = zv ? get_disk(zv->zv_disk) : NULL;
kobj = zv ? get_disk_and_module(zv->zv_disk) : NULL;
ASSERT(zv == NULL || MUTEX_HELD(&zv->zv_state_lock));
if (zv)
mutex_exit(&zv->zv_state_lock);