linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* export bsg.h header to user-mode
@ 2009-01-14 16:24 Boaz Harrosh
  2009-01-15  8:21 ` FUJITA Tomonori
  2009-03-07 16:37 ` export bsg.h header to user-mode Douglas Gilbert
  0 siblings, 2 replies; 13+ messages in thread
From: Boaz Harrosh @ 2009-01-14 16:24 UTC (permalink / raw)
  To: FUJITA Tomonori, open-osd mailing-list; +Cc: linux-scsi

Hi TOMO.

I'm using bsg.ko to submit SG_IO version-4 commands to scsi devices
from user-mode application. (version-4 for use of bidi and varlen).

I have not found a bsg.h header in my fedora-10 distribution. Is
bsg.h exported in kernel-headers-package in latest Kernels? If not
should we, and how to do it?

Meanwhile I will manually copy it to /usr/include/linux/bsg.h and see
if I need to fix any thing so it can be compiled from user-mode.

Also do you have a small libbsg or something to make it easier for
use by application? should we maintain such a package?

Pete from the OSC osd project has his set of headers and library
which I used now. Should I clean it up and send it? Or should I just 
keep it as part of the osd project for now? what are the sas and fc
guys using?

Thanks
Boaz

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-14 16:24 export bsg.h header to user-mode Boaz Harrosh
@ 2009-01-15  8:21 ` FUJITA Tomonori
  2009-01-15  8:57   ` Boaz Harrosh
  2009-03-07 16:37 ` export bsg.h header to user-mode Douglas Gilbert
  1 sibling, 1 reply; 13+ messages in thread
From: FUJITA Tomonori @ 2009-01-15  8:21 UTC (permalink / raw)
  To: bharrosh; +Cc: fujita.tomonori, osd-dev, linux-scsi

On Wed, 14 Jan 2009 18:24:54 +0200
Boaz Harrosh <bharrosh@panasas.com> wrote:

> Hi TOMO.
> 
> I'm using bsg.ko to submit SG_IO version-4 commands to scsi devices
> from user-mode application. (version-4 for use of bidi and varlen).
> 
> I have not found a bsg.h header in my fedora-10 distribution. Is
> bsg.h exported in kernel-headers-package in latest Kernels? If not
> should we, and how to do it?

I think that we need to export struct sg_io_v4, BSG_PROTOCOL_SCSI, and
BSG_SUB_PROTOCOL_SCSI_*.

We don't install any files in include/scsi/* to userspace.

fujita@viola:~/git/linux-2.6$ cat include/Kbuild
# Top-level Makefile calls into asm-$(ARCH)
# List only non-arch directories below

header-y += asm-generic/
header-y += linux/
header-y += sound/
header-y += mtd/
header-y += rdma/
header-y += video/
header-y += drm/

I guess that SCSI header files for userspace
(/usr/include/scsi/scsi.h, sg.h, etc) come from glibc (but I'm not
sure). They are different from those in kernel.


> Meanwhile I will manually copy it to /usr/include/linux/bsg.h and see
> if I need to fix any thing so it can be compiled from user-mode.
> 
> Also do you have a small libbsg or something to make it easier for
> use by application? should we maintain such a package?
> 
> Pete from the OSC osd project has his set of headers and library
> which I used now. Should I clean it up and send it? Or should I just 
> keep it as part of the osd project for now? what are the sas and fc
> guys using?

Doug copies bsg.h to his smp_utils. I do the same thing for my own bsg
programs. We need glibc (or someone) to install bsg.h properly.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-15  8:21 ` FUJITA Tomonori
@ 2009-01-15  8:57   ` Boaz Harrosh
  2009-01-15 11:22     ` FUJITA Tomonori
  0 siblings, 1 reply; 13+ messages in thread
From: Boaz Harrosh @ 2009-01-15  8:57 UTC (permalink / raw)
  To: FUJITA Tomonori, Jens Axboe, Andrew Morton
  Cc: osd-dev, linux-scsi, Douglas Gilbert

