diff options
Diffstat (limited to 'net/sunrpc/rpc_pipe.c')
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index c23458b464c4..5cd7ad1225a3 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -216,14 +216,11 @@ rpc_destroy_inode(struct inode *inode) | |||
216 | static int | 216 | static int |
217 | rpc_pipe_open(struct inode *inode, struct file *filp) | 217 | rpc_pipe_open(struct inode *inode, struct file *filp) |
218 | { | 218 | { |
219 | struct net *net = inode->i_sb->s_fs_info; | ||
220 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | ||
221 | struct rpc_pipe *pipe; | 219 | struct rpc_pipe *pipe; |
222 | int first_open; | 220 | int first_open; |
223 | int res = -ENXIO; | 221 | int res = -ENXIO; |
224 | 222 | ||
225 | mutex_lock(&inode->i_mutex); | 223 | mutex_lock(&inode->i_mutex); |
226 | sn->gssd_running = 1; | ||
227 | pipe = RPC_I(inode)->pipe; | 224 | pipe = RPC_I(inode)->pipe; |
228 | if (pipe == NULL) | 225 | if (pipe == NULL) |
229 | goto out; | 226 | goto out; |
@@ -1222,7 +1219,6 @@ int rpc_pipefs_init_net(struct net *net) | |||
1222 | return PTR_ERR(sn->gssd_dummy); | 1219 | return PTR_ERR(sn->gssd_dummy); |
1223 | 1220 | ||
1224 | mutex_init(&sn->pipefs_sb_lock); | 1221 | mutex_init(&sn->pipefs_sb_lock); |
1225 | sn->gssd_running = 1; | ||
1226 | sn->pipe_version = -1; | 1222 | sn->pipe_version = -1; |
1227 | return 0; | 1223 | return 0; |
1228 | } | 1224 | } |
@@ -1376,6 +1372,16 @@ err_depopulate: | |||
1376 | return err; | 1372 | return err; |
1377 | } | 1373 | } |
1378 | 1374 | ||
1375 | bool | ||
1376 | gssd_running(struct net *net) | ||
1377 | { | ||
1378 | struct sunrpc_net *sn = net_generic(net, sunrpc_net_id); | ||
1379 | struct rpc_pipe *pipe = sn->gssd_dummy; | ||
1380 | |||
1381 | return pipe->nreaders || pipe->nwriters; | ||
1382 | } | ||
1383 | EXPORT_SYMBOL_GPL(gssd_running); | ||
1384 | |||
1379 | static struct dentry * | 1385 | static struct dentry * |
1380 | rpc_mount(struct file_system_type *fs_type, | 1386 | rpc_mount(struct file_system_type *fs_type, |
1381 | int flags, const char *dev_name, void *data) | 1387 | int flags, const char *dev_name, void *data) |