* [PATCH] bsg: minor bug fixes
@ 2007-03-30 1:39 FUJITA Tomonori
2007-03-30 6:38 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: FUJITA Tomonori @ 2007-03-30 1:39 UTC (permalink / raw)
To: jens.axboe; +Cc: linux-scsi
This fixes the following minor issues:
- When bsg_register_queue is called with a request queue that doesn't
have request_fn, it returns -EINVAL instead of zero.
- add EXPORT_SYMBOL_GPL for bsg_register_queue and
bsg_unregister_queue.
- shut up gcc warnings
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
block/bsg.c | 6 ++++--
include/linux/bsg.h | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/block/bsg.c b/block/bsg.c
index 4ef3cc5..53bf6d4 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -961,8 +961,9 @@ void bsg_unregister_queue(struct request
bsg_device_nr--;
mutex_unlock(&bsg_mutex);
}
+EXPORT_SYMBOL_GPL(bsg_unregister_queue);
-int bsg_register_queue(struct request_queue *q, char *name)
+int bsg_register_queue(struct request_queue *q, const char *name)
{
struct bsg_class_device *bcd, *__bcd;
dev_t dev;
@@ -973,7 +974,7 @@ int bsg_register_queue(struct request_qu
* we need a proper transport to send commands, not a stacked device
*/
if (!q->request_fn)
- return 0;
+ return -EINVAL;
bcd = &q->bsg_dev;
memset(bcd, 0, sizeof(*bcd));
@@ -1025,6 +1026,7 @@ err:
mutex_unlock(&bsg_mutex);
return ret;
}
+EXPORT_SYMBOL_GPL(bsg_register_queue);
static int bsg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
{
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 0475a6d..0dd01f9 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -51,7 +51,7 @@ struct bsg_class_device {
struct request_queue *queue;
};
-extern int bsg_register_queue(struct request_queue *, char *);
+extern int bsg_register_queue(struct request_queue *, const char *);
extern void bsg_unregister_queue(struct request_queue *);
#else
struct bsg_class_device { };
--
1.4.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bsg: minor bug fixes
2007-03-30 1:39 [PATCH] bsg: minor bug fixes FUJITA Tomonori
@ 2007-03-30 6:38 ` Jens Axboe
2007-03-30 8:36 ` FUJITA Tomonori
0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2007-03-30 6:38 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: linux-scsi
On Fri, Mar 30 2007, FUJITA Tomonori wrote:
> This fixes the following minor issues:
>
> - When bsg_register_queue is called with a request queue that doesn't
> have request_fn, it returns -EINVAL instead of zero.
Seems a little backwards, you wont be able to talk to the device then.
So, what is the purpose of this patch?
> - add EXPORT_SYMBOL_GPL for bsg_register_queue and
> bsg_unregister_queue.
ok
> - shut up gcc warnings
ok
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bsg: minor bug fixes
2007-03-30 6:38 ` Jens Axboe
@ 2007-03-30 8:36 ` FUJITA Tomonori
2007-03-30 9:18 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: FUJITA Tomonori @ 2007-03-30 8:36 UTC (permalink / raw)
To: jens.axboe; +Cc: fujita.tomonori, linux-scsi
From: Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] bsg: minor bug fixes
Date: Fri, 30 Mar 2007 08:38:04 +0200
> On Fri, Mar 30 2007, FUJITA Tomonori wrote:
> > This fixes the following minor issues:
> >
> > - When bsg_register_queue is called with a request queue that doesn't
> > have request_fn, it returns -EINVAL instead of zero.
>
> Seems a little backwards, you wont be able to talk to the device then.
What do you mean? All the devices that we might bind to bsg has
request_fn?
> So, what is the purpose of this patch?
When I wrote a SMP pass through interface via bsg, I thought that it
would be better to return an error instead of success when we call
bsg_register_queue with a request queue that doesn't have a
request_fn.
Anyway, it doesn't matter much. Here is a new version.
---
>From db616d88a5e180a6be4928ba66947e501da581fa Mon Sep 17 00:00:00 2001
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date: Fri, 30 Mar 2007 17:24:35 +0900
Subject: [PATCH] bsg: minor bug fixes
This fixes the following minor issues:
- add EXPORT_SYMBOL_GPL for bsg_register_queue and
bsg_unregister_queue.
- shut up gcc warnings
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
block/bsg.c | 4 +++-
include/linux/bsg.h | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/block/bsg.c b/block/bsg.c
index 4ef3cc5..a333c93 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -961,8 +961,9 @@ void bsg_unregister_queue(struct request
bsg_device_nr--;
mutex_unlock(&bsg_mutex);
}
+EXPORT_SYMBOL_GPL(bsg_unregister_queue);
-int bsg_register_queue(struct request_queue *q, char *name)
+int bsg_register_queue(struct request_queue *q, const char *name)
{
struct bsg_class_device *bcd, *__bcd;
dev_t dev;
@@ -1025,6 +1026,7 @@ err:
mutex_unlock(&bsg_mutex);
return ret;
}
+EXPORT_SYMBOL_GPL(bsg_register_queue);
static int bsg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
{
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 0475a6d..0dd01f9 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -51,7 +51,7 @@ struct bsg_class_device {
struct request_queue *queue;
};
-extern int bsg_register_queue(struct request_queue *, char *);
+extern int bsg_register_queue(struct request_queue *, const char *);
extern void bsg_unregister_queue(struct request_queue *);
#else
struct bsg_class_device { };
--
1.4.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bsg: minor bug fixes
2007-03-30 8:36 ` FUJITA Tomonori
@ 2007-03-30 9:18 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2007-03-30 9:18 UTC (permalink / raw)
To: FUJITA Tomonori; +Cc: linux-scsi
On Fri, Mar 30 2007, FUJITA Tomonori wrote:
> From: Jens Axboe <jens.axboe@oracle.com>
> Subject: Re: [PATCH] bsg: minor bug fixes
> Date: Fri, 30 Mar 2007 08:38:04 +0200
>
> > On Fri, Mar 30 2007, FUJITA Tomonori wrote:
> > > This fixes the following minor issues:
> > >
> > > - When bsg_register_queue is called with a request queue that doesn't
> > > have request_fn, it returns -EINVAL instead of zero.
> >
> > Seems a little backwards, you wont be able to talk to the device then.
>
> What do you mean? All the devices that we might bind to bsg has
> request_fn?
They have to, how else would you send commands to it?
> > So, what is the purpose of this patch?
>
> When I wrote a SMP pass through interface via bsg, I thought that it
> would be better to return an error instead of success when we call
> bsg_register_queue with a request queue that doesn't have a
> request_fn.
>
>
> Anyway, it doesn't matter much. Here is a new version.
Aplied this one.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-03-30 9:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-30 1:39 [PATCH] bsg: minor bug fixes FUJITA Tomonori
2007-03-30 6:38 ` Jens Axboe
2007-03-30 8:36 ` FUJITA Tomonori
2007-03-30 9:18 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox