Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753390Ab1B1KRM (ORCPT ); Mon, 28 Feb 2011 05:17:12 -0500 Received: from trinity.develer.com ([83.149.158.210]:52777 "EHLO trinity.develer.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753023Ab1B1KRK (ORCPT ); Mon, 28 Feb 2011 05:17:10 -0500 From: Andrea Righi To: Vivek Goyal Cc: Balbir Singh , Daisuke Nishimura , KAMEZAWA Hiroyuki , Greg Thelen , Wu Fengguang , Gui Jianfeng , Ryo Tsuruta , Hirokazu Takahashi , Jens Axboe , Jonathan Corbet , Andrew Morton , containers@lists.linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrea Righi Subject: [PATCH 1/3] block: introduce REQ_DIRECT to track direct io bio Date: Mon, 28 Feb 2011 11:15:03 +0100 Message-Id: <1298888105-3778-2-git-send-email-arighi@develer.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1298888105-3778-1-git-send-email-arighi@develer.com> References: <1298888105-3778-1-git-send-email-arighi@develer.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1875 Lines: 54 Introduce a new flag to identify if a bio has been generated for a direct IO operation. This flag is used by the blkio controller to identify if a write IO request has been issued by the current task and can be limited directly or if it has been generated from another IO context, as a result of a buffered IO operation. Signed-off-by: Andrea Righi --- fs/direct-io.c | 1 + include/linux/blk_types.h | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index b044705..fe364a4 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -361,6 +361,7 @@ static void dio_bio_submit(struct dio *dio) unsigned long flags; bio->bi_private = dio; + bio->bi_rw |= REQ_DIRECT; spin_lock_irqsave(&dio->bio_lock, flags); dio->refcount++; diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 46ad519..2f98c03 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -130,6 +130,7 @@ enum rq_flag_bits { /* bio only flags */ __REQ_UNPLUG, /* unplug the immediately after submission */ __REQ_RAHEAD, /* read ahead, can fail anytime */ + __REQ_DIRECT, /* direct io request */ __REQ_THROTTLED, /* This bio has already been subjected to * throttling rules. Don't do it again. */ @@ -173,6 +174,7 @@ enum rq_flag_bits { #define REQ_UNPLUG (1 << __REQ_UNPLUG) #define REQ_RAHEAD (1 << __REQ_RAHEAD) #define REQ_THROTTLED (1 << __REQ_THROTTLED) +#define REQ_DIRECT (1 << __REQ_DIRECT) #define REQ_SORTED (1 << __REQ_SORTED) #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/