[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



[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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.