All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>
@ 2011-01-12  9:49 Ian Campbell
  2011-01-12  9:55 ` Ian Campbell
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ian Campbell @ 2011-01-12  9:49 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# 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>.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c
--- a/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
+++ b/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
@@ -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
--- a/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
+++ b/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
@@ -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"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>
  2011-01-12  9:49 [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h> Ian Campbell
@ 2011-01-12  9:55 ` Ian Campbell
  2011-01-12 17:18   ` Ian Jackson
  2011-01-12 22:06 ` Daniel Stodden
  2011-01-17 17:14 ` Ian Jackson
  2 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2011-01-12  9:55 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

This is a repost of a patch from the thread "Xen 4.0.1 failed to compile
on Ubuntu Natty 32 bits". Specifically
<1292492084.32368.6927.camel@zakaz.uk.xensource.com>

Ian.

On Wed, 2011-01-12 at 09:49 +0000, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@citrix.com>
> # 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>.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c
> --- a/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
> +++ b/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
> @@ -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
> --- a/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
> +++ b/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
> @@ -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"
>  

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>
  2011-01-12  9:55 ` Ian Campbell
@ 2011-01-12 17:18   ` Ian Jackson
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Jackson @ 2011-01-12 17:18 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel@lists.xensource.com

Ian Campbell writes ("[Xen-devel] Re: [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>"):
> This is a repost of a patch from the thread "Xen 4.0.1 failed to compile
> on Ubuntu Natty 32 bits". Specifically
> <1292492084.32368.6927.camel@zakaz.uk.xensource.com>

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

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>
  2011-01-12  9:49 [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h> Ian Campbell
  2011-01-12  9:55 ` Ian Campbell
@ 2011-01-12 22:06 ` Daniel Stodden
  2011-01-12 22:12   ` Ian Campbell
  2011-01-17 17:14 ` Ian Jackson
  2 siblings, 1 reply; 6+ messages in thread
From: Daniel Stodden @ 2011-01-12 22:06 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian, Campbell, xen-devel@lists.xensource.com

On Wed, 2011-01-12 at 04:49 -0500, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell <ian.campbell@citrix.com>
> # 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

> Also there is no reason to use <linux/errno.h> over the more normal
> <errno.h>.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> 
> diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c
> --- a/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
> +++ b/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
> @@ -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
> --- a/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
> +++ b/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
> @@ -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"

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>
  2011-01-12 22:06 ` Daniel Stodden
@ 2011-01-12 22:12   ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2011-01-12 22:12 UTC (permalink / raw)
  To: Daniel Stodden; +Cc: xen-devel@lists.xensource.com

On Wed, 2011-01-12 at 22:06 +0000, Daniel Stodden wrote: 
> On Wed, 2011-01-12 at 04:49 -0500, Ian Campbell wrote:
> > # HG changeset patch
> > # User Ian Campbell <ian.campbell@citrix.com>
> > # 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.]

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. 
> 
> Daniel
> 
> > Also there is no reason to use <linux/errno.h> over the more normal
> > <errno.h>.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > 
> > diff -r 610c0b9e9e3d -r a5a02c0baa75 tools/blktap/drivers/blk_linux.c
> > --- a/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
> > +++ b/tools/blktap/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
> > @@ -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
> > --- a/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:00 2011 +0000
> > +++ b/tools/blktap2/drivers/blk_linux.c	Wed Jan 12 09:49:12 2011 +0000
> > @@ -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"
> 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>
  2011-01-12  9:49 [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h> Ian Campbell
  2011-01-12  9:55 ` Ian Campbell
  2011-01-12 22:06 ` Daniel Stodden
@ 2011-01-17 17:14 ` Ian Jackson
  2 siblings, 0 replies; 6+ messages in thread
From: Ian Jackson @ 2011-01-17 17:14 UTC (permalink / raw)
  To: xen-devel

Ian Campbell writes ("[Xen-devel] [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h>"):
> 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>.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Applied, thanks.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-17 17:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12  9:49 [PATCH] blktap[12]: include <sys/mount.h> instead of <linux/fs.h> Ian Campbell
2011-01-12  9:55 ` Ian Campbell
2011-01-12 17:18   ` Ian Jackson
2011-01-12 22:06 ` Daniel Stodden
2011-01-12 22:12   ` Ian Campbell
2011-01-17 17:14 ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.