#include <rdma/ib.h>
#define RNBD_PROTO_VER_MAJOR 2
-#define RNBD_PROTO_VER_MINOR 1
+#define RNBD_PROTO_VER_MINOR 2
/* The default port number the RTRS server is listening on. */
#define RTRS_PORT 1234
* @RNBD_F_SYNC: request is sync (sync write or read)
* @RNBD_F_FUA: forced unit access
* @RNBD_F_PREFLUSH: request for cache flush
+ * @RNBD_F_NOUNMAP: do not free blocks when zeroing
*/
enum rnbd_io_flags {
/* Flags */
RNBD_F_SYNC = 1<<(RNBD_OP_BITS + 0),
RNBD_F_FUA = 1<<(RNBD_OP_BITS + 1),
- RNBD_F_PREFLUSH = 1<<(RNBD_OP_BITS + 2)
+ RNBD_F_PREFLUSH = 1<<(RNBD_OP_BITS + 2),
+ RNBD_F_NOUNMAP = 1<<(RNBD_OP_BITS + 3)
};
static inline u32 rnbd_op(u32 flags)
break;
case RNBD_OP_WRITE_ZEROES:
bio_opf = REQ_OP_WRITE_ZEROES;
+
+ if (rnbd_opf & RNBD_F_NOUNMAP)
+ bio_opf |= REQ_NOUNMAP;
break;
default:
WARN(1, "Unknown RNBD type: %d (flags %d)\n",
break;
case REQ_OP_WRITE_ZEROES:
rnbd_opf = RNBD_OP_WRITE_ZEROES;
+
+ if (rq->cmd_flags & REQ_NOUNMAP)
+ rnbd_opf |= RNBD_F_NOUNMAP;
break;
case REQ_OP_FLUSH:
rnbd_opf = RNBD_OP_FLUSH;