#include <linux/kernel.h>
#include <linux/kmod.h>
#include <linux/kthread.h>
-#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/mm_inline.h>
#include <linux/module.h>
#define LNET_DEV_ID 0
#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
#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 OBD_IOCTL_VERSION 0x00010004
#define OBD_DEV_BY_DEVNAME 0xffffd0de
#include <linux/completion.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
-#include <linux/miscdevice.h>
# define DEBUG_SUBSYSTEM S_LNET
#define DEBUG_SUBSYSTEM S_LNET
+#include <linux/miscdevice.h>
#include <linux/libcfs/libcfs.h>
-#define LNET_MINOR 240
-
static inline size_t libcfs_ioctl_packlen(struct libcfs_ioctl_data *data)
{
size_t len = sizeof(*data);
};
struct miscdevice libcfs_dev = {
- .minor = LNET_MINOR,
+ .minor = MISC_DYNAMIC_MINOR,
.name = "lnet",
.fops = &libcfs_fops,
};
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*/
+#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
*/
#define DEBUG_SUBSYSTEM S_CLASS
-# include <linux/atomic.h>
+
+#include <linux/atomic.h>
+#include <linux/miscdevice.h>
#include <obd_support.h>
#include <obd_class.h>
err = misc_register(&obd_psdev);
if (err) {
- CERROR("cannot register %d err %d\n", OBD_DEV_MINOR, err);
+ CERROR("cannot register OBD miscdevices: err %d\n", err);
return err;
}
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
-#include <linux/major.h>
#include <linux/sched.h>
#include <linux/lp.h>
#include <linux/slab.h>
/* modules setup */
struct miscdevice obd_psdev = {
- .minor = OBD_DEV_MINOR,
+ .minor = MISC_DYNAMIC_MINOR,
.name = OBD_DEV_NAME,
.fops = &obd_psdev_fops,
};