[PATCH] Kernel header include fixes

View: New views
6 Messages — Rating Filter:   Alert me  

[PATCH] Kernel header include fixes

by rswwalker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Following is a patch for iscsitarget that:

1) provides compatibility for SLES by adding the asm/types.h header
to source files that include linux/parser.h. SLES has new parser.h
types defined that depend on definitions in types.h, but doesn't
include types.h. After futile attempts to get the vendor to recognize
and correct this I have just included types.h everywhere parser.h is
included as it doesn't cause any problems on systems not affected
by this and it resolves the compatibility problem on those that are.

2) move the linux/blkdev.h include up above parser.h in blockio.c
to fix an include problem on 2.6.26 kernels.

3) Made sure kernel header include order is similar between all
kernel code parts.


Compile tested by Ross Walker

-------------------------------------------------
 block-io.c |    3 ++-
 file-io.c  |    3 ++-
 null-io.c  |    3 ++-
 volume.c   |    5 +++--
 4 files changed, 9 insertions(+), 5 deletions(-)
-------------------------------------------------

Index: kernel/block-io.c
===================================================================
--- kernel/block-io.c (revision 151)
+++ kernel/block-io.c (working copy)
@@ -9,8 +9,9 @@
  * This code is licenced under the GPL.
  */
 
+#include <asm/types.h>
+#include <linux/blkdev.h>
 #include <linux/parser.h>
-#include <linux/blkdev.h>
 #include <linux/buffer_head.h>
 
 #include "iscsi.h"
Index: kernel/volume.c
===================================================================
--- kernel/volume.c (revision 151)
+++ kernel/volume.c (working copy)
@@ -4,12 +4,13 @@
  * This code is licenced under the GPL.
  */
 
+#include <asm/types.h>
+#include <linux/parser.h>
+
 #include "iscsi.h"
 #include "iscsi_dbg.h"
 #include "iotype.h"
 
-#include <linux/parser.h>
-
 struct iet_volume *volume_lookup(struct iscsi_target *target, u32 lun)
 {
  struct iet_volume *volume;
Index: kernel/null-io.c
===================================================================
--- kernel/null-io.c (revision 151)
+++ kernel/null-io.c (working copy)
@@ -7,9 +7,10 @@
  * data. It is only for performance measurement purpose.
  */
 
+#include <asm/types.h>
 #include <linux/blkdev.h>
+#include <linux/parser.h>
 #include <linux/writeback.h>
-#include <linux/parser.h>
 
 #include "iscsi.h"
 #include "iscsi_dbg.h"
Index: kernel/file-io.c
===================================================================
--- kernel/file-io.c (revision 151)
+++ kernel/file-io.c (working copy)
@@ -4,9 +4,10 @@
  * This code is licenced under the GPL.
  */
 
+#include <asm/types.h>
 #include <linux/blkdev.h>
+#include <linux/parser.h>
 #include <linux/writeback.h>
-#include <linux/parser.h>
 
 #include "iscsi.h"
 #include "iscsi_dbg.h"

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@...
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel

Re: [PATCH] Kernel header include fixes

by FUJITA Tomonori :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 13 Jun 2008 11:39:47 -0400
"Ross S. W. Walker" <rwalker@...> wrote:

> Following is a patch for iscsitarget that:
>
> 1) provides compatibility for SLES by adding the asm/types.h header
> to source files that include linux/parser.h. SLES has new parser.h
> types defined that depend on definitions in types.h, but doesn't
> include types.h. After futile attempts to get the vendor to recognize
> and correct this I have just included types.h everywhere parser.h is
> included as it doesn't cause any problems on systems not affected
> by this and it resolves the compatibility problem on those that are.
>
> 2) move the linux/blkdev.h include up above parser.h in blockio.c
> to fix an include problem on 2.6.26 kernels.
>
> 3) Made sure kernel header include order is similar between all
> kernel code parts.
>
>
> Compile tested by Ross Walker
>
> -------------------------------------------------
>  block-io.c |    3 ++-
>  file-io.c  |    3 ++-
>  null-io.c  |    3 ++-
>  volume.c   |    5 +++--
>  4 files changed, 9 insertions(+), 5 deletions(-)
> -------------------------------------------------
>
> Index: kernel/block-io.c
> ===================================================================
> --- kernel/block-io.c (revision 151)
> +++ kernel/block-io.c (working copy)
> @@ -9,8 +9,9 @@
>   * This code is licenced under the GPL.
>   */
>  
> +#include <asm/types.h>

A common way to include <linux/types.h> instead of using asm/types.h
directly?

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@...
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel

