mm: reuse DEFINE_SHOW_ATTRIBUTE() macro
...instead of open coding file operations followed by custom ->open() callbacks per each attribute. [andriy.shevchenko@linux.intel.com: add tags, fix compilation issue] Link: http://lkml.kernel.org/r/20180217144253.58604-1-andriy.shevchenko@linux.intel.com Link: http://lkml.kernel.org/r/20180214154644.54505-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Matthew Wilcox <mawilcox@microsoft.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Christoph Lameter <cl@linux.com> Cc: Tejun Heo <tj@kernel.org> Cc: Dennis Zhou <dennisszhou@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Esse commit está contido em:

commit de
Linus Torvalds

pai
7f16f91fdf
commit
5ad3509364
@@ -223,18 +223,7 @@ alloc_buffer:
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int percpu_stats_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
return single_open(filp, percpu_stats_show, NULL);
|
||||
}
|
||||
|
||||
static const struct file_operations percpu_stats_fops = {
|
||||
.open = percpu_stats_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
DEFINE_SHOW_ATTRIBUTE(percpu_stats);
|
||||
|
||||
static int __init init_percpu_stats_debugfs(void)
|
||||
{
|
||||
|
Referência em uma nova issue
Block a user