WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [patch 1/6] xenblk: Add O_DIRECT and O_SYNC support - generi

To: Joe Jin <joe.jin@xxxxxxxxxx>
Subject: [Xen-devel] [patch 1/6] xenblk: Add O_DIRECT and O_SYNC support - generic support.
From: Joe Jin <joe.jin@xxxxxxxxxx>
Date: Tue, 4 Nov 2008 10:52:15 +0800
Cc: Xen-devel@xxxxxxxxxxxxxxxxxxx, kurt.hackel@xxxxxxxxxx, shinya.narahara@xxxxxxxxxx, greg.marsden@xxxxxxxxxx, wen.gang.wang@xxxxxxxxxx, jens.axboe@xxxxxxxxxx
Delivery-date: Mon, 03 Nov 2008 18:52:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20081104025055.GA18236@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20081104025055.GA18236@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
[patch 1/6] xenblk: Add O_DIRECT and O_SYNC support - generic support.

Defined some marcos for write sync support.

Signed-off-by: Joe Jin <joe.jin@xxxxxxxxxx>
---

diff -r 2fb13b8cbe13 include/xen/interface/io/blkif.h
--- a/include/xen/interface/io/blkif.h  Thu Oct 30 13:34:43 2008 +0000
+++ b/include/xen/interface/io/blkif.h  Mon Nov 03 10:31:41 2008 +0800
@@ -63,6 +63,21 @@
  * create the "feature-barrier" node!
  */
 #define BLKIF_OP_WRITE_BARRIER     2
+/*
+ * For O_DIRECT, let backend driver commit bios as soon as possible.
+ */
+#define BLKIF_OP_RW_SYNC_BITS      2
+#define BLKIF_OP_RW_SYNC           4
+#define set_rw_sync(req)   set_bit(BLKIF_OP_RW_SYNC_BITS,                    \
+                                   (unsigned long *)&((req)->operation))
+#define BLKIF_OP(op) ((op) & ((1 << BLKIF_OP_RW_SYNC_BITS) - 1))
+#define req_is_sync(req)   ((BLKIF_OP((req)->operation) == BLKIF_OP_WRITE) &&\
+                            ((req)->operation & (1 << BLKIF_OP_RW_SYNC_BITS)))
+
+/* Check if struct request is WRITE and with REQ_RW_SYNC flag */
+#define blk_rw_sync_rq(req) (((req)->flags & REQ_RW) &&                     \
+                            ((req)->flags & REQ_RW_SYNC))
+





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