diff mbox series

[v2,5/8] nfsd: use seq_open_data() in exports_net_open()

Message ID 20180818132434.9515-5-linux@rasmusvillemoes.dk
State New, archived
Headers show
Series [v2,1/8] seq_file: introduce seq_open_data helper | expand

Commit Message

Rasmus Villemoes Aug. 18, 2018, 1:24 p.m. UTC
Using the seq_open_data() helper, exports_net_open() essentially becomes
a oneliner.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
Depends on 1/8 introducing seq_open_data.

fs/nfsd/nfsctl.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
diff mbox series

Patch

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)