Skip to contentSkip to conversation

2.6.14-rc4-mm1 ntfs/namei.c missing compat.h?

DISCUSSION nyk 5 participants 7 messages Oct 17, 2005 Atomic infrastructure

lore
Share & tools
lore

nyk

author
#0 lore raw

Hi,

Looks like fs/ntfs/namei.c is missing linux/compat.h

  CHK     include/linux/version.h
  CHK     include/linux/compile.h
  CHK     usr/initramfs_list
  CC [M]  fs/ntfs/namei.o
In file included from include/linux/dcache.h:6,
                 from fs/ntfs/namei.c:23:

include/asm/atomic.h:383: error: syntax error before '*' token include/asm/atomic.h:384: warning: function declaration isn't a prototype include/asm/atomic.h: In function 'atomic_scrub':
include/asm/atomic.h:385: error: 'u32' undeclared (first use in this function) include/asm/atomic.h:385: error: (Each undeclared identifier is reported only once include/asm/atomic.h:385: error: for each function it appears in.) include/asm/atomic.h:385: error: syntax error before 'i' include/asm/atomic.h:386: error: 'i' undeclared (first use in this function) include/asm/atomic.h:386: error: 'size' undeclared (first use in this function) include/asm/atomic.h:386: error: 'virt_addr' undeclared (first use in this function) include/asm/atomic.h:386: warning: left-hand operand of comma expression has no effect include/asm/atomic.h:386: warning: statement with no effect include/asm/atomic.h:390: error: memory input 0 is not directly addressable make[2]: *** [fs/ntfs/namei.o] Error 1
make[1]: *** [fs/ntfs] Error 2
make: *** [fs] Error 2

Compiles fine with #include <linux/compat.h> added to the top of fs/ntfs/namei.c

If that's the right place for it, of course.

hth
Nyk

Signature · 3 lines
/__
\_|\/
   /\
#1 lore raw
Quoted 25 lines · nyk

Looks like fs/ntfs/namei.c is missing linux/compat.h

  CHK     include/linux/version.h
  CHK     include/linux/compile.h
  CHK     usr/initramfs_list
  CC [M]  fs/ntfs/namei.o
In file included from include/linux/dcache.h:6,
                 from fs/ntfs/namei.c:23:

include/asm/atomic.h:383: error: syntax error before '*' token include/asm/atomic.h:384: warning: function declaration isn't a prototype include/asm/atomic.h: In function 'atomic_scrub':
include/asm/atomic.h:385: error: 'u32' undeclared (first use in this function) include/asm/atomic.h:385: error: (Each undeclared identifier is reported only once include/asm/atomic.h:385: error: for each function it appears in.) include/asm/atomic.h:385: error: syntax error before 'i' include/asm/atomic.h:386: error: 'i' undeclared (first use in this function) include/asm/atomic.h:386: error: 'size' undeclared (first use in this function) include/asm/atomic.h:386: error: 'virt_addr' undeclared (first use in this function) include/asm/atomic.h:386: warning: left-hand operand of comma expression has no effect include/asm/atomic.h:386: warning: statement with no effect include/asm/atomic.h:390: error: memory input 0 is not directly addressable make[2]: *** [fs/ntfs/namei.o] Error 1
make[1]: *** [fs/ntfs] Error 2
make: *** [fs] Error 2

Quoted 4 lines

Compiles fine with #include <linux/compat.h> added to the top of fs/ntfs/namei.c

If that's the right place for it, of course.

Odd. Compiles fine on non-mm kernel here. Can you send me your .config? (And which architecture are you using?)

Thanks.

/me goes away to download -mm...

Best regards,

Anton

Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
#2 lore raw
In reply to nyk
Quoted 13 lines · nyk

Looks like fs/ntfs/namei.c is missing linux/compat.h

  CHK     include/linux/version.h
  CHK     include/linux/compile.h
  CHK     usr/initramfs_list
  CC [M]  fs/ntfs/namei.o
In file included from include/linux/dcache.h:6,
                 from fs/ntfs/namei.c:23:

include/asm/atomic.h:383: error: syntax error before '*' token include/asm/atomic.h:384: warning: function declaration isn't a prototype include/asm/atomic.h: In function 'atomic_scrub':
include/asm/atomic.h:385: error: 'u32' undeclared (first use in this function) include/asm/atomic.h:385: error: (Each undeclared identifier is reported only once

[...]

Quoted 5 lines

Compiles fine with #include <linux/compat.h> added to the top of fs/ntfs/namei.c

If that's the right place for it, of course.

[Looks like you are on x86_64, as i386 compiles fine]

Actually, <asm-x86_64/atomic.h> seems to need <asm/types.h> for the declaration of u32.
The patch below makes NTFS compile on x86_64 for me. Andi?

Tim

include/asm-x86_64/atomic.h +1 -0
@@ -2,6 +2,7 @@
 #define __ARCH_X86_64_ATOMIC__
 
 #include <linux/config.h>
+#include <asm/types.h>
 
 /* atomic_t should be 32 bit signed type */
 
#3 lore raw
Quoted 8 lines · Tim Schmielau

[Looks like you are on x86_64, as i386 compiles fine]

Actually, <asm-x86_64/atomic.h> seems to need <asm/types.h> for the declaration of u32.
The patch below makes NTFS compile on x86_64 for me. Andi?

Tim

-mm specific problem caused by the bluesmoke merges.

IMHO the right fix is to put that atomic scrub thingy into another include file. It seems to cause major additional include dependencies and is only used in a single file right now.

-Andi

Quoted 11 lines

--- linux-2.6.14-rc4-mm1/include/asm-x86_64/atomic.h 2005-10-17
17:48:12.000000000 +0200 +++
linux-2.6.14-rc4-mm1-build/include/asm-x86_64/atomic.h 2005-10-17
18:20:19.000000000 +0200 @@ -2,6 +2,7 @@
#define __ARCH_X86_64_ATOMIC__

#include <linux/config.h>
+#include <asm/types.h>

/* atomic_t should be 32 bit signed type */

#4 lore raw
Quoted 3 lines · Andi Kleen

IMHO the right fix is to put that atomic scrub thingy into another include file. It seems to cause major additional include dependencies and is only used in a single file right now.

Every file I looked at (I've not looked at NTFS) included types.h if it included atomic.h but sometimes directly or indirectly after atomic.h rather than before.

I was thinking of just writing a tool to find the other cases and then fix those I can.

#5 lore raw
Quoted 11 lines · Alan Cox
Quoted 3 lines · Andi Kleen

IMHO the right fix is to put that atomic scrub thingy into another include file. It seems to cause major additional include dependencies and is only used in a single file right now.

Every file I looked at (I've not looked at NTFS) included types.h if it included atomic.h but sometimes directly or indirectly after atomic.h rather than before.

I was thinking of just writing a tool to find the other cases and then fix those I can.

I think it is far better you do it in a different macro in a different file without any nasty dependencies. What you're trying to do has nothing to do with atomic_t anyways. It is just abuse of atomic.h

-Andi

author
#6 lore raw
In reply to Tim Schmielau
Quoted 34 lines · Tim Schmielau
Quoted 13 lines · nyk

Looks like fs/ntfs/namei.c is missing linux/compat.h

  CHK     include/linux/version.h
  CHK     include/linux/compile.h
  CHK     usr/initramfs_list
  CC [M]  fs/ntfs/namei.o
In file included from include/linux/dcache.h:6,
                 from fs/ntfs/namei.c:23:

include/asm/atomic.h:383: error: syntax error before '*' token include/asm/atomic.h:384: warning: function declaration isn't a prototype include/asm/atomic.h: In function 'atomic_scrub':
include/asm/atomic.h:385: error: 'u32' undeclared (first use in this function) include/asm/atomic.h:385: error: (Each undeclared identifier is reported only once

[...]

Quoted 5 lines

Compiles fine with #include <linux/compat.h> added to the top of fs/ntfs/namei.c

If that's the right place for it, of course.

[Looks like you are on x86_64, as i386 compiles fine]

Actually, <asm-x86_64/atomic.h> seems to need <asm/types.h> for the declaration of u32.
The patch below makes NTFS compile on x86_64 for me. Andi?

Tim

include/asm-x86_64/atomic.h line 8

Quoted 7 lines
include/asm-x86_64/atomic.h +1 -0
@@ -2,6 +2,7 @@
 #define __ARCH_X86_64_ATOMIC__
 
 #include <linux/config.h>
+#include <asm/types.h>
 
 /* atomic_t should be 32 bit signed type */
 

Yup x86_64. And trying out bluesmoke, but I got a lot of unknown symbols in ehci_hcd, so I've got problems elsewhere as well. Will try a compile from a clean tree...

Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_hcd_pci_suspend
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_free_urb
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_hub_tt_clear_buffer
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_hcd_pci_probe
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_suspend_device
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_disabled
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_put_dev
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_get_dev
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_calc_bus_time
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_hcd_pci_resume
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_get_urb
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_hcd_giveback_urb
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_set_device_state
Oct 17 20:24:42 natsu kernel: ehci_hcd: Unknown symbol usb_hcd_pci_remove

Nyk

Signature · 3 lines
/__
\_|\/
   /\