From 6e4f59bd0d69f0a7aa4010b49a5c49a01987b9d8 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Tue, 7 Feb 2012 13:27:27 +0000 Subject: qed: replace is_write with flags field Per-request attributes like read/write are currently implemented as bool fields in the QEDAIOCB struct. This becomes unwiedly as the number of attributes grows. For example, the qed_aio_setup() function would have to take multiple bool arguments and at call sites it would be hard to distinguish the meaning of each bool. Instead use a flags field with bitmask constants. This will be used when zero write support is added. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/qed.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'block/qed.h') diff --git a/block/qed.h b/block/qed.h index 62cbd3b..abed147 100644 --- a/block/qed.h +++ b/block/qed.h @@ -123,12 +123,16 @@ typedef struct QEDRequest { CachedL2Table *l2_table; } QEDRequest; +enum { + QED_AIOCB_WRITE = 0x0001, /* read or write? */ +}; + typedef struct QEDAIOCB { BlockDriverAIOCB common; QEMUBH *bh; int bh_ret; /* final return status for completion bh */ QSIMPLEQ_ENTRY(QEDAIOCB) next; /* next request */ - bool is_write; /* false - read, true - write */ + int flags; /* QED_AIOCB_* bits ORed together */ bool *finished; /* signal for cancel completion */ uint64_t end_pos; /* request end on block device, in bytes */ -- cgit v1.1