Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rpc_pipe.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/pagemap.h>
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/fsnotify.h>
#include <linux/kernel.h>
#include <linux/rcupdate.h>
#include <asm/ioctls.h>
#include <linux/poll.h>
#include <linux/wait.h>
#include <linux/seq_file.h>
#include <linux/sunrpc/clnt.h>
#include <linux/workqueue.h>
#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/sunrpc/cache.h>
#include <linux/nsproxy.h>
#include <linux/notifier.h>
#include "netns.h"
#include "sunrpc.h"

Go to the source code of this file.

Data Structures

struct  rpc_filelist
 

Macros

#define RPCDBG_FACILITY   RPCDBG_DEBUG
 
#define NET_NAME(net)   ((net == &init_net) ? " (init_net)" : "")
 
#define RPC_UPCALL_TIMEOUT   (30*HZ)
 

Functions

int rpc_pipefs_notifier_register (struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (rpc_pipefs_notifier_register)
 
void rpc_pipefs_notifier_unregister (struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (rpc_pipefs_notifier_unregister)
 
ssize_t rpc_pipe_generic_upcall (struct file *filp, struct rpc_pipe_msg *msg, char __user *dst, size_t buflen)
 
 EXPORT_SYMBOL_GPL (rpc_pipe_generic_upcall)
 
int rpc_queue_upcall (struct rpc_pipe *pipe, struct rpc_pipe_msg *msg)
 
 EXPORT_SYMBOL_GPL (rpc_queue_upcall)
 
void rpc_destroy_pipe_data (struct rpc_pipe *pipe)
 
 EXPORT_SYMBOL_GPL (rpc_destroy_pipe_data)
 
struct rpc_pipe * rpc_mkpipe_data (const struct rpc_pipe_ops *ops, int flags)
 
 EXPORT_SYMBOL_GPL (rpc_mkpipe_data)
 
int rpc_rmdir (struct dentry *dentry)
 
 EXPORT_SYMBOL_GPL (rpc_rmdir)
 

: name of pipe

rpc_mkpipe - make an rpc_pipefs file for kernel<->userspace communication : dentry of directory to create new "pipe" in

: private data to associate with the pipe, for the caller's use : &rpc_pipe containing input parameters

Data is made available for userspace to read by calls to rpc_queue_upcall(). The actual reads will result in calls to ->upcall, which will be called with the file pointer, message, and userspace buffer to copy to.

Writes can come at any time, and do not necessarily have to be responses to upcalls. They will result in calls to ->downcall.

The argument passed here will be available to all these methods from the file pointer, via RPC_I(file->f_dentry->d_inode)->private.

enum  { RPCAUTH_info, RPCAUTH_EOF }
 
struct dentryrpc_mkpipe_dentry (struct dentry *parent, const char *name, void *private, struct rpc_pipe *pipe)
 
 EXPORT_SYMBOL_GPL (rpc_mkpipe_dentry)
 
int rpc_unlink (struct dentry *dentry)
 
 EXPORT_SYMBOL_GPL (rpc_unlink)
 

: &struct qstr for the name

rpc_create_client_dir - Create a new rpc_client directory in rpc_pipefs : dentry from the rpc_pipefs root to the new directory

: rpc client to associate with this directory

This creates a directory at the given associated with , which will contain a file named "info" with some basic information about the client, together with any "pipes" that may later be created using rpc_mkpipe().

#define RPCAUTH_GSSMAGIC   0x67596969
 
enum  {
  RPCAUTH_lockd, RPCAUTH_mount, RPCAUTH_nfs, RPCAUTH_portmap,
  RPCAUTH_statd, RPCAUTH_nfsd4_cb, RPCAUTH_cache, RPCAUTH_nfsd,
  RPCAUTH_RootEOF
}
 
struct dentryrpc_create_client_dir (struct dentry *dentry, struct qstr *name, struct rpc_clnt *rpc_client)
 
int rpc_remove_client_dir (struct dentry *dentry)
 
struct dentryrpc_create_cache_dir (struct dentry *parent, struct qstr *name, umode_t umode, struct cache_detail *cd)
 
void rpc_remove_cache_dir (struct dentry *dentry)
 
struct dentryrpc_d_lookup_sb (const struct super_block *sb, const unsigned char *dir_name)
 
 EXPORT_SYMBOL_GPL (rpc_d_lookup_sb)
 
void rpc_pipefs_init_net (struct net *net)
 
struct super_blockrpc_get_sb_net (const struct net *net)
 
 EXPORT_SYMBOL_GPL (rpc_get_sb_net)
 
void rpc_put_sb_net (const struct net *net)
 
 EXPORT_SYMBOL_GPL (rpc_put_sb_net)
 
int register_rpc_pipefs (void)
 
void unregister_rpc_pipefs (void)
 
 MODULE_ALIAS ("rpc_pipefs")
 

Macro Definition Documentation

#define NET_NAME (   net)    ((net == &init_net) ? " (init_net)" : "")

Definition at line 38 of file rpc_pipe.c.

#define RPC_UPCALL_TIMEOUT   (30*HZ)

Definition at line 45 of file rpc_pipe.c.

#define RPCAUTH_GSSMAGIC   0x67596969

Definition at line 1002 of file rpc_pipe.c.

#define RPCDBG_FACILITY   RPCDBG_DEBUG

Definition at line 36 of file rpc_pipe.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
RPCAUTH_info 
RPCAUTH_EOF 

Definition at line 898 of file rpc_pipe.c.

anonymous enum
Enumerator:
RPCAUTH_lockd 
RPCAUTH_mount 
RPCAUTH_nfs 
RPCAUTH_portmap 
RPCAUTH_statd 
RPCAUTH_nfsd4_cb 
RPCAUTH_cache 
RPCAUTH_nfsd 
RPCAUTH_RootEOF 

Definition at line 1007 of file rpc_pipe.c.

Function Documentation

EXPORT_SYMBOL_GPL ( rpc_pipefs_notifier_register  )
EXPORT_SYMBOL_GPL ( rpc_pipefs_notifier_unregister  )
EXPORT_SYMBOL_GPL ( rpc_pipe_generic_upcall  )
EXPORT_SYMBOL_GPL ( rpc_queue_upcall  )
EXPORT_SYMBOL_GPL ( rpc_destroy_pipe_data  )
EXPORT_SYMBOL_GPL ( rpc_mkpipe_data  )
EXPORT_SYMBOL_GPL ( rpc_rmdir  )
EXPORT_SYMBOL_GPL ( rpc_mkpipe_dentry  )
EXPORT_SYMBOL_GPL ( rpc_unlink  )
EXPORT_SYMBOL_GPL ( rpc_d_lookup_sb  )
EXPORT_SYMBOL_GPL ( rpc_get_sb_net  )
EXPORT_SYMBOL_GPL ( rpc_put_sb_net  )
MODULE_ALIAS ( "rpc_pipefs"  )
int register_rpc_pipefs ( void  )

Definition at line 1184 of file rpc_pipe.c.

struct dentry* rpc_create_cache_dir ( struct dentry parent,
struct qstr name,
umode_t  umode,
struct cache_detail cd 
)
read

Definition at line 981 of file rpc_pipe.c.

struct dentry* rpc_create_client_dir ( struct dentry dentry,
struct qstr name,
struct rpc_clnt rpc_client 
)
read

Definition at line 934 of file rpc_pipe.c.

struct dentry* rpc_d_lookup_sb ( const struct super_block sb,
const unsigned char dir_name 
)
read

Definition at line 1057 of file rpc_pipe.c.

void rpc_destroy_pipe_data ( struct rpc_pipe *  pipe)

Definition at line 570 of file rpc_pipe.c.

struct super_block* rpc_get_sb_net ( const struct net net)
read

Definition at line 1080 of file rpc_pipe.c.

struct rpc_pipe* rpc_mkpipe_data ( const struct rpc_pipe_ops *  ops,
int  flags 
)
read

Definition at line 576 of file rpc_pipe.c.

struct dentry* rpc_mkpipe_dentry ( struct dentry parent,
const char name,
void private,
struct rpc_pipe *  pipe 
)
read

Definition at line 835 of file rpc_pipe.c.

ssize_t rpc_pipe_generic_upcall ( struct file filp,
struct rpc_pipe_msg *  msg,
char __user dst,
size_t  buflen 
)

Definition at line 101 of file rpc_pipe.c.

void rpc_pipefs_init_net ( struct net net)

Definition at line 1067 of file rpc_pipe.c.

int rpc_pipefs_notifier_register ( struct notifier_block nb)

Definition at line 49 of file rpc_pipe.c.

void rpc_pipefs_notifier_unregister ( struct notifier_block nb)

Definition at line 55 of file rpc_pipe.c.

void rpc_put_sb_net ( const struct net net)

Definition at line 1092 of file rpc_pipe.c.

int rpc_queue_upcall ( struct rpc_pipe *  pipe,
struct rpc_pipe_msg *  msg 
)

rpc_queue_upcall - queue an upcall message to userspace : upcall pipe on which to queue given message : message to queue

Call with an created by rpc_mkpipe() to queue an upcall. A userspace process may then later read the upcall by performing a read on an open file for this inode. It is up to the caller to initialize the fields of (other than ->list) appropriately.

Definition at line 132 of file rpc_pipe.c.

void rpc_remove_cache_dir ( struct dentry dentry)

Definition at line 988 of file rpc_pipe.c.

int rpc_remove_client_dir ( struct dentry dentry)

rpc_remove_client_dir - Remove a directory created with rpc_create_client_dir() : dentry for the pipe

Definition at line 946 of file rpc_pipe.c.

int rpc_rmdir ( struct dentry dentry)

Definition at line 620 of file rpc_pipe.c.

int rpc_unlink ( struct dentry dentry)

rpc_unlink - remove a pipe : dentry for the pipe, as returned from rpc_mkpipe

After this call, lookups will no longer find the pipe, and any attempts to read or write using preexisting opens of the pipe will return -EPIPE.

Definition at line 882 of file rpc_pipe.c.

void unregister_rpc_pipefs ( void  )

Definition at line 1210 of file rpc_pipe.c.