All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blkint.h
@ 2005-06-09 11:59 aq
  0 siblings, 0 replies; only message in thread
From: aq @ 2005-06-09 11:59 UTC (permalink / raw)
  To: Andrew Warfield, Xen Dev

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

hi Andrew,

blkint.h is included by blktaplib.h, but it is not installed (see
Makefile). there is another problem on #define __BLKINT_H__: this
macro is put in the wrong place.

anway, i think that only blktaplib.h uses this header, so how about
merging them together, so at the same time fix those 2 problems?

Here is a patch to do that.

Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>

$ diffstat blktap.patch 
 blkint.h    |  105 ------------------------------------------------------------
 blktaplib.h |   43 ++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 105 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: blktap.patch --]
[-- Type: text/x-patch; name="blktap.patch", Size: 5823 bytes --]

diff -x BitKeeper -x SCCS -x xen -x ChangeSet -Nurp xeno-today/tools/blktap/blkint.h xeno.0609/tools/blktap/blkint.h
--- xeno-today/tools/blktap/blkint.h	2005-06-01 14:52:30.000000000 +0900
+++ xeno.0609/tools/blktap/blkint.h	1970-01-01 09:00:00.000000000 +0900
@@ -1,105 +0,0 @@
-/*
- * blkint.h
- * 
- * Interfaces for the Xen block interposition driver.
- * 
- * (c) 2004, Andrew Warfield, University of Cambridge
- * 
- */
-
-#ifndef __BLKINT_H__
-
-//#include "blkif.h"
-
-
-#if 0
-/* Types of ring. */
-#define BLKIF_REQ_RING_TYPE 1
-#define BLKIF_RSP_RING_TYPE 2
-
-/* generic ring struct. */
-typedef struct blkif_generic_ring_struct {
-    int type;
-} blkif_generic_ring_t;
-
-/* A requestor's view of a ring. */
-typedef struct blkif_req_ring_struct {
-
-    int type;                    /* Will be BLKIF_REQ_RING_TYPE        */
-    BLKIF_RING_IDX req_prod;     /* PRIVATE req_prod index             */
-    BLKIF_RING_IDX rsp_cons;     /* Response consumer index            */
-    blkif_ring_t *ring;          /* Pointer to shared ring struct      */
-
-} blkif_req_ring_t;
-
-#define BLKIF_REQ_RING_INIT { BLKIF_REQ_RING_TYPE, 0, 0, 0 }
-
-/* A responder's view of a ring. */
-typedef struct blkif_rsp_ring_struct {
-
-    int type;                    /* Will be BLKIF_REQ_RING_TYPE        */
-    BLKIF_RING_IDX rsp_prod;     /* PRIVATE rsp_prod index             */
-    BLKIF_RING_IDX req_cons;     /* Request consumer index             */
-    blkif_ring_t *ring;          /* Pointer to shared ring struct      */
-
-} blkif_rsp_ring_t;
-
-#define BLKIF_RSP_RING_INIT { BLKIF_RSP_RING_TYPE, 0, 0, 0 }
-
-#define RING(a) (blkif_generic_ring_t *)(a)
-inline int BLKTAP_RING_FULL(blkif_generic_ring_t *ring);
-#endif
-
-/* -------[ interposition -> character device interface ]------------- */
-
-/* /dev/xen/blktap resides at device number major=10, minor=202        */ 
-#define BLKTAP_MINOR 202
-
-/* size of the extra VMA area to map in attached pages. */
-#define BLKTAP_VMA_PAGES BLKIF_RING_SIZE
-
-/* blktap IOCTLs:                                                      */
-#define BLKTAP_IOCTL_KICK_FE         1
-#define BLKTAP_IOCTL_KICK_BE         2
-#define BLKTAP_IOCTL_SETMODE         3
-#define BLKTAP_IOCTL_PRINT_IDXS      100   
-
-/* blktap switching modes: (Set with BLKTAP_IOCTL_SETMODE)             */
-#define BLKTAP_MODE_PASSTHROUGH      0x00000000  /* default            */
-#define BLKTAP_MODE_INTERCEPT_FE     0x00000001
-#define BLKTAP_MODE_INTERCEPT_BE     0x00000002
-#define BLKTAP_MODE_COPY_FE          0x00000004
-#define BLKTAP_MODE_COPY_BE          0x00000008
-#define BLKTAP_MODE_COPY_FE_PAGES    0x00000010
-#define BLKTAP_MODE_COPY_BE_PAGES    0x00000020
-
-#define BLKTAP_MODE_INTERPOSE \
-           (BLKTAP_MODE_INTERCEPT_FE | BLKTAP_MODE_INTERCEPT_BE)
-
-#define BLKTAP_MODE_COPY_BOTH \
-           (BLKTAP_MODE_COPY_FE | BLKTAP_MODE_COPY_BE)
-
-#define BLKTAP_MODE_COPY_BOTH_PAGES \
-           (BLKTAP_MODE_COPY_FE_PAGES | BLKTAP_MODE_COPY_BE_PAGES)
-
-static inline int BLKTAP_MODE_VALID(unsigned long arg)
-{
-    return (
-        ( arg == BLKTAP_MODE_PASSTHROUGH  ) ||
-        ( arg == BLKTAP_MODE_INTERCEPT_FE ) ||
-        ( arg == BLKTAP_MODE_INTERCEPT_BE ) ||
-        ( arg == BLKTAP_MODE_INTERPOSE    ) ||
-        ( (arg & ~BLKTAP_MODE_COPY_FE_PAGES) == BLKTAP_MODE_COPY_FE ) ||
-        ( (arg & ~BLKTAP_MODE_COPY_BE_PAGES) == BLKTAP_MODE_COPY_BE ) ||
-        ( (arg & ~BLKTAP_MODE_COPY_BOTH_PAGES) == BLKTAP_MODE_COPY_BOTH )
-        );
-}
-
-
-
-
-
-
-
-#define __BLKINT_H__
-#endif
diff -x BitKeeper -x SCCS -x xen -x ChangeSet -Nurp xeno-today/tools/blktap/blktaplib.h xeno.0609/tools/blktap/blktaplib.h
--- xeno-today/tools/blktap/blktaplib.h	2005-06-01 14:52:30.000000000 +0900
+++ xeno.0609/tools/blktap/blktaplib.h	2005-06-09 20:46:26.155140208 +0900
@@ -16,6 +16,49 @@
 #include <xen/io/domain_controller.h>
 #include "blkint.h"
 
