Skip to content

Commit 270b093

Browse files
Zhiguo NiuJaegeuk Kim
authored andcommitted
f2fs: use new ioprio Macro to get ckpt thread ioprio level
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 <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 192b8fb commit 270b093

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/f2fs/sysfs.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ static ssize_t f2fs_sbi_show(struct f2fs_attr *a,
340340
if (!strcmp(a->attr.name, "ckpt_thread_ioprio")) {
341341
struct ckpt_req_control *cprc = &sbi->cprc_info;
342342
int class = IOPRIO_PRIO_CLASS(cprc->ckpt_thread_ioprio);
343-
int data = IOPRIO_PRIO_DATA(cprc->ckpt_thread_ioprio);
343+
int level = IOPRIO_PRIO_LEVEL(cprc->ckpt_thread_ioprio);
344344

345345
if (class != IOPRIO_CLASS_RT && class != IOPRIO_CLASS_BE)
346346
return -EINVAL;
347347

348348
return sysfs_emit(buf, "%s,%d\n",
349-
class == IOPRIO_CLASS_RT ? "rt" : "be", data);
349+
class == IOPRIO_CLASS_RT ? "rt" : "be", level);
350350
}
351351

352352
#ifdef CONFIG_F2FS_FS_COMPRESSION
@@ -450,7 +450,7 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
450450
const char *name = strim((char *)buf);
451451
struct ckpt_req_control *cprc = &sbi->cprc_info;
452452
int class;
453-
long data;
453+
long level;
454454
int ret;
455455

456456
if (!strncmp(name, "rt,", 3))
@@ -461,13 +461,13 @@ static ssize_t __sbi_store(struct f2fs_attr *a,
461461
return -EINVAL;
462462

463463
name += 3;
464-
ret = kstrtol(name, 10, &data);
464+
ret = kstrtol(name, 10, &level);
465465
if (ret)
466466
return ret;
467-
if (data >= IOPRIO_NR_LEVELS || data < 0)
467+
if (level >= IOPRIO_NR_LEVELS || level < 0)
468468
return -EINVAL;
469469

470-
cprc->ckpt_thread_ioprio = IOPRIO_PRIO_VALUE(class, data);
470+
cprc->ckpt_thread_ioprio = IOPRIO_PRIO_VALUE(class, level);
471471
if (test_opt(sbi, MERGE_CHECKPOINT)) {
472472
ret = set_task_ioprio(cprc->f2fs_issue_ckpt,
473473
cprc->ckpt_thread_ioprio);

0 commit comments

Comments
 (0)