Skip to content

Commit 0cfb0c4

Browse files
ChenXiaoSongchucklever
authored andcommitted
nfsd: use DEFINE_PROC_SHOW_ATTRIBUTE to define nfsd_proc_ops
Use DEFINE_PROC_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 9f553e6 commit 0cfb0c4

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

fs/nfsd/stats.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct svc_stat nfsd_svcstats = {
3232
.program = &nfsd_program,
3333
};
3434

35-
static int nfsd_proc_show(struct seq_file *seq, void *v)
35+
static int nfsd_show(struct seq_file *seq, void *v)
3636
{
3737
int i;
3838

@@ -72,17 +72,7 @@ static int nfsd_proc_show(struct seq_file *seq, void *v)
7272
return 0;
7373
}
7474

75-
static int nfsd_proc_open(struct inode *inode, struct file *file)
76-
{
77-
return single_open(file, nfsd_proc_show, NULL);
78-
}
79-
80-
static const struct proc_ops nfsd_proc_ops = {
81-
.proc_open = nfsd_proc_open,
82-
.proc_read = seq_read,
83-
.proc_lseek = seq_lseek,
84-
.proc_release = single_release,
85-
};
75+
DEFINE_PROC_SHOW_ATTRIBUTE(nfsd);
8676

8777
int nfsd_percpu_counters_init(struct percpu_counter counters[], int num)
8878
{

0 commit comments

Comments
 (0)