FUJITA Tomonori wrote:
> On Wed, 14 Jan 2009 18:24:54 +0200
> Boaz Harrosh <bharrosh@panasas.com> wrote:
> 
>> Hi TOMO.
>>
>> I'm using bsg.ko to submit SG_IO version-4 commands to scsi devices
>> from user-mode application. (version-4 for use of bidi and varlen).
>>
>> I have not found a bsg.h header in my fedora-10 distribution. Is
>> bsg.h exported in kernel-headers-package in latest Kernels? If not
>> should we, and how to do it?
> 
> I think that we need to export struct sg_io_v4, BSG_PROTOCOL_SCSI, and
> BSG_SUB_PROTOCOL_SCSI_*.
> 

I've tested and linux/bsg.h is perfect for user-mode consumption. It
has a few kernel declarations protected by ifdef __KERNEL__ and exactly
what you have above. I did not change anything

> We don't install any files in include/scsi/* to userspace.
> 
> fujita@viola:~/git/linux-2.6$ cat include/Kbuild
> # Top-level Makefile calls into asm-$(ARCH)
> # List only non-arch directories below
> 
> header-y += asm-generic/
> header-y += linux/
> header-y += sound/
> header-y += mtd/
> header-y += rdma/
> header-y += video/
> header-y += drm/
> 

But that's fine then since bsg.h is in <linux/bsg.h>
not <scsi/bsg.h> what is the problem?

OK But you just explained how to do it patch below ...

> I guess that SCSI header files for userspace
> (/usr/include/scsi/scsi.h, sg.h, etc) come from glibc (but I'm not
> sure). They are different from those in kernel.
> 
> 
>> Meanwhile I will manually copy it to /usr/include/linux/bsg.h and see
>> if I need to fix any thing so it can be compiled from user-mode.
>>
>> Also do you have a small libbsg or something to make it easier for
>> use by application? should we maintain such a package?
>>
>> Pete from the OSC osd project has his set of headers and library
>> which I used now. Should I clean it up and send it? Or should I just 
>> keep it as part of the osd project for now? what are the sas and fc
>> guys using?
> 
> Doug copies bsg.h to his smp_utils. I do the same thing for my own bsg
> programs. We need glibc (or someone) to install bsg.h properly.

That is not acceptable for me since I will need to provide an open-osd-devel
package to distros and I might need bsg.h, which I cannot supply with my
package, what if someone else will need it too then we have a conflict.

I'm sending a patch, please ACK?
Thanks
Boaz

---
From: Boaz Harrosh <bharrosh@panasas.com>
Date: Thu, 15 Jan 2009 10:43:17 +0200
Subject: [PATCH] include/linux: Add bsg.h to the Kernel exported headers

bsg.h in current form is perfectly suitable for user-mode
consumption. It is needed together with scsi/sg.h for applications
that want to interface with the bsg driver.

Currently the few projects that use it would copy it over into
the projects. But that is not acceptable for projects that need
to provide a libxxx-devel package for distros.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 include/linux/Kbuild |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 12e9a29..2124c06 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -41,6 +41,7 @@ header-y += baycom.h
 header-y += bfs_fs.h
 header-y += blkpg.h
 header-y += bpqether.h
+header-y += bsg.h
 header-y += can.h
 header-y += cdk.h
 header-y += chio.h