+/* /dev/xen/blktap resides at device number major=10, minor=202        */ 
+#define BLKTAP_MINOR 202
+
+/* size of the extra VMA area to map in attached pages. */
+#define BLKTAP_VMA_PAGES BLKIF_RING_SIZE
+
+/* blktap IOCTLs:                                                      */
+#define BLKTAP_IOCTL_KICK_FE         1
+#define BLKTAP_IOCTL_KICK_BE         2
+#define BLKTAP_IOCTL_SETMODE         3
+#define BLKTAP_IOCTL_PRINT_IDXS      100   
+
+/* blktap switching modes: (Set with BLKTAP_IOCTL_SETMODE)             */
+#define BLKTAP_MODE_PASSTHROUGH      0x00000000  /* default            */
+#define BLKTAP_MODE_INTERCEPT_FE     0x00000001
+#define BLKTAP_MODE_INTERCEPT_BE     0x00000002
+#define BLKTAP_MODE_COPY_FE          0x00000004
+#define BLKTAP_MODE_COPY_BE          0x00000008
+#define BLKTAP_MODE_COPY_FE_PAGES    0x00000010
+#define BLKTAP_MODE_COPY_BE_PAGES    0x00000020
+
+#define BLKTAP_MODE_INTERPOSE \
+           (BLKTAP_MODE_INTERCEPT_FE | BLKTAP_MODE_INTERCEPT_BE)
+
+#define BLKTAP_MODE_COPY_BOTH \
+           (BLKTAP_MODE_COPY_FE | BLKTAP_MODE_COPY_BE)
+
+#define BLKTAP_MODE_COPY_BOTH_PAGES \
+           (BLKTAP_MODE_COPY_FE_PAGES | BLKTAP_MODE_COPY_BE_PAGES)
+
+static inline int BLKTAP_MODE_VALID(unsigned long arg)
+{
+    return (
+        ( arg == BLKTAP_MODE_PASSTHROUGH  ) ||
+        ( arg == BLKTAP_MODE_INTERCEPT_FE ) ||
+        ( arg == BLKTAP_MODE_INTERCEPT_BE ) ||
+        ( arg == BLKTAP_MODE_INTERPOSE    ) ||
+        ( (arg & ~BLKTAP_MODE_COPY_FE_PAGES) == BLKTAP_MODE_COPY_FE ) ||
+        ( (arg & ~BLKTAP_MODE_COPY_BE_PAGES) == BLKTAP_MODE_COPY_BE ) ||
+        ( (arg & ~BLKTAP_MODE_COPY_BOTH_PAGES) == BLKTAP_MODE_COPY_BOTH )
+        );
+}
+
 #define BLKTAP_PASS     0 /* Keep passing this request as normal. */
 #define BLKTAP_RESPOND  1 /* Request is now a reply.  Return it.  */
 #define BLKTAP_STOLEN   2 /* Hook has stolen request.             */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-06-09 11:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-09 11:59 [PATCH] blkint.h aq

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.