From patchwork Fri Nov 25 15:53:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 26081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4118301wrr; Fri, 25 Nov 2022 07:54:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5NqxgGgK/G1PnEdAoRS6ZOCp+AvhyAW7XtqL9JcHzfT4g1q59SOaWiCFfZeYYrqi3nQw7y X-Received: by 2002:a05:6402:f10:b0:467:9976:2e37 with SMTP id i16-20020a0564020f1000b0046799762e37mr36145077eda.267.1669391677610; Fri, 25 Nov 2022 07:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669391677; cv=none; d=google.com; s=arc-20160816; b=YkekwzyvV6tNL0F83myMqSVNU43UtYL1206licpy+eWDG1V87edTABUtESNohr6fQR U1I0ekh7m+RFaZ6SkMRS/YSefXH5ugqANyiBt7lQvSlWYfbTHRmSnxiAT41DB9YJ+TXC mZN4GXC4mT8ncNAD+1SSYitV8UB6S5IElv0SoBmahxbGiufyTFtmuRnktCBtctyeafNb 1t+n0CkVlhKQwMTziCkyRnjQ7hIsmQqCbPyz8x/nDbriu6ET1lqjB1yY16GiILVRdFD+ eae4PhPGoSmJxf5vJCw+fqz+vZ5qqXs+6RfJSTmGHr1YqENypAjxTYATS1/Pcl1jH7Tp zWag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dBI9dWjX09z0uU25CnxC5YMz933s2WnelZgltN5jMPE=; b=KlHJxxEt/QqwcH9VmhecCoQr3sZCy7hm/OI8RTd7C2AC4dlf60JLzAum39utixoWn0 V8u6KSNDQ/MJK0Jf0GC6eW/dVJ97F1b97+fvcjk9BFsfRE47lBDBlG9t2n11jm8Y+va7 FYUkohZcLQqztSavj2s6mHBz7g8wCTk7pQbJSnQEWM8/qjpTIMvtSzkG+wy0bZAJ+puw y3gaRRS+A4cM8IUuMOnteyUlUEQM3MpUhBLZreK9JE6ABwsh6Ha8ISpgXyhc+G4nGXeP mWEwTOeSz6e7njfQnJ4rY8OG0PVdFTfo5TW9SFycC+17NXETUtXI8EL2L+XNOTbwt9P/ 6G6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id di10-20020a170906730a00b007417c6edb0asi4028502ejc.402.2022.11.25.07.54.12; Fri, 25 Nov 2022 07:54:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229925AbiKYPyA (ORCPT + 99 others); Fri, 25 Nov 2022 10:54:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbiKYPxk (ORCPT ); Fri, 25 Nov 2022 10:53:40 -0500 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2AC1E4AF04; Fri, 25 Nov 2022 07:53:29 -0800 (PST) Received: from localhost.localdomain (unknown [10.14.30.50]) by mail-app4 (Coremail) with SMTP id cS_KCgCXK97s5IBjv2N5CA--.23174S3; Fri, 25 Nov 2022 23:53:26 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [PATCH 1/4] elevator: print none at first in elv_iosched_show even if the queue has a scheduler Date: Fri, 25 Nov 2022 23:53:11 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: cS_KCgCXK97s5IBjv2N5CA--.23174S3 X-Coremail-Antispam: 1UD129KBjvdXoW7XFWfuFy7Kry7CryfAw4rGrg_yoWDAFXEqF ZYq3Z7Jw45J34UCF4jyF1xtFWFvws3XF15Kwsrtr97Ja15Ka4jyr1xuFs8J34DGFWUua43 A3srZ3s7AwnFkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIkFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4UJVW0owA2z4x0Y4vEx4A2 jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAac4AC62xK8xCEY4 vEwIxC4wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0E wIxGrwCF04k20xvE74AGY7Cv6cx26r4fKr1UJr1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2 IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v2 6r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2 IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv 67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf 9x0JUQZ23UUUUU= X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgEDB1ZdtcjbFAAHs5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750484047827119906?= X-GMAIL-MSGID: =?utf-8?q?1750484047827119906?= This makes the printing order of the io schedulers consistent, and removes a redundant q->elevator check. Signed-off-by: Jinlong Chen Reviewed-by: Christoph Hellwig --- block/elevator.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 599413620558..308bee253564 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -767,10 +767,12 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) if (!elv_support_iosched(q)) return sprintf(name, "none\n"); - if (!q->elevator) + if (!q->elevator) { len += sprintf(name+len, "[none] "); - else + } else { + len += sprintf(name+len, "none "); cur = eq->type; + } spin_lock(&elv_list_lock); list_for_each_entry(e, &elv_list, list) { @@ -783,9 +785,6 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) } spin_unlock(&elv_list_lock); - if (q->elevator) - len += sprintf(name+len, "none"); - len += sprintf(len+name, "\n"); return len; } From patchwork Fri Nov 25 15:53:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 26083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4118918wrr; Fri, 25 Nov 2022 07:55:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf6evsZs2PMcPPYhOfqvQ0rCE/ad6RvvBw+Cr4FeaPq8YiNmncfklF0FybnSI0tx8tbUCCir X-Received: by 2002:a17:906:99c8:b0:7b5:ff35:6715 with SMTP id s8-20020a17090699c800b007b5ff356715mr15275255ejn.255.1669391750375; Fri, 25 Nov 2022 07:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669391750; cv=none; d=google.com; s=arc-20160816; b=mNgR4FgboMylPJ227eg5kXdSSENpgekXwg6X6ewS6NEK11sAIY3mYNmgvLGCsd/VFE 6SR0WUUOrg4+5nTRqD8Zr2Ix4nU8UrpeBfAIn9KIAWShoVyXjl3vRml2aa1MXMwt9G0p 8gkQm7TYA/UN3m/k+6EjF1hv/SkzNu5uXhbEkU8CR7EHAZxajgbjEtfJb3/Xot6e6IKS D3ekgYP5nh9hU1dManGXpKc/jpsS7LxbPJCq9o5VZLK+P7SV/aL9499I8ubCnsGvEOJf LAfVREskF+AXxrCG0lAn2a1MhgQvrbQGbcyOwyp3Xoz6ChFNFr/0ZJfRbvW4xdBLJTr2 zAVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PKhOOvtlfb2qi0t8kP3a+apl+9/7kIQvBSOWJ9+Wfec=; b=P4GvdiALjqUGYqMnXDRAuqZq6n0LagNlm78Qq0ExYKUw8u/eLYrlxLsoEd4cxGKwg1 4xWPq3Y4QBtDbW+kfyzL/mtN1Zv+cz0afYKAVi5vTsnJyzMPKi4gb9h/K8waa9smtApr DtQrI6fn9UIACFzknhfM7OP5r42Gv8iIpA8O9HSy204lYBB4Slh+1lhx8qJPIyNYPoE2 kwsLZZbG1fJsXdgM9u0I0uYnh31dELmWRVryASVfrKIANBeQHhezPVS5EeKFhh5UmwuN 8kaidBp5AyjfHYxVfAV58J6zJt1trjW4XsPWDe1fCnEruCFUNHpxEqYnWKoi216ctA+g PtXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go14-20020a1709070d8e00b007aeb99bbb99si3050548ejc.48.2022.11.25.07.55.23; Fri, 25 Nov 2022 07:55:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbiKYPyJ (ORCPT + 99 others); Fri, 25 Nov 2022 10:54:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbiKYPxr (ORCPT ); Fri, 25 Nov 2022 10:53:47 -0500 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25CBF4EC0D; Fri, 25 Nov 2022 07:53:30 -0800 (PST) Received: from localhost.localdomain (unknown [10.14.30.50]) by mail-app4 (Coremail) with SMTP id cS_KCgCXK97s5IBjv2N5CA--.23174S4; Fri, 25 Nov 2022 23:53:26 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [PATCH 2/4] elevator: replace continue with else-if in elv_iosched_show Date: Fri, 25 Nov 2022 23:53:12 +0800 Message-Id: <852b18c086ef08baec99d08479a3558a3d5db70f.1669391142.git.nickyc975@zju.edu.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: cS_KCgCXK97s5IBjv2N5CA--.23174S4 X-Coremail-Antispam: 1UD129KBjvdXoWrtr48XryrAr18ArWrur4UJwb_yoW3AFb_Ka s5Xwn7J345Jr9Ikr1jvFn5tFWjvwn3Jr15Kwnrtr97ta90gFyfA3Wxua45JryDWFWUu3s8 Cw1DZFn7CryxKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4UJVW0owA2z4x0Y4vEx4A2 jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAac4AC62xK8xCEY4 vEwIxC4wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0E wIxGrwCF04k20xvE74AGY7Cv6cx26r4fKr1UJr1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2 IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v2 6r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2 IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv 67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyT uYvjfUOlksUUUUU X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgEDB1ZdtcjbFAAJs3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750484124001718662?= X-GMAIL-MSGID: =?utf-8?q?1750484124001718662?= else-if is more readable than continue here. Signed-off-by: Jinlong Chen --- block/elevator.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 308bee253564..ffa750976d25 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -776,11 +776,9 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) spin_lock(&elv_list_lock); list_for_each_entry(e, &elv_list, list) { - if (e == cur) { + if (e == cur) len += sprintf(name+len, "[%s] ", cur->elevator_name); - continue; - } - if (elv_support_features(q, e)) + else if (elv_support_features(q, e)) len += sprintf(name+len, "%s ", e->elevator_name); } spin_unlock(&elv_list_lock); From patchwork Fri Nov 25 15:53:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 26082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4118810wrr; Fri, 25 Nov 2022 07:55:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf5mocXnC+hZp9NuBJ9PeZDTh7BSgRu9Bip51UJ+szFkrx9+fBr7QnBr2GL4ALB7VhV0hII0 X-Received: by 2002:a17:906:9c47:b0:78d:8fa5:c326 with SMTP id fg7-20020a1709069c4700b0078d8fa5c326mr22044018ejc.25.1669391737862; Fri, 25 Nov 2022 07:55:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669391737; cv=none; d=google.com; s=arc-20160816; b=hLD7SjNI8x5BplH71q3CuZfnZ1dGejN+yRgimmzRQg51Pm9kVOnfdlXYjMi72iT+zU 5Fg0EktVM494PiHpgAEUg5l+PgnW+bDr0wYsrAUHqZFKD7i6fBeyjo6IFWvTYctnVmoJ 1TlTCqGFsRRcRNhkvn17s2gBrFobhrFE6j5dhSNRwGCQWxFmyp0mGAPSBjVgjtqNMLAb kASiwuYOGI81cx3HWnyDZ71ZIL7K/blYpFG7lsM63yGG2lsW6BM7KEk8KzWHTRv6wFoh F01ChyUaxkte0WbM0KPdMaK4qINJUuJQZ2wUiAeKie0Y1yBXOGfwNpEcrOC7qS1QPrR9 DsQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4RBtQW6TBNh3Ei6OSwqbx/KoUq4LS5GKfG2Vrt5ZLd8=; b=mfwxNsquhECslH9fTfmhtGdr41tkpMFBgoBiunV7OecXOXkWFnKZyROHS20tPMaHGz 3aQhDq5fWSN5QXlCYQfYnjc8rg5mwz8weT49ijUAUcIUp/OMsVCBJ7UMetFmb8sm2udu x0y/TkSg8Qa4Y/pV0syGqnqqvJrgZBTpzD4zbiVkmHxzDZGyXrDhvZX64bMnvH9t4nw5 e2jDD9fG7/vW5+rdeqgrhPAwdFfqklZ1R+JB4KDz0KPOCPrHU7bi5Zhnc5HlAAvLavc2 cHB3JOA33+IlqRVqS5r1YzmbGyqvqqyjOX3mFfNyNJ3tomyMdLvA99Xhp9bX4yhtuUu+ e7+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020a05640225c900b00458d94f1a45si3040641edb.413.2022.11.25.07.55.13; Fri, 25 Nov 2022 07:55:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229799AbiKYPyG (ORCPT + 99 others); Fri, 25 Nov 2022 10:54:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbiKYPxr (ORCPT ); Fri, 25 Nov 2022 10:53:47 -0500 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 087694EC0A; Fri, 25 Nov 2022 07:53:30 -0800 (PST) Received: from localhost.localdomain (unknown [10.14.30.50]) by mail-app4 (Coremail) with SMTP id cS_KCgCXK97s5IBjv2N5CA--.23174S5; Fri, 25 Nov 2022 23:53:27 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [PATCH 3/4] elevator: repalce "len+name" with "name+len" in elv_iosched_show Date: Fri, 25 Nov 2022 23:53:13 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: cS_KCgCXK97s5IBjv2N5CA--.23174S5 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYV7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr1j 6rxdM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2vYz4IE04k24VAvwVAKI4IrM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI 64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8Jw Am72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAG YxC7MxAIw28IcxkI7VAKI48JMxAIw28IcVCjz48v1sIEY20_GFWkJr1UJwCFx2IqxVCFs4 IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1r MI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJV WUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j 6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYx BIdaVFxhVjvjDU0xZFpf9x0JUQZ23UUUUU= X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgEFB1ZdtcmJoQAAse X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750484110719326756?= X-GMAIL-MSGID: =?utf-8?q?1750484110719326756?= The "pointer + offset" pattern is more resonable. Signed-off-by: Jinlong Chen Reviewed-by: Christoph Hellwig --- block/elevator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/elevator.c b/block/elevator.c index ffa750976d25..93dbaa560b67 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -783,7 +783,7 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) } spin_unlock(&elv_list_lock); - len += sprintf(len+name, "\n"); + len += sprintf(name+len, "\n"); return len; } From patchwork Fri Nov 25 15:53:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinlong Chen X-Patchwork-Id: 26084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4119174wrr; Fri, 25 Nov 2022 07:56:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf77sJgFKYDhGigCjLCd+ykhbGaZIrep/2YnD7+Hfo6r2YjtJ3sLJK7zMPUHvHltVhEtuPzN X-Received: by 2002:a17:907:a044:b0:7bc:27ab:6b2d with SMTP id gz4-20020a170907a04400b007bc27ab6b2dmr4701557ejc.750.1669391775079; Fri, 25 Nov 2022 07:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669391775; cv=none; d=google.com; s=arc-20160816; b=VjKxpp74MQ7LDbxPdb9Z3uvGg7YW0uKB0voURpI93pFDn7GmRHPaVHAB8N9e7YQwP0 WZVLG9foWCEOBC+KOzlts4Pfw4M5TcLxZWghNQ8iGeatxGN0CuVj7QVBv6CxD8bWNGnJ Z80PajKRF3bLYECmAT+lE8OS03uIwvqIx5x/25k0IZ9vFtICch8se++8PLGeDfJBOPiK 910GH9oLX5/3CyyCZ/Ox6e6Dx9bxdcniImqzTU1p7P6bLjzkcGKKK/Al37rXlzX/ZloS P78RYcmQuTn4pVsIhZqqnfZ8TCuk7VB7G0v+NsGmzTVRLO/uT374XgCaO/IWjihL5T11 QwmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GLdY+yRKNTc04zRVujGLL5cbs8FkfpZnT/s2LEpZg/Y=; b=b06pOtVWCg2IDkDwWQS2V5XR3k4dp74u28kgXoKrK3YCPrRwTv3dACsS3Kgd+Vs0Ln 1r3NjcktG/Z6nQhd1xtiPpz3VNuM52bp7P9VbM5r9peQR69UYvbbDjcSzq5cfTVf5GMk Izb71BDVfrxV8OXBSalmOR7Yctfz7kpmiAV8P+UUdhsKTJUPRlTa4Wfj/8iNwK8iWeQn clANSzXcyzGtABDCxA0PED24vyuNrTJTgqQ/ySaXcxIl+IZN7aFBsGUsAns9dn6FEbwn h+PvgtyU6lijpB/DTkt+ri+sMNG/6JybCzHWAQ1/HfU76cpfW2mEiCunt2Ephrbjfg/Z ldmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v21-20020a50d595000000b00467570d605esi3023907edi.608.2022.11.25.07.55.50; Fri, 25 Nov 2022 07:56:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229947AbiKYPyH (ORCPT + 99 others); Fri, 25 Nov 2022 10:54:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbiKYPxr (ORCPT ); Fri, 25 Nov 2022 10:53:47 -0500 Received: from zju.edu.cn (spam.zju.edu.cn [61.164.42.155]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1D09B49B68; Fri, 25 Nov 2022 07:53:30 -0800 (PST) Received: from localhost.localdomain (unknown [10.14.30.50]) by mail-app4 (Coremail) with SMTP id cS_KCgCXK97s5IBjv2N5CA--.23174S6; Fri, 25 Nov 2022 23:53:28 +0800 (CST) From: Jinlong Chen To: axboe@kernel.dk Cc: hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nickyc975@zju.edu.cn Subject: [PATCH 4/4] elevator: use bool instead of int as the return type of elv_iosched_allow_bio_merge Date: Fri, 25 Nov 2022 23:53:14 +0800 Message-Id: <1a179a01463c7dbbc1b2be09111ea35617f763a9.1669391142.git.nickyc975@zju.edu.cn> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: cS_KCgCXK97s5IBjv2N5CA--.23174S6 X-Coremail-Antispam: 1UD129KBjvdXoW7GF47uw1ftry8urWUZrW7XFb_yoWfuFc_Cw nYkwn7uFyDCryUAr4qy3W7KFykZan3XFyUCr13Kr97Aayjg3W8Aw1xZrW3JrW8Wr4xW3W3 Ga1qvF17KFnxKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbIAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AK wVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20x vE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4UJVW0owA2z4x0Y4vEx4A2 jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAac4AC62xK8xCEY4 vEwIxC4wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0E wIxGrwCF04k20xvE74AGY7Cv6cx26r4fKr1UJr1l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2 IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v2 6r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2 IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv 67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyT uYvjfUOlksUUUUU X-CM-SenderInfo: qssqjiaqqzq6lmxovvfxof0/1tbiAgEFB1ZdtcmJogAAsd X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750484149843639442?= X-GMAIL-MSGID: =?utf-8?q?1750484149843639442?= We have bool type now, update the old signature. Signed-off-by: Jinlong Chen Reviewed-by: Christoph Hellwig --- block/elevator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 93dbaa560b67..cb1c9a69026c 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -57,7 +57,7 @@ static LIST_HEAD(elv_list); * Query io scheduler to see if the current process issuing bio may be * merged with rq. */ -static int elv_iosched_allow_bio_merge(struct request *rq, struct bio *bio) +static bool elv_iosched_allow_bio_merge(struct request *rq, struct bio *bio) { struct request_queue *q = rq->q; struct elevator_queue *e = q->elevator; @@ -65,7 +65,7 @@ static int elv_iosched_allow_bio_merge(struct request *rq, struct bio *bio) if (e->type->ops.allow_merge) return e->type->ops.allow_merge(q, rq, bio); - return 1; + return true; } /*