-- 
1.6.0.1

 





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-15  8:57   ` Boaz Harrosh
@ 2009-01-15 11:22     ` FUJITA Tomonori
  2009-01-15 12:06       ` Boaz Harrosh
  0 siblings, 1 reply; 13+ messages in thread
From: FUJITA Tomonori @ 2009-01-15 11:22 UTC (permalink / raw)
  To: bharrosh; +Cc: fujita.tomonori, jens.axboe, akpm, osd-dev, linux-scsi, dougg

On Thu, 15 Jan 2009 10:57:13 +0200
Boaz Harrosh <bharrosh@panasas.com> wrote:

> I've tested and linux/bsg.h is perfect for user-mode consumption. It
> has a few kernel declarations protected by ifdef __KERNEL__ and exactly
> what you have above. I did not change anything
> 
> > We don't install any files in include/scsi/* to userspace.
> > 
> > fujita@viola:~/git/linux-2.6$ cat include/Kbuild
> > # Top-level Makefile calls into asm-$(ARCH)
> > # List only non-arch directories below
> > 
> > header-y += asm-generic/
> > header-y += linux/
> > header-y += sound/
> > header-y += mtd/
> > header-y += rdma/
> > header-y += video/
> > header-y += drm/
> > 
> 
> But that's fine then since bsg.h is in <linux/bsg.h>
> not <scsi/bsg.h> what is the problem?

Oops, somehow I placed bsg.h in include/scsi. Ignore the above my
comments.


> OK But you just explained how to do it patch below ...
> 
> > I guess that SCSI header files for userspace
> > (/usr/include/scsi/scsi.h, sg.h, etc) come from glibc (but I'm not
> > sure). They are different from those in kernel.
> > 
> > 
> >> Meanwhile I will manually copy it to /usr/include/linux/bsg.h and see
> >> if I need to fix any thing so it can be compiled from user-mode.
> >>
> >> Also do you have a small libbsg or something to make it easier for
> >> use by application? should we maintain such a package?
> >>
> >> Pete from the OSC osd project has his set of headers and library
> >> which I used now. Should I clean it up and send it? Or should I just 
> >> keep it as part of the osd project for now? what are the sas and fc
> >> guys using?
> > 
> > Doug copies bsg.h to his smp_utils. I do the same thing for my own bsg
> > programs. We need glibc (or someone) to install bsg.h properly.
> 
> That is not acceptable for me since I will need to provide an open-osd-devel
> package to distros and I might need bsg.h, which I cannot supply with my
> package, what if someone else will need it too then we have a conflict.
> 
> I'm sending a patch, please ACK?
> Thanks
> Boaz

As I wrote in the previous mail, exporting some of bsg stuff for
userspace is necessary, I think. But I have no idea about the correct
way to do it.

Seems the header files in /usr/include/linux/ are different from in
kernel source code (pointless __KERNEL__ stuff are stripped):

fujita@viola:~$ diff git/linux-2.6/include/linux/xattr.h /usr/include/linux/xattr.h
16,19d15
< #ifdef  __KERNEL__
<
< #include <linux/types.h>
<
36,37d31
< struct inode;
< struct dentry;
49,53c43,45
< ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
< ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t);
< ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
< int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int);
< int vfs_removexattr(struct dentry *, const char *);
---
> ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t);
> int vfs_setxattr(struct dentry *, char *, void *, size_t, int);
> int vfs_removexattr(struct dentry *, char *);
60,61d51
< #endif  /*  __KERNEL__  */
<

Your patch does the right thing?


> ---
> From: Boaz Harrosh <bharrosh@panasas.com>
> Date: Thu, 15 Jan 2009 10:43:17 +0200
> Subject: [PATCH] include/linux: Add bsg.h to the Kernel exported headers
> 
> bsg.h in current form is perfectly suitable for user-mode
> consumption. It is needed together with scsi/sg.h for applications
> that want to interface with the bsg driver.
> 
> Currently the few projects that use it would copy it over into
> the projects. But that is not acceptable for projects that need
> to provide a libxxx-devel package for distros.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
>  include/linux/Kbuild |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/Kbuild b/include/linux/Kbuild
> index 12e9a29..2124c06 100644
> --- a/include/linux/Kbuild
> +++ b/include/linux/Kbuild
> @@ -41,6 +41,7 @@ header-y += baycom.h
>  header-y += bfs_fs.h
>  header-y += blkpg.h
>  header-y += bpqether.h
> +header-y += bsg.h
>  header-y += can.h
>  header-y += cdk.h
>  header-y += chio.h
> -- 
> 1.6.0.1
> 
>  
> 
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-15 11:22     ` FUJITA Tomonori
@ 2009-01-15 12:06       ` Boaz Harrosh
  2009-01-15 12:29         ` FUJITA Tomonori
  0 siblings, 1 reply; 13+ messages in thread
From: Boaz Harrosh @ 2009-01-15 12:06 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: jens.axboe, akpm, osd-dev, linux-scsi, dougg, stable

