From patchwork Mon Sep 19 01:49:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 12979639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F285C6FA90 for ; Mon, 19 Sep 2022 01:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbiISBiz (ORCPT ); Sun, 18 Sep 2022 21:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbiISBiw (ORCPT ); Sun, 18 Sep 2022 21:38:52 -0400 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37E8A186C9; Sun, 18 Sep 2022 18:38:50 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4MW6jJ209Nz6S2yL; Mon, 19 Sep 2022 09:36:52 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgA3inMmyCdjeiM6BA--.44102S6; Mon, 19 Sep 2022 09:38:48 +0800 (CST) From: Yu Kuai To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next 2/3] block: add a helper to check elevator name Date: Mon, 19 Sep 2022 09:49:38 +0800 Message-Id: <20220919014939.175497-3-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220919014939.175497-1-yukuai1@huaweicloud.com> References: <20220919014939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wI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUj8nY7UUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org From: Yu Kuai The helper will be used in later patch to make sure wbt is not enabled if default io scheduler is bfq. Signed-off-by: Yu Kuai --- block/elevator.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block/elevator.h b/block/elevator.h index 3f0593b3bf9d..ccded343cf27 100644 --- a/block/elevator.h +++ b/block/elevator.h @@ -104,6 +104,11 @@ struct elevator_queue DECLARE_HASHTABLE(hash, ELV_HASH_BITS); }; +static inline bool check_elevator_name(struct elevator_queue *elevator, + const char *name) +{ + return !strcmp(elevator->type->elevator_name, name); +} /* * block elevator interface */