lkml.org 
[lkml]   [2018]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 5/8] nfsd: use seq_open_data() in exports_net_open()
Date
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 --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
\
 
 \ /
  Last update: 2018-08-18 15:25    [W:0.068 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site