FUJITA Tomonori wrote:
> On Thu, 15 Jan 2009 10:57:13 +0200
> Boaz Harrosh <bharrosh@panasas.com> wrote:
> 
>> I've tested and linux/bsg.h is perfect for user-mode consumption. It
>> has a few kernel declarations protected by ifdef __KERNEL__ and exactly
>> what you have above. I did not change anything
>>
>>> We don't install any files in include/scsi/* to userspace.
>>>
>>> fujita@viola:~/git/linux-2.6$ cat include/Kbuild
>>> # Top-level Makefile calls into asm-$(ARCH)
>>> # List only non-arch directories below
>>>
>>> header-y += asm-generic/
>>> header-y += linux/
>>> header-y += sound/
>>> header-y += mtd/
>>> header-y += rdma/
>>> header-y += video/
>>> header-y += drm/
>>>
>> But that's fine then since bsg.h is in <linux/bsg.h>
>> not <scsi/bsg.h> what is the problem?
> 
> Oops, somehow I placed bsg.h in include/scsi. Ignore the above my
> comments.
> 
> 
>> OK But you just explained how to do it patch below ...
>>
>>> I guess that SCSI header files for userspace
>>> (/usr/include/scsi/scsi.h, sg.h, etc) come from glibc (but I'm not
>>> sure). They are different from those in kernel.
>>>
>>>
>>>> Meanwhile I will manually copy it to /usr/include/linux/bsg.h and see
>>>> if I need to fix any thing so it can be compiled from user-mode.
>>>>
>>>> Also do you have a small libbsg or something to make it easier for
>>>> use by application? should we maintain such a package?
>>>>
>>>> Pete from the OSC osd project has his set of headers and library
>>>> which I used now. Should I clean it up and send it? Or should I just 
>>>> keep it as part of the osd project for now? what are the sas and fc
>>>> guys using?
>>> Doug copies bsg.h to his smp_utils. I do the same thing for my own bsg
>>> programs. We need glibc (or someone) to install bsg.h properly.
>> That is not acceptable for me since I will need to provide an open-osd-devel
>> package to distros and I might need bsg.h, which I cannot supply with my
>> package, what if someone else will need it too then we have a conflict.
>>
>> I'm sending a patch, please ACK?
>> Thanks
>> Boaz
> 
> As I wrote in the previous mail, exporting some of bsg stuff for
> userspace is necessary, I think. But I have no idea about the correct
> way to do it.
> 
> Seems the header files in /usr/include/linux/ are different from in
> kernel source code (pointless __KERNEL__ stuff are stripped):
> 
> fujita@viola:~$ diff git/linux-2.6/include/linux/xattr.h /usr/include/linux/xattr.h
> 16,19d15
> < #ifdef  __KERNEL__
> <
> < #include <linux/types.h>
> <
> 36,37d31
> < struct inode;
> < struct dentry;
> 49,53c43,45
> < ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
> < ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t);
> < ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
> < int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int);
> < int vfs_removexattr(struct dentry *, const char *);
> ---
>> ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t);
>> int vfs_setxattr(struct dentry *, char *, void *, size_t, int);
>> int vfs_removexattr(struct dentry *, char *);
> 60,61d51
> < #endif  /*  __KERNEL__  */
> <
> 
> Your patch does the right thing?
> 

Yes I just checked, the Kernel build system strips out the #ifdef __KERNEL__ sections
for the exported headers. (Do "make headers_check" you can see at usr/include/linux/)

> 
>> ---
>> From: Boaz Harrosh <bharrosh@panasas.com>
>> Date: Thu, 15 Jan 2009 10:43:17 +0200
>> Subject: [PATCH] include/linux: Add bsg.h to the Kernel exported headers
>>
>> bsg.h in current form is perfectly suitable for user-mode
>> consumption. It is needed together with scsi/sg.h for applications
>> that want to interface with the bsg driver.
>>
>> Currently the few projects that use it would copy it over into
>> the projects. But that is not acceptable for projects that need
>> to provide a libxxx-devel package for distros.
>>
>> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>

TOMO Please ACK here so Jens can push it through his tree.
Also I think we want to:
CC: stable@kernel.org

for 2.6.27.x and 2.6.28.x Because these where shipped with bsg
and there is no reason why not have it, lets say in Fedora10
or ubuntu 8.10.

>> ---
>>  include/linux/Kbuild |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/linux/Kbuild b/include/linux/Kbuild
>> index 12e9a29..2124c06 100644
>> --- a/include/linux/Kbuild
>> +++ b/include/linux/Kbuild


