Skip to contentSkip to conversation

Fix building of samba userland

PATCH In review Tom Rini 2 participants 6 messages Nov 3, 2004

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 Fix building of samba userland

Hello. After 2.6.8.1, samba userland would no longer build with current kernel headers, as it needs some of the samba kernel headers to work, yet they included <linux/fs.h> outside of __KERNEL__, and after 2.6.9 this was no longer safe, and caused compilation to fail like this:
Compiling client/smbmount.c
In file included from /fdb041101/montavista/foundation/devkit/ppc/74xx/bin/../ta rget/usr/include/linux/fs.h:19,

                 from /fdb041101/montavista/foundation/devkit/ppc/74xx/bin/../ta
rget/usr/include/linux/smb_fs.h:15,
                 from ../source/client/smbmount.c:27:

/fdb041101/montavista/foundation/devkit/ppc/74xx/bin/../target/usr/include/linux /prio_tree.h:22: error: parse error before "pgoff_t" /fdb041101/montavista/foundation/devkit/ppc/74xx/bin/../target/usr/include/linux /prio_tree.h:27: error: parse error before "pgoff_t"
The simple fix is to move <linux/fs.h> down below the __KERNEL__ test.

include/linux/smb_fs.h +1 -1
@@ -12,7 +12,6 @@
 #include <linux/smb.h>
 #include <linux/smb_fs_i.h>
 #include <linux/smb_fs_sb.h>
-#include <linux/fs.h>
 
 /*
  * ioctl commands
@@ -26,6 +25,7 @@
 
 #ifdef __KERNEL__
 
+#include <linux/fs.h>
 #include <linux/pagemap.h>
 #include <linux/vmalloc.h>
 #include <linux/smb_mount.h>
Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#1 lore raw
Quoted 3 lines · Tom Rini

Hello. After 2.6.8.1, samba userland would no longer build with current kernel headers, as it needs some of the samba kernel headers to work,

what? the samba userland which i assume is portable and not at all linux specific needs linux kernel headers?

Quoted 10 lines

+++ edited/include/linux/smb_fs.h 2004-11-03 12:00:07 -07:00

include/linux/smb_fs.h +0 -1
@@ -12,7 +12,6 @@
 #include <linux/smb.h>
 #include <linux/smb_fs_i.h>
 #include <linux/smb_fs_sb.h>
-#include <linux/fs.h>
 
 /*
  * ioctl commands

include/linux/smb_fs.h line 31

Quoted 7 lines
include/linux/smb_fs.h +1 -0
@@ -26,6 +25,7 @@
 
 #ifdef __KERNEL__
 
+#include <linux/fs.h>
 #include <linux/pagemap.h>
 #include <linux/vmalloc.h>
 #include <linux/smb_mount.h>

that patch seems harmless enough, but im not sure why it should be necessary really, i dont see why samba should be including such headers at all --- it's a bad idea in almost all cases

author
#2 lore raw
Quoted 8 lines · Chris Wedgwood
Quoted 3 lines · Tom Rini

Hello. After 2.6.8.1, samba userland would no longer build with current kernel headers, as it needs some of the samba kernel headers to work,

what? the samba userland which i assume is portable and not at all linux specific needs linux kernel headers?

Portability questions aside (I'm not a Samba person, nor do I play one on TV), the code in question isn't, as it needs <asm/types.h> and <linux/smb_fs.h> (if not needs, at least uses as of 3.0.7).

Quoted 13 lines
Quoted 13 lines

+++ edited/include/linux/smb_fs.h 2004-11-03 12:00:07 -07:00

include/linux/smb_fs.h +0 -1
@@ -12,7 +12,6 @@
 #include <linux/smb.h>
 #include <linux/smb_fs_i.h>
 #include <linux/smb_fs_sb.h>
-#include <linux/fs.h>
 
 /*
  * ioctl commands
@@ -26,6 +25,7 @@
 
 #ifdef __KERNEL__
 
Quoted 8 lines

include/linux/smb_fs.h line 31

Quoted 4 lines
include/linux/smb_fs.h +1 -0
+#include <linux/fs.h>
 #include <linux/pagemap.h>
 #include <linux/vmalloc.h>
 #include <linux/smb_mount.h>

that patch seems harmless enough, but im not sure why it should be necessary really, i dont see why samba should be including such headers at all --- it's a bad idea in almost all cases

Digging around a bit, it needs SMB_CASE_DEFAULT (enum) and SMB_IOC_NEWCONN.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#3 lore raw
Quoted 2 lines · Tom Rini

Digging around a bit, it needs SMB_CASE_DEFAULT (enum) and SMB_IOC_NEWCONN.

where does this come from for non-Linux platforms?

author
#4 lore raw
Quoted 6 lines · Chris Wedgwood
Quoted 2 lines · Tom Rini

Digging around a bit, it needs SMB_CASE_DEFAULT (enum) and SMB_IOC_NEWCONN.

where does this come from for non-Linux platforms?

I would guess they don't get 'smbmount'.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#5 lore raw
Quoted 1 line · Tom Rini

I would guess they don't get 'smbmount'.

oh, i didn't realize it was for that... well, yes, that is a tough one. i wonder why that code doesnt' get merged into Linux's mount(8) though?