From patchwork Thu Jun 6 11:23:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tlinder X-Patchwork-Id: 2679501 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 051603FD4E for ; Thu, 6 Jun 2013 11:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933126Ab3FFLXZ (ORCPT ); Thu, 6 Jun 2013 07:23:25 -0400 Received: from smtp.codeaurora.org ([198.145.11.231]:34465 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932487Ab3FFLXX (ORCPT ); Thu, 6 Jun 2013 07:23:23 -0400 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 1E69C13EF8C; Thu, 6 Jun 2013 11:23:23 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 11ECA13EFFC; Thu, 6 Jun 2013 11:23:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-caf-smtp.dmz.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham version=3.3.1 Received: from lx-tlinder2.qi.qualcomm.com (212.199.104.198.static.012.net.il [212.199.104.198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: tlinder@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3F68313EF8C; Thu, 6 Jun 2013 11:23:21 +0000 (UTC) From: Tanya Brokhman To: axboe@kernel.dk Cc: linux-arm-msm@vger.kernel.org, linux-mmc@vger.kernel.org, Tanya Brokhman , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v7 2/4] block: Extend cmd_flags in struct request Date: Thu, 6 Jun 2013 14:23:05 +0300 Message-Id: <1370517789-6122-1-git-send-email-tlinder@codeaurora.org> X-Mailer: git-send-email 1.7.6 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org At the moment no new request flags can be added to enum rq_flag_bits due to cmd_flags field size limitation. This commit adds a new filed to be used as an extensions to cmd_flags. Signed-off-by: Tanya Brokhman diff --git a/block/blk-core.c b/block/blk-core.c index fe3683c..3a14987 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -3226,6 +3226,8 @@ int __init blk_dev_init(void) { BUILD_BUG_ON(__REQ_NR_BITS > 8 * sizeof(((struct request *)0)->cmd_flags)); + BUILD_BUG_ON(__REQ_EXT_NR_BITS > 8 * + sizeof(((struct request *)0)->cmd_flags_ext)); /* used for unplugging and affects IO latency/throughput - HIGHPRI */ kblockd_workqueue = alloc_workqueue("kblockd", diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index fa1abeb..40a921f 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -181,6 +181,11 @@ enum rq_flag_bits { __REQ_NR_BITS, /* stops here */ }; +/* Request flags. For use in the cmd_flags_ext field of struct request */ +enum ext_rq_flag_bits { + __REQ_EXT_NR_BITS, /* stops here */ +}; + #define REQ_WRITE (1 << __REQ_WRITE) #define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) #define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 968720f..aa36278 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -100,6 +100,7 @@ struct request { struct request_queue *q; unsigned int cmd_flags; + unsigned int cmd_flags_ext; enum rq_cmd_type_bits cmd_type; unsigned long atomic_flags;