[PATCH v2 5/8] nfsd: use seq_open_data() in exports_net_open()
From: Rasmus Villemoes
Date: Sat Aug 18 2018 - 09:25:00 EST
Using the seq_open_data() helper, exports_net_open() essentially becomes
a oneliner.
Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
Depends on 1/8 introducing seq_open_data.
fs/nfsd/nfsctl.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index d107b4426f7e..483a849b9ce1 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -135,17 +135,9 @@ static const struct file_operations transaction_ops = {
static int exports_net_open(struct net *net, struct file *file)
{
- int err;
- struct seq_file *seq;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
- err = seq_open(file, &nfs_exports_op);
- if (err)
- return err;
-
- seq = file->private_data;
- seq->private = nn->svc_export_cache;
- return 0;
+ return seq_open_data(file, &nfs_exports_op, nn->svc_export_cache);
}
static int exports_proc_open(struct inode *inode, struct file *file)
--
2.16.4