Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

vmscan: don't bother with debugfs_real_fops()

... not when it's used only to check which file is used;
debugfs_create_file_aux_num() allows to stash a number into
debugfs entry and debugfs_get_aux_num() extracts it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Braino-spotted-by: Matthew Wilcox <willy@infradead.org>
Link: https://lore.kernel.org/r/20250702211739.GE3406663@ZenIV
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Al Viro and committed by
Greg Kroah-Hartman
a7694ff1 460e36ee

+5 -3
+5 -3
mm/vmscan.c
··· 5420 5420 static int lru_gen_seq_show(struct seq_file *m, void *v) 5421 5421 { 5422 5422 unsigned long seq; 5423 - bool full = !debugfs_real_fops(m->file)->write; 5423 + bool full = debugfs_get_aux_num(m->file); 5424 5424 struct lruvec *lruvec = v; 5425 5425 struct lru_gen_folio *lrugen = &lruvec->lrugen; 5426 5426 int nid = lruvec_pgdat(lruvec)->node_id; ··· 5756 5756 if (sysfs_create_group(mm_kobj, &lru_gen_attr_group)) 5757 5757 pr_err("lru_gen: failed to create sysfs group\n"); 5758 5758 5759 - debugfs_create_file("lru_gen", 0644, NULL, NULL, &lru_gen_rw_fops); 5760 - debugfs_create_file("lru_gen_full", 0444, NULL, NULL, &lru_gen_ro_fops); 5759 + debugfs_create_file_aux_num("lru_gen", 0644, NULL, NULL, 1, 5760 + &lru_gen_rw_fops); 5761 + debugfs_create_file_aux_num("lru_gen_full", 0444, NULL, NULL, 0, 5762 + &lru_gen_ro_fops); 5761 5763 5762 5764 return 0; 5763 5765 };