From nobody Fri Feb 13 03:08:58 2026 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 X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 453BZgc6074903 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Chao Yu --- 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 =3D &sbi->cprc_info; int class =3D IOPRIO_PRIO_CLASS(cprc->ckpt_thread_ioprio); - int data =3D IOPRIO_PRIO_DATA(cprc->ckpt_thread_ioprio); + int level =3D IOPRIO_PRIO_LEVEL(cprc->ckpt_thread_ioprio); =20 if (class !=3D IOPRIO_CLASS_RT && class !=3D IOPRIO_CLASS_BE) return -EINVAL; =20 return sysfs_emit(buf, "%s,%d\n", - class =3D=3D IOPRIO_CLASS_RT ? "rt" : "be", data); + class =3D=3D IOPRIO_CLASS_RT ? "rt" : "be", level); } =20 #ifdef CONFIG_F2FS_FS_COMPRESSION @@ -450,7 +450,7 @@ static ssize_t __sbi_store(struct f2fs_attr *a, const char *name =3D strim((char *)buf); struct ckpt_req_control *cprc =3D &sbi->cprc_info; int class; - long data; + long level; int ret; =20 if (!strncmp(name, "rt,", 3)) @@ -461,13 +461,13 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return -EINVAL; =20 name +=3D 3; - ret =3D kstrtol(name, 10, &data); + ret =3D kstrtol(name, 10, &level); if (ret) return ret; - if (data >=3D IOPRIO_NR_LEVELS || data < 0) + if (level >=3D IOPRIO_NR_LEVELS || level < 0) return -EINVAL; =20 - cprc->ckpt_thread_ioprio =3D IOPRIO_PRIO_VALUE(class, data); + cprc->ckpt_thread_ioprio =3D IOPRIO_PRIO_VALUE(class, level); if (test_opt(sbi, MERGE_CHECKPOINT)) { ret =3D set_task_ioprio(cprc->f2fs_issue_ckpt, cprc->ckpt_thread_ioprio); --=20 1.9.1