Thanks
Boaz

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-15 12:06       ` Boaz Harrosh
@ 2009-01-15 12:29         ` FUJITA Tomonori
  2009-01-16  0:48           ` Andrew Morton
  0 siblings, 1 reply; 13+ messages in thread
From: FUJITA Tomonori @ 2009-01-15 12:29 UTC (permalink / raw)
  To: bharrosh
  Cc: fujita.tomonori, jens.axboe, akpm, osd-dev, linux-scsi, dougg,
	stable

On Thu, 15 Jan 2009 14:06:55 +0200
Boaz Harrosh <bharrosh@panasas.com> wrote:

> > Your patch does the right thing?
> > 
> 
> Yes I just checked, the Kernel build system strips out the #ifdef __KERNEL__ sections
> for the exported headers. (Do "make headers_check" you can see at usr/include/linux/)

Thanks, I see.


> >> ---
> >> From: Boaz Harrosh <bharrosh@panasas.com>
> >> Date: Thu, 15 Jan 2009 10:43:17 +0200
> >> Subject: [PATCH] include/linux: Add bsg.h to the Kernel exported headers
> >>
> >> bsg.h in current form is perfectly suitable for user-mode
> >> consumption. It is needed together with scsi/sg.h for applications
> >> that want to interface with the bsg driver.
> >>
> >> Currently the few projects that use it would copy it over into
> >> the projects. But that is not acceptable for projects that need
> >> to provide a libxxx-devel package for distros.
> >>
> >> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> 
> TOMO Please ACK here so Jens can push it through his tree.

You can add my ACK.


> Also I think we want to:
> CC: stable@kernel.org

It's fine by me.


> for 2.6.27.x and 2.6.28.x Because these where shipped with bsg
> and there is no reason why not have it, lets say in Fedora10
> or ubuntu 8.10.
> 
> >> ---
> >>  include/linux/Kbuild |    1 +
> >>  1 files changed, 1 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/include/linux/Kbuild b/include/linux/Kbuild
> >> index 12e9a29..2124c06 100644
> >> --- a/include/linux/Kbuild
> >> +++ b/include/linux/Kbuild
> 
> 
> Thanks
> Boaz
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-15 12:29         ` FUJITA Tomonori
@ 2009-01-16  0:48           ` Andrew Morton
  2009-01-16  6:50             ` Jens Axboe
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Morton @ 2009-01-16  0:48 UTC (permalink / raw)
  Cc: bharrosh, fujita.tomonori, jens.axboe, osd-dev, linux-scsi, dougg,
	stable

On Thu, 15 Jan 2009 21:29:56 +0900
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> On Thu, 15 Jan 2009 14:06:55 +0200
> Boaz Harrosh <bharrosh@panasas.com> wrote:
> 
> > > Your patch does the right thing?
> > > 
> > 
> > Yes I just checked, the Kernel build system strips out the #ifdef __KERNEL__ sections
> > for the exported headers. (Do "make headers_check" you can see at usr/include/linux/)
> 
> Thanks, I see.
> 
> 
> > >> ---
> > >> From: Boaz Harrosh <bharrosh@panasas.com>
> > >> Date: Thu, 15 Jan 2009 10:43:17 +0200
> > >> Subject: [PATCH] include/linux: Add bsg.h to the Kernel exported headers
> > >>
> > >> bsg.h in current form is perfectly suitable for user-mode
> > >> consumption. It is needed together with scsi/sg.h for applications
> > >> that want to interface with the bsg driver.
> > >>
> > >> Currently the few projects that use it would copy it over into
> > >> the projects. But that is not acceptable for projects that need
> > >> to provide a libxxx-devel package for distros.
> > >>
> > >> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> > 
> > TOMO Please ACK here so Jens can push it through his tree.
> 
> You can add my ACK.
> 
> 
> > Also I think we want to:
> > CC: stable@kernel.org
> 
> It's fine by me.
> 

The patch looks OK to me.

Please resend it with a complete changelog, not this great email mess. 

The changelog should clearly explain why the change is needed after the
merge window and it should provide justification for backporting it into
the -stable kernels.

