aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoechr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/aoe/aoechr.c')
-rw-r--r--drivers/block/aoe/aoechr.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
index 1bc1cf9603f1..e22b4c9520a9 100644
--- a/drivers/block/aoe/aoechr.c
+++ b/drivers/block/aoe/aoechr.c
@@ -1,4 +1,4 @@
1/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */ 1/* Copyright (c) 2006 Coraid, Inc. See COPYING for GPL terms. */
2/* 2/*
3 * aoechr.c 3 * aoechr.c
4 * AoE character device driver 4 * AoE character device driver
@@ -15,7 +15,6 @@ enum {
15 MINOR_INTERFACES, 15 MINOR_INTERFACES,
16 MINOR_REVALIDATE, 16 MINOR_REVALIDATE,
17 MSGSZ = 2048, 17 MSGSZ = 2048,
18 NARGS = 10,
19 NMSG = 100, /* message backlog to retain */ 18 NMSG = 100, /* message backlog to retain */
20}; 19};
21 20
@@ -56,9 +55,8 @@ static int
56interfaces(const char __user *str, size_t size) 55interfaces(const char __user *str, size_t size)
57{ 56{
58 if (set_aoe_iflist(str, size)) { 57 if (set_aoe_iflist(str, size)) {
59 printk(KERN_CRIT 58 printk(KERN_ERR
60 "%s: could not set interface list: %s\n", 59 "aoe: could not set interface list: too many interfaces\n");
61 __FUNCTION__, "too many interfaces");
62 return -EINVAL; 60 return -EINVAL;
63 } 61 }
64 return 0; 62 return 0;
@@ -81,8 +79,7 @@ revalidate(const char __user *str, size_t size)
81 /* should be e%d.%d format */ 79 /* should be e%d.%d format */
82 n = sscanf(buf, "e%d.%d", &major, &minor); 80 n = sscanf(buf, "e%d.%d", &major, &minor);
83 if (n != 2) { 81 if (n != 2) {
84 printk(KERN_ERR "aoe: %s: invalid device specification\n", 82 printk(KERN_ERR "aoe: invalid device specification\n");
85 __FUNCTION__);
86 return -EINVAL; 83 return -EINVAL;
87 } 84 }
88 d = aoedev_by_aoeaddr(major, minor); 85 d = aoedev_by_aoeaddr(major, minor);
@@ -90,6 +87,7 @@ revalidate(const char __user *str, size_t size)
90 return -EINVAL; 87 return -EINVAL;
91 88
92 spin_lock_irqsave(&d->lock, flags); 89 spin_lock_irqsave(&d->lock, flags);
90 d->flags &= ~DEVFL_MAXBCNT;
93 d->flags |= DEVFL_PAUSE; 91 d->flags |= DEVFL_PAUSE;
94 spin_unlock_irqrestore(&d->lock, flags); 92 spin_unlock_irqrestore(&d->lock, flags);
95 aoecmd_cfg(major, minor); 93 aoecmd_cfg(major, minor);
@@ -116,7 +114,7 @@ bail: spin_unlock_irqrestore(&emsgs_lock, flags);
116 114
117 mp = kmalloc(n, GFP_ATOMIC); 115 mp = kmalloc(n, GFP_ATOMIC);
118 if (mp == NULL) { 116 if (mp == NULL) {
119 printk(KERN_CRIT "aoe: aoechr_error: allocation failure, len=%ld\n", n); 117 printk(KERN_ERR "aoe: allocation failure, len=%ld\n", n);
120 goto bail; 118 goto bail;
121 } 119 }
122 120
@@ -141,7 +139,7 @@ aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp
141 139
142 switch ((unsigned long) filp->private_data) { 140 switch ((unsigned long) filp->private_data) {
143 default: 141 default:
144 printk(KERN_INFO "aoe: aoechr_write: can't write to that file.\n"); 142 printk(KERN_INFO "aoe: can't write to that file.\n");
145 break; 143 break;
146 case MINOR_DISCOVER: 144 case MINOR_DISCOVER:
147 ret = discover(); 145 ret = discover();
@@ -250,7 +248,7 @@ aoechr_init(void)
250 248
251 n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops); 249 n = register_chrdev(AOE_MAJOR, "aoechr", &aoe_fops);
252 if (n < 0) { 250 if (n < 0) {
253 printk(KERN_ERR "aoe: aoechr_init: can't register char device\n"); 251 printk(KERN_ERR "aoe: can't register char device\n");
254 return n; 252 return n;
255 } 253 }
256 sema_init(&emsgs_sema, 0); 254 sema_init(&emsgs_sema, 0);