Re: [PATCH] Kernel header include fixes

by rswwalker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

FUJITA Tomonori wrote:

> On Fri, 13 Jun 2008 11:39:47 -0400
> "Ross S. W. Walker" <rwalker@...> wrote:
>
> > Index: kernel/block-io.c
> > ===================================================================
> > --- kernel/block-io.c (revision 151)
> > +++ kernel/block-io.c (working copy)
> > @@ -9,8 +9,9 @@
> >   * This code is licenced under the GPL.
> >   */
> >  
> > +#include <asm/types.h>
>
> A common way to include <linux/types.h> instead of using asm/types.h
> directly?

I will change it and have the user re-test it. Only the asm types were
needed in his case, so I didn't think including all type definitions
was warranted here.

-Ross

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@...
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel

[PATCH] Kernel header include fixes (updated)

by rswwalker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Updated 6/17/08 to use linux/types.h instead of asm/types.h

Following is a patch for iscsitarget that:

1) provides compatibility for SLES by adding the linux/types.h header
to source files that include linux/parser.h. SLES has new parser.h
types defined that depend on definitions in types.h, but doesn't
include types.h.

2) move the linux/blkdev.h include up above parser.h in blockio.c to
fix an include problem on 2.6.26 kernels.

3) Made sure kernel header include order is similar between all kernel
code parts.


Compile tested by Ross Walker


-------------------------------------------------
 block-io.c |    3 ++-
 file-io.c  |    3 ++-
 null-io.c  |    3 ++-
 volume.c   |    5 +++--
 4 files changed, 9 insertions(+), 5 deletions(-)
-------------------------------------------------

Index: kernel/block-io.c
===================================================================
--- kernel/block-io.c (revision 151)
+++ kernel/block-io.c (working copy)
@@ -9,8 +9,9 @@
  * This code is licenced under the GPL.
  */
 
+#include <linux/types.h>
+#include <linux/blkdev.h>
 #include <linux/parser.h>
-#include <linux/blkdev.h>
 #include <linux/buffer_head.h>
 
 #include "iscsi.h"
Index: kernel/volume.c
===================================================================
--- kernel/volume.c (revision 151)
+++ kernel/volume.c (working copy)
@@ -4,12 +4,13 @@
  * This code is licenced under the GPL.
  */
 
+#include <linux/types.h>
+#include <linux/parser.h>
+
 #include "iscsi.h"
 #include "iscsi_dbg.h"
 #include "iotype.h"
 
-#include <linux/parser.h>
-
 struct iet_volume *volume_lookup(struct iscsi_target *target, u32 lun)
 {
  struct iet_volume *volume;
Index: kernel/null-io.c
===================================================================
--- kernel/null-io.c (revision 151)
+++ kernel/null-io.c (working copy)
@@ -7,9 +7,10 @@
  * data. It is only for performance measurement purpose.
  */
 
+#include <linux/types.h>
 #include <linux/blkdev.h>
+#include <linux/parser.h>
 #include <linux/writeback.h>
-#include <linux/parser.h>
 
 #include "iscsi.h"
 #include "iscsi_dbg.h"
Index: kernel/file-io.c
===================================================================
--- kernel/file-io.c (revision 151)
+++ kernel/file-io.c (working copy)
@@ -4,9 +4,10 @@
  * This code is licenced under the GPL.
  */
 
+#include <linux/types.h>
 #include <linux/blkdev.h>
+#include <linux/parser.h>
 #include <linux/writeback.h>
-#include <linux/parser.h>
 
 #include "iscsi.h"
 #include "iscsi_dbg.h"

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@...
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel

Re: [PATCH] Kernel header include fixes (updated)

by FUJITA Tomonori :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 18 Jun 2008 10:42:02 -0400
"Ross S. W. Walker" <RWalker@...> wrote:

>
> Updated 6/17/08 to use linux/types.h instead of asm/types.h
>
> Following is a patch for iscsitarget that:
>
> 1) provides compatibility for SLES by adding the linux/types.h header
> to source files that include linux/parser.h. SLES has new parser.h
> types defined that depend on definitions in types.h, but doesn't
> include types.h.
>
> 2) move the linux/blkdev.h include up above parser.h in blockio.c to
> fix an include problem on 2.6.26 kernels.
>
> 3) Made sure kernel header include order is similar between all kernel
> code parts.
>
>
> Compile tested by Ross Walker
>
>
> -------------------------------------------------
>  block-io.c |    3 ++-
>  file-io.c  |    3 ++-
>  null-io.c  |    3 ++-
>  volume.c   |    5 +++--
>  4 files changed, 9 insertions(+), 5 deletions(-)
> -------------------------------------------------