Please also indicate which -stable kernel versions you believe it
should be ported into.  "everything", I assume.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-16  0:48           ` Andrew Morton
@ 2009-01-16  6:50             ` Jens Axboe
  2009-01-18  8:23               ` [PATCH resend] include/linux: Add bsg.h to the Kernel exported headers Boaz Harrosh
  0 siblings, 1 reply; 13+ messages in thread
From: Jens Axboe @ 2009-01-16  6:50 UTC (permalink / raw)
  To: Andrew Morton
  Cc: FUJITA Tomonori, bharrosh, osd-dev, linux-scsi, dougg, stable

On Thu, Jan 15 2009, Andrew Morton wrote:
> On Thu, 15 Jan 2009 21:29:56 +0900
> FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> 
> > On Thu, 15 Jan 2009 14:06:55 +0200
> > Boaz Harrosh <bharrosh@panasas.com> wrote:
> > 
> > > > Your patch does the right thing?
> > > > 
> > > 
> > > Yes I just checked, the Kernel build system strips out the #ifdef __KERNEL__ sections
> > > for the exported headers. (Do "make headers_check" you can see at usr/include/linux/)
> > 
> > Thanks, I see.
> > 
> > 
> > > >> ---
> > > >> From: Boaz Harrosh <bharrosh@panasas.com>
> > > >> Date: Thu, 15 Jan 2009 10:43:17 +0200
> > > >> Subject: [PATCH] include/linux: Add bsg.h to the Kernel exported headers
> > > >>
> > > >> bsg.h in current form is perfectly suitable for user-mode
> > > >> consumption. It is needed together with scsi/sg.h for applications
> > > >> that want to interface with the bsg driver.
> > > >>
> > > >> Currently the few projects that use it would copy it over into
> > > >> the projects. But that is not acceptable for projects that need
> > > >> to provide a libxxx-devel package for distros.
> > > >>
> > > >> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> > > 
> > > TOMO Please ACK here so Jens can push it through his tree.
> > 
> > You can add my ACK.
> > 
> > 
> > > Also I think we want to:
> > > CC: stable@kernel.org
> > 
> > It's fine by me.
> > 
> 
> The patch looks OK to me.
> 
> Please resend it with a complete changelog, not this great email mess. 
> 
> The changelog should clearly explain why the change is needed after the
> merge window and it should provide justification for backporting it into
> the -stable kernels.
> 
> Please also indicate which -stable kernel versions you believe it
> should be ported into.  "everything", I assume.

Thanks Andrew, I was actually waiting for such a submission :-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH resend] include/linux: Add bsg.h to the Kernel exported headers
  2009-01-16  6:50             ` Jens Axboe
@ 2009-01-18  8:23               ` Boaz Harrosh
  2009-01-18 20:38                 ` FUJITA Tomonori
  2009-01-19  9:37                 ` Jens Axboe
  0 siblings, 2 replies; 13+ messages in thread
From: Boaz Harrosh @ 2009-01-18  8:23 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Andrew Morton, FUJITA Tomonori, osd-dev, linux-scsi, dougg,
	stable


bsg.h in current form is perfectly suitable for user-mode
consumption. It is needed together with scsi/sg.h for applications
that want to interface with the bsg driver.

Currently the few projects that use it would copy it over into
the projects. But that is not acceptable for projects that need
to provide source and devel packages for distros.

This should also be submitted to stable 2.6.28 and 2.6.27 since bsg had
a stable API since these Kernels and distro users will need the header
for these kernels a swell

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Ack-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
CC: stable@kernel.org
---
 include/linux/Kbuild |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 12e9a29..2124c06 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -41,6 +41,7 @@ header-y += baycom.h
 header-y += bfs_fs.h
 header-y += blkpg.h
 header-y += bpqether.h
+header-y += bsg.h
 header-y += can.h
 header-y += cdk.h
 header-y += chio.h
-- 
1.6.0.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH resend] include/linux: Add bsg.h to the Kernel exported headers
  2009-01-18  8:23               ` [PATCH resend] include/linux: Add bsg.h to the Kernel exported headers Boaz Harrosh
@ 2009-01-18 20:38                 ` FUJITA Tomonori
  2009-01-19  9:37                 ` Jens Axboe
  1 sibling, 0 replies; 13+ messages in thread
From: FUJITA Tomonori @ 2009-01-18 20:38 UTC (permalink / raw)
  To: bharrosh, jens.axboe
  Cc: akpm, fujita.tomonori, osd-dev, linux-scsi, dougg, stable

On Sun, 18 Jan 2009 10:23:25 +0200
Boaz Harrosh <bharrosh@panasas.com> wrote:

> 
> bsg.h in current form is perfectly suitable for user-mode
> consumption. It is needed together with scsi/sg.h for applications
> that want to interface with the bsg driver.
> 
> Currently the few projects that use it would copy it over into
> the projects. But that is not acceptable for projects that need
> to provide source and devel packages for distros.
> 
> This should also be submitted to stable 2.6.28 and 2.6.27 since bsg had
> a stable API since these Kernels and distro users will need the header
> for these kernels a swell
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> Ack-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH resend] include/linux: Add bsg.h to the Kernel exported headers
  2009-01-18  8:23               ` [PATCH resend] include/linux: Add bsg.h to the Kernel exported headers Boaz Harrosh
  2009-01-18 20:38                 ` FUJITA Tomonori
@ 2009-01-19  9:37                 ` Jens Axboe
  1 sibling, 0 replies; 13+ messages in thread
From: Jens Axboe @ 2009-01-19  9:37 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Andrew Morton, FUJITA Tomonori, osd-dev, linux-scsi, dougg,
	stable

On Sun, Jan 18 2009, Boaz Harrosh wrote:
> 
> bsg.h in current form is perfectly suitable for user-mode
> consumption. It is needed together with scsi/sg.h for applications
> that want to interface with the bsg driver.
> 
> Currently the few projects that use it would copy it over into
> the projects. But that is not acceptable for projects that need
> to provide source and devel packages for distros.
> 
> This should also be submitted to stable 2.6.28 and 2.6.27 since bsg had
> a stable API since these Kernels and distro users will need the header
> for these kernels a swell
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> Ack-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> CC: stable@kernel.org
> ---
>  include/linux/Kbuild |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/Kbuild b/include/linux/Kbuild
> index 12e9a29..2124c06 100644
> --- a/include/linux/Kbuild
> +++ b/include/linux/Kbuild
> @@ -41,6 +41,7 @@ header-y += baycom.h
>  header-y += bfs_fs.h
>  header-y += blkpg.h
>  header-y += bpqether.h
> +header-y += bsg.h
>  header-y += can.h
>  header-y += cdk.h
>  header-y += chio.h

Applied

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-01-14 16:24 export bsg.h header to user-mode Boaz Harrosh
  2009-01-15  8:21 ` FUJITA Tomonori
@ 2009-03-07 16:37 ` Douglas Gilbert
  2009-03-08 10:05   ` Boaz Harrosh
  1 sibling, 1 reply; 13+ messages in thread
From: Douglas Gilbert @ 2009-03-07 16:37 UTC (permalink / raw)
  To: Boaz Harrosh; +Cc: FUJITA Tomonori, open-osd mailing-list, linux-scsi

Boaz Harrosh wrote:
> Hi TOMO.
> 
> I'm using bsg.ko to submit SG_IO version-4 commands to scsi devices
> from user-mode application. (version-4 for use of bidi and varlen).
> 
> I have not found a bsg.h header in my fedora-10 distribution. Is
> bsg.h exported in kernel-headers-package in latest Kernels? If not
> should we, and how to do it?
> 
> Meanwhile I will manually copy it to /usr/include/linux/bsg.h and see
> if I need to fix any thing so it can be compiled from user-mode.
> 
> Also do you have a small libbsg or something to make it easier for
> use by application? should we maintain such a package?
> 
> Pete from the OSC osd project has his set of headers and library
> which I used now. Should I clean it up and send it? Or should I just 
> keep it as part of the osd project for now? what are the sas and fc
> guys using?

I have been trying to incorporate bsg support into sg3_utils
and need to cope with the /usr/include/linux/bsg.h header being
present or not. It may be present elsewhere (e.g.
/lib/modules/<kernel_version>/build/include/linux/bsg.h ).
Either way bsg.h is still a pain in the user space. The reason
is the kernel's (non standard) "__int" types.

