提交 71c29bd5 编写于 作者: R Roland Dreier

IB/uverbs: Add devnode method to set path/mode

We want udev to create a device node under /dev/infiniband with
permission 0666 for uverbsX devices, so add a devnode method to set the
appropriate info.
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 257313b2
...@@ -824,6 +824,12 @@ static void ib_uverbs_remove_one(struct ib_device *device) ...@@ -824,6 +824,12 @@ static void ib_uverbs_remove_one(struct ib_device *device)
kfree(uverbs_dev); kfree(uverbs_dev);
} }
static char *uverbs_devnode(struct device *dev, mode_t *mode)
{
*mode = 0666;
return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
}
static int __init ib_uverbs_init(void) static int __init ib_uverbs_init(void)
{ {
int ret; int ret;
...@@ -842,6 +848,8 @@ static int __init ib_uverbs_init(void) ...@@ -842,6 +848,8 @@ static int __init ib_uverbs_init(void)
goto out_chrdev; goto out_chrdev;
} }
uverbs_class->devnode = uverbs_devnode;
ret = class_create_file(uverbs_class, &class_attr_abi_version.attr); ret = class_create_file(uverbs_class, &class_attr_abi_version.attr);
if (ret) { if (ret) {
printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n"); printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册