Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp900069lqj; Mon, 3 Jun 2024 04:36:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU20A3fgbDEwfGfowACc+6kR0hmU8m2AWgYpuJtcV28Dbp+D77bmlzjntCgFBIPK8XPioBjWvLlb+tZF0nxbvW3q3OOXm5v+hOju/NqTA== X-Google-Smtp-Source: AGHT+IF+Xc+UQdutZ0RPRKVS0kWBZnuwXBxSOmTqIJChV40LYkffzn4MTLiGm/XzMxvFd8OodcAH X-Received: by 2002:a17:906:aa48:b0:a5d:107b:60be with SMTP id a640c23a62f3a-a682272efd5mr572790066b.69.1717414603231; Mon, 03 Jun 2024 04:36:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717414603; cv=pass; d=google.com; s=arc-20160816; b=zY3C9KTonwp16PecrIq5qA8qFPU3kyRMCBmBCOdzaGaE0KqkUyatYn+cqVJoZHDuG3 mB8fqDPPx4/svi4uWD+Y5e3ibgQRVeHUQ8OM+nif8wzetDAR+H5DXq+H+Sl6KVCO2WjT H4BQ8XEBJU1GM0MQS/ase43bkD1J49FWIYo7hpo2Wm23R9V9ZIUNmCqv6T3/t7dmDq// ITUt2d69zsAtFd+6XNsEt2pQG9sj3HX+FZCIf/xkmrIOXPDzFse2xOm+PVT26bJY3gKL XsuBU+YkUEnbpAXb9yL7mhEsbGzAXVr4IMaCGFIHczTJHr8LL/iPiHeliHFkMPxF/1xH Hssg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from; bh=H75dVYarofszrvl+CUA+22dtIxtvJQEu3KdkDCk/0BQ=; fh=JkrfyujbIDmycozXR7ZDiVuf6xBFur6C1+1NEIITJEI=; b=Cs6Dq0Jm5RGYqBe7uUbYbVifJpN/s8djIW6SK6/M857/ZoKad4j8XLB31Il4qiRz+6 floifX3wL5J241HloNUZy5ZbLstpk4vvj3LRUA8gbfdDQxXl6U3uQKWBZ4owy5ohIHLE IJ0XtPahMZWN6Q10Mk2Aus0B9HqSMB3D2sNUueo97XfJ1aCWZ4YPqKZYrTRmZlLK82L0 tHQHb1bEwm7oz6JOKUJXrT8QyxaS9hQXoXLFrrHpsLuAbXL9Nl9jAVKRWpMI0Y57bqjE ZU+z9EoXnKJvurwN4yb979lUIgbaOPEvC7IKy23Nd6xpziQlGCNJN36scmpF99Y5QGxA MgAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-199057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199057-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68cf565bfbsi205571666b.909.2024.06.03.04.36.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 04:36:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=unisoc.com); spf=pass (google.com: domain of linux-kernel+bounces-199057-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199057-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E66E01F23C52 for ; Mon, 3 Jun 2024 11:36:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A529F84D06; Mon, 3 Jun 2024 11:36:36 +0000 (UTC) Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A755C288DF for ; Mon, 3 Jun 2024 11:36:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717414596; cv=none; b=XAiqDO4aXpKrHZZK48HdweH/TwrG1Svyd9Q+7d7c3qetg5gz88QEfZDQCCA9X+uAvHhi0PtuCzlnGz3vKynj8i8pgcmtwawUIOjKxWpXGQE6hB5ZySbl/M0Hz3izh5K0VwabtU4PwAiJxMGwduoBqwuxeNJbQG/3Qm2yPoGoXck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717414596; c=relaxed/simple; bh=TwqEhT3Eq9GXxaWgVaAmkXRxpQVBdJZerofTbNCVbDs=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=i4qnfMcIEaYAZmkPGm7wY0WQDg/upbxS0V3edFuvic7iSu1YOTea7Pq4aZNK7zuVXKvqSidjLIo7FI5nlsRdvmXYq4TzItHYx6hbw/VqXqWQJJ8exNtOGOWJ/gC3+jujA7iXWu1wpGxNHDLKFM/Z5tIkTTowvi2tF/5nrR9nllc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 453BZgc6074903; Mon, 3 Jun 2024 19:35:42 +0800 (+08) (envelope-from Zhiguo.Niu@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4VtBQ96W5fz2Qn07V; Mon, 3 Jun 2024 19:31:45 +0800 (CST) Received: from bj08434pcu.spreadtrum.com (10.0.73.87) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 3 Jun 2024 19:35:40 +0800 From: Zhiguo Niu To: , CC: , , , , Subject: [PATCH V2] f2fs: use new ioprio Macro to get ckpt thread ioprio level Date: Mon, 3 Jun 2024 19:35:26 +0800 Message-ID: <1717414526-19658-1-git-send-email-zhiguo.niu@unisoc.com> X-Mailer: git-send-email 1.9.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL:SHSQR01.spreadtrum.com 453BZgc6074903 IOPRIO_PRIO_DATA in the new kernel version includes level and hint, So Macro IOPRIO_PRIO_LEVEL is more accurate to get ckpt thread ioprio data/level, and it is also consisten with the way setting ckpt thread ioprio by IOPRIO_PRIO_VALUE(class, data/level). Besides, change variable name from "data" to "level" for more readable. Signed-off-by: Zhiguo Niu --- v2: also change variable name from "data" to "level" --- --- fs/f2fs/sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 72676c5..c0b0468 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -340,13 +340,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a, if (!strcmp(a->attr.name, "ckpt_thread_ioprio")) { struct ckpt_req_control *cprc = &sbi->cprc_info; int class = IOPRIO_PRIO_CLASS(cprc->ckpt_thread_ioprio); - int data = IOPRIO_PRIO_DATA(cprc->ckpt_thread_ioprio); + int level = IOPRIO_PRIO_LEVEL(cprc->ckpt_thread_ioprio); if (class != IOPRIO_CLASS_RT && class != IOPRIO_CLASS_BE) return -EINVAL; return sysfs_emit(buf, "%s,%d\n", - class == IOPRIO_CLASS_RT ? "rt" : "be", data); + class == IOPRIO_CLASS_RT ? "rt" : "be", level); } #ifdef CONFIG_F2FS_FS_COMPRESSION @@ -450,7 +450,7 @@ static ssize_t __sbi_store(struct f2fs_attr *a, const char *name = strim((char *)buf); struct ckpt_req_control *cprc = &sbi->cprc_info; int class; - long data; + long level; int ret; if (!strncmp(name, "rt,", 3)) @@ -461,13 +461,13 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return -EINVAL; name += 3; - ret = kstrtol(name, 10, &data); + ret = kstrtol(name, 10, &level); if (ret) return ret; - if (data >= IOPRIO_NR_LEVELS || data < 0) + if (level >= IOPRIO_NR_LEVELS || level < 0) return -EINVAL; - cprc->ckpt_thread_ioprio = IOPRIO_PRIO_VALUE(class, data); + cprc->ckpt_thread_ioprio = IOPRIO_PRIO_VALUE(class, level); if (test_opt(sbi, MERGE_CHECKPOINT)) { ret = set_task_ioprio(cprc->f2fs_issue_ckpt, cprc->ckpt_thread_ioprio); -- 1.9.1