Skip to contentSkip to conversation

blktap[12]: include <sys/mount.h> instead of <linux/fs.h>

PATCH Applied Ian Campbell 4 participants 6 messages Jan 12, 2011 – Jan 17, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blktap[12]: include <sys/mount.h> instead of <linux/fs.h>

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1294825752 0
# Node ID a5a02c0baa75b66c71f2828d22971f9dfb1e8a6b # Parent 610c0b9e9e3d70275a37aba9857e1b9d3a361bd0 blktap[12]: include <sys/mount.h> instead of <linux/fs.h>

The former is a userspace sanitised header which contains the definitions we need. In some distros linux/fs.h defines WRITE which conflicts with blktaps own use of that name.

Also there is no reason to use <linux/errno.h> over the more normal <errno.h>.

tools/blktap/drivers/blk_linux.c +1 -1
diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c
@@ -1,6 +1,6 @@
 #include <inttypes.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
 
tools/blktap2/drivers/blk_linux.c +2 -2
diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap2/drivers/blk_linux.c
@@ -1,7 +1,7 @@
 #include <inttypes.h>
+#include <errno.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/errno.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
#1 lore raw

This is a repost of a patch from the thread "Xen 4.0.1 failed to compile on Ubuntu Natty 32 bits". Specifically <[email protected]>

Ian.

Quoted 40 lines · Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1294825752 0
# Node ID a5a02c0baa75b66c71f2828d22971f9dfb1e8a6b # Parent 610c0b9e9e3d70275a37aba9857e1b9d3a361bd0 blktap[12]: include <sys/mount.h> instead of <linux/fs.h>

The former is a userspace sanitised header which contains the definitions we need. In some distros linux/fs.h defines WRITE which conflicts with blktaps own use of that name.

Also there is no reason to use <linux/errno.h> over the more normal <errno.h>.

diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c

tools/blktap/drivers/blk_linux.c +1 -1
@@ -1,6 +1,6 @@
 #include <inttypes.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
 

diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap2/drivers/blk_linux.c

tools/blktap2/drivers/blk_linux.c +2 -2
@@ -1,7 +1,7 @@
 #include <inttypes.h>
+#include <errno.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/errno.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
 
#2 lore raw

Ian Campbell writes ("[Xen-devel] Re: [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>"):

Quoted 3 lines

This is a repost of a patch from the thread "Xen 4.0.1 failed to compile on Ubuntu Natty 32 bits". Specifically <[email protected]>

Thanks, and sorry to miss it the first time round. I'll apply it after 4.1.0 rc1.

Ian.

#3 lore raw
In reply to Ian Campbell
Quoted 10 lines · Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1294825752 0
# Node ID a5a02c0baa75b66c71f2828d22971f9dfb1e8a6b # Parent 610c0b9e9e3d70275a37aba9857e1b9d3a361bd0 blktap[12]: include <sys/mount.h> instead of <linux/fs.h>

The former is a userspace sanitised header which contains the definitions we need. In some distros linux/fs.h defines WRITE which conflicts with blktaps own use of that name.

Ack.

[But fwiw we have BLKIF_OP_WRITE and TD_OP_WRITE and all proper code should carry a TD_, so I'm slightly surprised.]

Daniel

Quoted 28 lines

Also there is no reason to use <linux/errno.h> over the more normal <errno.h>.

diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c

tools/blktap/drivers/blk_linux.c +1 -1
@@ -1,6 +1,6 @@
 #include <inttypes.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
 

diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap2/drivers/blk_linux.c

tools/blktap2/drivers/blk_linux.c +2 -2
@@ -1,7 +1,7 @@
 #include <inttypes.h>
+#include <errno.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/errno.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
#4 lore raw
Quoted 8 lines · Daniel Stodden
Quoted 7 lines · Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1294825752 0
# Node ID a5a02c0baa75b66c71f2828d22971f9dfb1e8a6b # Parent 610c0b9e9e3d70275a37aba9857e1b9d3a361bd0 blktap[12]: include <sys/mount.h> instead of <linux/fs.h>

Quoted 8 lines
Quoted 3 lines

The former is a userspace sanitised header which contains the definitions we need. In some distros linux/fs.h defines WRITE which conflicts with blktaps own use of that name.

Ack.

[But fwiw we have BLKIF_OP_WRITE and TD_OP_WRITE and all proper code should carry a TD_, so I'm slightly surprised.]

Bare WRITE (and READ) seem to be used in e.g. tools/blktap/drivers/blktapctrl.c and tools/blktap/drivers/tapdisk.c in xen-unstable.hg. blktap2 looks clean apart from the header though.

I think using sys/mount.h is correct in its own right but it would probably also be correct to switch to the properly namespaced variants.

Ian.

Quoted 34 lines

Daniel

Quoted 28 lines

Also there is no reason to use <linux/errno.h> over the more normal <errno.h>.

diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c

tools/blktap/drivers/blk_linux.c +1 -1
@@ -1,6 +1,6 @@
 #include <inttypes.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
 

diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap2/drivers/blk_linux.c

tools/blktap2/drivers/blk_linux.c +2 -2
@@ -1,7 +1,7 @@
 #include <inttypes.h>
+#include <errno.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/errno.h>
+#include <sys/mount.h>
 #include "tapdisk.h"
 #include "blk.h"
Applied
#5 lore raw
In reply to Ian Campbell

Ian Campbell writes ("[Xen-devel] [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>"):

Quoted 10 lines

blktap[12]: include <sys/mount.h> instead of <linux/fs.h>

The former is a userspace sanitised header which contains the definitions we need. In some distros linux/fs.h defines WRITE which conflicts with blktaps own use of that name.

Also there is no reason to use <linux/errno.h> over the more normal <errno.h>.

Applied, thanks.

Ian.