Commit ba833f14 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging: lustre: libcfs: use dynamic minors for /dev/{lnet, obd}

Request dynamic minor allocation when registering /dev/lnet and
/dev/obd.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-100086
Reviewed-on: https://review.whamcloud.com/29741Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarJian Yu <jian.yu@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Reviewed-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2acf8359
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/miscdevice.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/mm_inline.h> #include <linux/mm_inline.h>
#include <linux/module.h> #include <linux/module.h>
......
...@@ -119,16 +119,5 @@ struct lnet_fault_stat { ...@@ -119,16 +119,5 @@ struct lnet_fault_stat {
#define LNET_DEV_ID 0 #define LNET_DEV_ID 0
#define LNET_DEV_PATH "/dev/lnet" #define LNET_DEV_PATH "/dev/lnet"
#define LNET_DEV_MAJOR 10
#define LNET_DEV_MINOR 240
#define OBD_DEV_ID 1
#define OBD_DEV_NAME "obd"
#define OBD_DEV_PATH "/dev/" OBD_DEV_NAME
#define OBD_DEV_MAJOR 10
#define OBD_DEV_MINOR 241
#define SMFS_DEV_ID 2
#define SMFS_DEV_PATH "/dev/snapdev"
#define SMFS_DEV_MAJOR 10
#define SMFS_DEV_MINOR 242
#endif #endif
...@@ -51,8 +51,6 @@ enum md_echo_cmd { ...@@ -51,8 +51,6 @@ enum md_echo_cmd {
#define OBD_DEV_ID 1 #define OBD_DEV_ID 1
#define OBD_DEV_NAME "obd" #define OBD_DEV_NAME "obd"
#define OBD_DEV_PATH "/dev/" OBD_DEV_NAME #define OBD_DEV_PATH "/dev/" OBD_DEV_NAME
#define OBD_DEV_MAJOR 10
#define OBD_DEV_MINOR 241
#define OBD_IOCTL_VERSION 0x00010004 #define OBD_IOCTL_VERSION 0x00010004
#define OBD_DEV_BY_DEVNAME 0xffffd0de #define OBD_DEV_BY_DEVNAME 0xffffd0de
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/miscdevice.h>
# define DEBUG_SUBSYSTEM S_LNET # define DEBUG_SUBSYSTEM S_LNET
......
...@@ -33,10 +33,9 @@ ...@@ -33,10 +33,9 @@
#define DEBUG_SUBSYSTEM S_LNET #define DEBUG_SUBSYSTEM S_LNET
#include <linux/miscdevice.h>
#include <linux/libcfs/libcfs.h> #include <linux/libcfs/libcfs.h>
#define LNET_MINOR 240
static inline size_t libcfs_ioctl_packlen(struct libcfs_ioctl_data *data) static inline size_t libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
{ {
size_t len = sizeof(*data); size_t len = sizeof(*data);
...@@ -191,7 +190,7 @@ static const struct file_operations libcfs_fops = { ...@@ -191,7 +190,7 @@ static const struct file_operations libcfs_fops = {
}; };
struct miscdevice libcfs_dev = { struct miscdevice libcfs_dev = {
.minor = LNET_MINOR, .minor = MISC_DYNAMIC_MINOR,
.name = "lnet", .name = "lnet",
.fops = &libcfs_fops, .fops = &libcfs_fops,
}; };
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* This file is part of Lustre, http://www.lustre.org/ * This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc. * Lustre is a trademark of Sun Microsystems, Inc.
*/ */
#include <linux/miscdevice.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
......
...@@ -32,7 +32,9 @@ ...@@ -32,7 +32,9 @@
*/ */
#define DEBUG_SUBSYSTEM S_CLASS #define DEBUG_SUBSYSTEM S_CLASS
# include <linux/atomic.h>
#include <linux/atomic.h>
#include <linux/miscdevice.h>
#include <obd_support.h> #include <obd_support.h>
#include <obd_class.h> #include <obd_class.h>
...@@ -462,7 +464,7 @@ static int __init obdclass_init(void) ...@@ -462,7 +464,7 @@ static int __init obdclass_init(void)
err = misc_register(&obd_psdev); err = misc_register(&obd_psdev);
if (err) { if (err) {
CERROR("cannot register %d err %d\n", OBD_DEV_MINOR, err); CERROR("cannot register OBD miscdevices: err %d\n", err);
return err; return err;
} }
......
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/major.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/lp.h> #include <linux/lp.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -271,7 +270,7 @@ static const struct file_operations obd_psdev_fops = { ...@@ -271,7 +270,7 @@ static const struct file_operations obd_psdev_fops = {
/* modules setup */ /* modules setup */
struct miscdevice obd_psdev = { struct miscdevice obd_psdev = {
.minor = OBD_DEV_MINOR, .minor = MISC_DYNAMIC_MINOR,
.name = OBD_DEV_NAME, .name = OBD_DEV_NAME,
.fops = &obd_psdev_fops, .fops = &obd_psdev_fops,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment