]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix userspace compiles with nbd.h
authorAndrew Morton <akpm@osdl.org>
Mon, 29 Dec 2003 13:53:57 +0000 (05:53 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 29 Dec 2003 13:53:57 +0000 (05:53 -0800)
From: Paul Clements <Paul.Clements@SteelEye.com>

A previous "cleanup" on the nbd.h header file broke userspace compiles.
I've added an #ifdef __KERNEL__ so that userspace doesn't need to worry
about the nbd_device structure, which is only used in-kernel. The patch
allows me to compile my nbd tools with the 2.6 nbd.h.

include/linux/nbd.h

index 8a3311efe28473882f0514c7989d27318aadedb1..dcb0228efcae78645989a236a09d2063dba0ac34 100644 (file)
@@ -35,6 +35,9 @@ enum {
 /* Define PARANOIA to include extra sanity checking code in here & driver */
 #define PARANOIA
 
+/* userspace doesn't need the nbd_device structure */
+#ifdef __KERNEL__
+
 struct nbd_device {
        int flags;
        int harderror;          /* Code of hard error                   */
@@ -53,6 +56,8 @@ struct nbd_device {
        u64 bytesize;
 };
 
+#endif
+
 /* This now IS in some kind of include file... */
 
 /* These are send over network in request/reply magic field */