Applied, thanks!

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@...
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel

Re: [PATCH] Kernel header include fixes

by Nikv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

rswwalker wrote:
Following is a patch for iscsitarget that:

1) provides compatibility for SLES by adding the asm/types.h header
to source files that include linux/parser.h. SLES has new parser.h
types defined that depend on definitions in types.h, but doesn't
include types.h. After futile attempts to get the vendor to recognize
and correct this I have just included types.h everywhere parser.h is
included as it doesn't cause any problems on systems not affected
by this and it resolves the compatibility problem on those that are.

2) move the linux/blkdev.h include up above parser.h in blockio.c
to fix an include problem on 2.6.26 kernels.

3) Made sure kernel header include order is similar between all
kernel code parts.


Compile tested by Ross Walker

-------------------------------------------------
 block-io.c |    3 ++-
 file-io.c  |    3 ++-
 null-io.c  |    3 ++-
 volume.c   |    5 +++--
 4 files changed, 9 insertions(+), 5 deletions(-)
-------------------------------------------------

Index: kernel/block-io.c
===================================================================
--- kernel/block-io.c (revision 151)
+++ kernel/block-io.c (working copy)
@@ -9,8 +9,9 @@
  * This code is licenced under the GPL.
  */
 
+#include <asm/types.h>
+#include <linux/blkdev.h>
 #include <linux/parser.h>
-#include <linux/blkdev.h>
 #include <linux/buffer_head.h>
 
 #include "iscsi.h"
Index: kernel/volume.c
===================================================================
--- kernel/volume.c (revision 151)
+++ kernel/volume.c (working copy)
@@ -4,12 +4,13 @@
  * This code is licenced under the GPL.
  */
 
+#include <asm/types.h>
+#include <linux/parser.h>
+
 #include "iscsi.h"
 #include "iscsi_dbg.h"
 #include "iotype.h"
 
-#include <linux/parser.h>
-
 struct iet_volume *volume_lookup(struct iscsi_target *target, u32 lun)
 {
  struct iet_volume *volume;
Index: kernel/null-io.c
===================================================================
--- kernel/null-io.c (revision 151)
+++ kernel/null-io.c (working copy)
@@ -7,9 +7,10 @@
  * data. It is only for performance measurement purpose.
  */
 
+#include <asm/types.h>
 #include <linux/blkdev.h>
+#include <linux/parser.h>
 #include <linux/writeback.h>
-#include <linux/parser.h>
 
 #include "iscsi.h"
 #include "iscsi_dbg.h"
Index: kernel/file-io.c
===================================================================
--- kernel/file-io.c (revision 151)
+++ kernel/file-io.c (working copy)
@@ -4,9 +4,10 @@
  * This code is licenced under the GPL.
  */
 
+#include <asm/types.h>
 #include <linux/blkdev.h>
+#include <linux/parser.h>
 #include <linux/writeback.h>
-#include <linux/parser.h>
 
 #include "iscsi.h"
 #include "iscsi_dbg.h"

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel
CentOS 4.5 Linux kernel 2.6.26:
[root@shd iscsitarget-0.4.16]# make kernel
make -C /lib/modules/2.6.26/build SUBDIRS=/opt/iscsitarget-0.4.16/kernel modules
make[1]: Entering directory `/usr/src/kernels/linux-2.6.26'
  CC [M]  /opt/iscsitarget-0.4.16/kernel/tio.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/iscsi.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/nthread.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/wthread.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/config.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/digest.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/conn.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/session.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/target.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/volume.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/iotype.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/file-io.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/null-io.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/target_disk.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/event.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/param.o
  CC [M]  /opt/iscsitarget-0.4.16/kernel/block-io.o
In file included from /opt/iscsitarget-0.4.16/kernel/block-io.c:12:
include/linux/parser.h:32: error: syntax error before "match_strlcpy"
include/linux/parser.h:32: error: syntax error before "size_t"
include/linux/parser.h:32: warning: type defaults to `int' in declaration of `match_strlcpy'
include/linux/parser.h:32: warning: function declaration isn't a prototype
include/linux/parser.h:32: warning: data definition has no type or storage class
make[2]: *** [/opt/iscsitarget-0.4.16/kernel/block-io.o] Error 1
make[1]: *** [_module_/opt/iscsitarget-0.4.16/kernel] Error 2
make[1]: Leaving directory `/usr/src/kernels/linux-2.6.26'
make: *** [kernel] Error 2


Can you fix this ?
LightInTheBox - Buy quality products at wholesale price