summaryrefslogtreecommitdiff
blob: f4d5b52d3238405522b2300f00ad9f5621ff2474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- ./drivers/block/aoe/aoe.h.aoefix	2005-10-25 15:30:40.000000000 +0400
+++ ./drivers/block/aoe/aoe.h	2005-10-25 15:31:31.925074008 +0400
@@ -3,7 +3,13 @@
 #define AOE_MAJOR 152
 #define DEVICE_NAME "aoe"
 
-/* AOE_PARTITIONS is set in the Makefile */
+/* set AOE_PARTITIONS to 1 to use whole-disks only
+ * default is 16, which is 15 partitions plus the whole disk
+ */
+#ifndef AOE_PARTITIONS
+#define AOE_PARTITIONS (16)
+#endif
+
 
 #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * NPERSHELF + (aoeminor))
 #define AOEMAJOR(sysminor) ((sysminor) / NPERSHELF)
--- ./drivers/block/aoe/aoechr.c.aoefix	2005-10-25 15:30:40.000000000 +0400
+++ ./drivers/block/aoe/aoechr.c	2005-10-25 16:01:44.547513512 +0400
@@ -37,7 +37,6 @@ static int emsgs_head_idx, emsgs_tail_id
 static struct semaphore emsgs_sema;
 static spinlock_t emsgs_lock;
 static int nblocked_emsgs_readers;
-static struct class *aoe_class;
 static struct aoe_chardev chardevs[] = {
 	{ MINOR_ERR, "err" },
 	{ MINOR_DISCOVER, "discover" },
@@ -210,7 +209,7 @@ static struct file_operations aoe_fops =
 int __init
 aoechr_init(void)
 {
-	int n, i;
+	int n;
 
 	n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
 	if (n < 0) { 
@@ -219,27 +218,12 @@ aoechr_init(void)
 	}
 	sema_init(&emsgs_sema, 0);
 	spin_lock_init(&emsgs_lock);
-	aoe_class = class_create(THIS_MODULE, "aoe");
-	if (IS_ERR(aoe_class)) {
-		unregister_chrdev(AOE_MAJOR, "aoechr");
-		return PTR_ERR(aoe_class);
-	}
-	for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
-		class_device_create(aoe_class,
-					MKDEV(AOE_MAJOR, chardevs[i].minor),
-					NULL, chardevs[i].name);
-
 	return 0;
 }
 
 void
 aoechr_exit(void)
 {
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
-		class_device_destroy(aoe_class, MKDEV(AOE_MAJOR, chardevs[i].minor));
-	class_destroy(aoe_class);
 	unregister_chrdev(AOE_MAJOR, "aoechr");
 }