From bd8c8fd052f00a07d02a9859b06e721bb7046e19 Mon Sep 17 00:00:00 2001 From: Dolev Raviv Date: Tue, 26 May 2015 15:55:21 -0700 Subject: [PATCH] block: Definition for barrier requests flag A barrier request is a type of flush request used to control ordering of write requests without clearing the device's cache. LLD support for barrier is optional. To maintain backward compatibility, barrier request has to maintain flush s/w path and flags. This patch introduces those flags to define interface between the block layer and the LLD. Change-Id: Iefa8e9a5c1b5e8256eaeb0322c435becd4669de9 Signed-off-by: Dolev Raviv [imaund@codeaurora.org: Resolved context conflicts] Signed-off-by: Ian Maund [xiaonian@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Xiaonian Wang --- include/linux/blk_types.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index fc08c40743c8..bda14ef246e4 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -162,6 +162,7 @@ enum rq_flag_bits { __REQ_INTEGRITY, /* I/O includes block integrity payload */ __REQ_FUA, /* forced unit access */ __REQ_PREFLUSH, /* request for cache flush */ + __REQ_BARRIER, /* marks flush req as barrier */ /* bio only flags */ __REQ_RAHEAD, /* read ahead, can fail anytime */ @@ -207,7 +208,7 @@ enum rq_flag_bits { (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) #define REQ_COMMON_MASK \ (REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | REQ_NOIDLE | \ - REQ_PREFLUSH | REQ_FUA | REQ_INTEGRITY | REQ_NOMERGE) + REQ_PREFLUSH | REQ_FUA | REQ_INTEGRITY | REQ_NOMERGE | REQ_BARRIER) #define REQ_CLONE_MASK REQ_COMMON_MASK /* This mask is used for both bio and request merge checking */ @@ -220,6 +221,7 @@ enum rq_flag_bits { #define REQ_SORTED (1ULL << __REQ_SORTED) #define REQ_SOFTBARRIER (1ULL << __REQ_SOFTBARRIER) #define REQ_FUA (1ULL << __REQ_FUA) +#define REQ_BARRIER (1ULL << __REQ_BARRIER) #define REQ_NOMERGE (1ULL << __REQ_NOMERGE) #define REQ_STARTED (1ULL << __REQ_STARTED) #define REQ_DONTPREP (1ULL << __REQ_DONTPREP)