An autotools rule like this to see if linux/bsg.h is present:
    AC_CHECK_HEADERS(linux/bsg.h)
creates a lot of noise because it claims bsg.h is not well
formed. The reason is those "__int" types. The solution is to
add this non obvious rule:
    AC_CHECK_HEADERS([linux/types.h linux/bsg.h], [], [],
      [[#ifdef HAVE_LINUX_TYPES_H
      # include <linux/types.h>
      #endif
      ]])

So my suggestion is to add '#include <linux/types.h>' to bsg.h
(or clean up the types).

Doug Gilbert


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: export bsg.h header to user-mode
  2009-03-07 16:37 ` export bsg.h header to user-mode Douglas Gilbert
@ 2009-03-08 10:05   ` Boaz Harrosh
  0 siblings, 0 replies; 13+ messages in thread
From: Boaz Harrosh @ 2009-03-08 10:05 UTC (permalink / raw)
  To: dgilbert; +Cc: FUJITA Tomonori, open-osd mailing-list, linux-scsi

Douglas Gilbert wrote:
> Boaz Harrosh wrote:
>> Hi TOMO.
>>
>> I'm using bsg.ko to submit SG_IO version-4 commands to scsi devices
>> from user-mode application. (version-4 for use of bidi and varlen).
>>
>> I have not found a bsg.h header in my fedora-10 distribution. Is
>> bsg.h exported in kernel-headers-package in latest Kernels? If not
>> should we, and how to do it?
>>
>> Meanwhile I will manually copy it to /usr/include/linux/bsg.h and see
>> if I need to fix any thing so it can be compiled from user-mode.
>>
>> Also do you have a small libbsg or something to make it easier for
>> use by application? should we maintain such a package?
>>
>> Pete from the OSC osd project has his set of headers and library
>> which I used now. Should I clean it up and send it? Or should I just 
>> keep it as part of the osd project for now? what are the sas and fc
>> guys using?
> 
> I have been trying to incorporate bsg support into sg3_utils
> and need to cope with the /usr/include/linux/bsg.h header being
> present or not. It may be present elsewhere (e.g.
> /lib/modules/<kernel_version>/build/include/linux/bsg.h ).
> Either way bsg.h is still a pain in the user space. The reason
> is the kernel's (non standard) "__int" types.
> 
> An autotools rule like this to see if linux/bsg.h is present:
>     AC_CHECK_HEADERS(linux/bsg.h)
> creates a lot of noise because it claims bsg.h is not well
> formed. The reason is those "__int" types. The solution is to
> add this non obvious rule:
>     AC_CHECK_HEADERS([linux/types.h linux/bsg.h], [], [],
>       [[#ifdef HAVE_LINUX_TYPES_H
>       # include <linux/types.h>
>       #endif
>       ]])
> 
> So my suggestion is to add '#include <linux/types.h>' to bsg.h
> (or clean up the types).
> 

I agree, bsg.h is missing the '#include <linux/types.h>'.
Do you want to send a patch? I thought 'make check_headers' should warn
about that.

> Doug Gilbert
> 

Have you noticed that we added linux/bsg.h to exported headers
for 2.6.29 and stable?

Thanks
Boaz
 

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-03-08 10:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 16:24 export bsg.h header to user-mode Boaz Harrosh
2009-01-15  8:21 ` FUJITA Tomonori
2009-01-15  8:57   ` Boaz Harrosh
2009-01-15 11:22     ` FUJITA Tomonori
2009-01-15 12:06       ` Boaz Harrosh
2009-01-15 12:29         ` FUJITA Tomonori
2009-01-16  0:48           ` Andrew Morton
2009-01-16  6:50             ` Jens Axboe
2009-01-18  8:23               ` [PATCH resend] include/linux: Add bsg.h to the Kernel exported headers Boaz Harrosh
2009-01-18 20:38                 ` FUJITA Tomonori
2009-01-19  9:37                 ` Jens Axboe
2009-03-07 16:37 ` export bsg.h header to user-mode Douglas Gilbert
2009-03-08 10:05   ` Boaz Harrosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).