Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
clnt.c File Reference
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kallsyms.h>
#include <linux/mm.h>
#include <linux/namei.h>
#include <linux/mount.h>
#include <linux/slab.h>
#include <linux/utsname.h>
#include <linux/workqueue.h>
#include <linux/in.h>
#include <linux/in6.h>
#include <linux/un.h>
#include <linux/rcupdate.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/sunrpc/metrics.h>
#include <linux/sunrpc/bc_xprt.h>
#include <trace/events/sunrpc.h>
#include "sunrpc.h"
#include "netns.h"

Go to the source code of this file.

Macros

#define dprint_status(t)
 

Functions

int rpc_clients_notifier_register (void)
 
void rpc_clients_notifier_unregister (void)
 
struct rpc_clntrpc_create (struct rpc_create_args *args)
 
 EXPORT_SYMBOL_GPL (rpc_create)
 
struct rpc_clntrpc_clone_client (struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_clone_client)
 
struct rpc_clntrpc_clone_client_set_auth (struct rpc_clnt *clnt, rpc_authflavor_t flavor)
 
 EXPORT_SYMBOL_GPL (rpc_clone_client_set_auth)
 
void rpc_killall_tasks (struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_killall_tasks)
 
void rpc_shutdown_client (struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_shutdown_client)
 
void rpc_release_client (struct rpc_clnt *clnt)
 
struct rpc_clntrpc_bind_new_program (struct rpc_clnt *old, const struct rpc_program *program, u32 vers)
 
 EXPORT_SYMBOL_GPL (rpc_bind_new_program)
 
void rpc_task_release_client (struct rpc_task *task)
 
void rpc_task_reset_client (struct rpc_task *task, struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_task_reset_client)
 
struct rpc_taskrpc_run_task (const struct rpc_task_setup *task_setup_data)
 
 EXPORT_SYMBOL_GPL (rpc_run_task)
 
int rpc_call_sync (struct rpc_clnt *clnt, const struct rpc_message *msg, int flags)
 
 EXPORT_SYMBOL_GPL (rpc_call_sync)
 
int rpc_call_async (struct rpc_clnt *clnt, const struct rpc_message *msg, int flags, const struct rpc_call_ops *tk_ops, void *data)
 
 EXPORT_SYMBOL_GPL (rpc_call_async)
 
void rpc_call_start (struct rpc_task *task)
 
 EXPORT_SYMBOL_GPL (rpc_call_start)
 
size_t rpc_peeraddr (struct rpc_clnt *clnt, struct sockaddr *buf, size_t bufsize)
 
 EXPORT_SYMBOL_GPL (rpc_peeraddr)
 
const charrpc_peeraddr2str (struct rpc_clnt *clnt, enum rpc_display_format_t format)
 
 EXPORT_SYMBOL_GPL (rpc_peeraddr2str)
 
int rpc_localaddr (struct rpc_clnt *clnt, struct sockaddr *buf, size_t buflen)
 
 EXPORT_SYMBOL_GPL (rpc_localaddr)
 
void rpc_setbufsize (struct rpc_clnt *clnt, unsigned int sndsize, unsigned int rcvsize)
 
 EXPORT_SYMBOL_GPL (rpc_setbufsize)
 
int rpc_protocol (struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_protocol)
 
struct netrpc_net_ns (struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_net_ns)
 
size_t rpc_max_payload (struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_max_payload)
 
void rpc_force_rebind (struct rpc_clnt *clnt)
 
 EXPORT_SYMBOL_GPL (rpc_force_rebind)
 
int rpc_restart_call_prepare (struct rpc_task *task)
 
 EXPORT_SYMBOL_GPL (rpc_restart_call_prepare)
 
int rpc_restart_call (struct rpc_task *task)
 
 EXPORT_SYMBOL_GPL (rpc_restart_call)
 
struct rpc_taskrpc_call_null (struct rpc_clnt *clnt, struct rpc_cred *cred, int flags)
 
 EXPORT_SYMBOL_GPL (rpc_call_null)
 

Macro Definition Documentation

#define dprint_status (   t)
Value:
dprintk("RPC: %5u %s (status %d)\n", t->tk_pid, \
__func__, t->tk_status)

Definition at line 48 of file clnt.c.

Function Documentation

EXPORT_SYMBOL_GPL ( rpc_create  )
EXPORT_SYMBOL_GPL ( rpc_clone_client  )
EXPORT_SYMBOL_GPL ( rpc_clone_client_set_auth  )
EXPORT_SYMBOL_GPL ( rpc_killall_tasks  )
EXPORT_SYMBOL_GPL ( rpc_shutdown_client  )
EXPORT_SYMBOL_GPL ( rpc_bind_new_program  )
EXPORT_SYMBOL_GPL ( rpc_task_reset_client  )
EXPORT_SYMBOL_GPL ( rpc_run_task  )
EXPORT_SYMBOL_GPL ( rpc_call_sync  )
EXPORT_SYMBOL_GPL ( rpc_call_async  )
EXPORT_SYMBOL_GPL ( rpc_call_start  )
EXPORT_SYMBOL_GPL ( rpc_peeraddr  )
EXPORT_SYMBOL_GPL ( rpc_peeraddr2str  )
EXPORT_SYMBOL_GPL ( rpc_localaddr  )
EXPORT_SYMBOL_GPL ( rpc_setbufsize  )
EXPORT_SYMBOL_GPL ( rpc_protocol  )
EXPORT_SYMBOL_GPL ( rpc_net_ns  )
EXPORT_SYMBOL_GPL ( rpc_max_payload  )
EXPORT_SYMBOL_GPL ( rpc_force_rebind  )
EXPORT_SYMBOL_GPL ( rpc_restart_call_prepare  )
EXPORT_SYMBOL_GPL ( rpc_restart_call  )
EXPORT_SYMBOL_GPL ( rpc_call_null  )
struct rpc_clnt* rpc_bind_new_program ( struct rpc_clnt old,
const struct rpc_program program,
u32  vers 
)
read

rpc_bind_new_program - bind a new RPC program to an existing client : old rpc_client : rpc program to set : rpc program version

Clones the rpc client and sets up a new RPC program. This is mainly of use for enabling different RPC programs to share the same transport. The Sun NFSv2/v3 ACL protocol can do this.

Definition at line 692 of file clnt.c.

int rpc_call_async ( struct rpc_clnt clnt,
const struct rpc_message msg,
int  flags,
const struct rpc_call_ops tk_ops,
void data 
)

rpc_call_async - Perform an asynchronous RPC call : pointer to RPC client : RPC call parameters : RPC call flags : RPC call ops : user call data

Definition at line 855 of file clnt.c.

struct rpc_task* rpc_call_null ( struct rpc_clnt clnt,
struct rpc_cred *  cred,
int  flags 
)
read

Definition at line 2198 of file clnt.c.

void rpc_call_start ( struct rpc_task task)

Definition at line 921 of file clnt.c.

int rpc_call_sync ( struct rpc_clnt clnt,
const struct rpc_message msg,
int  flags 
)

rpc_call_sync - Perform a synchronous RPC call : pointer to RPC client : RPC call parameters : RPC call flags

Definition at line 824 of file clnt.c.

int rpc_clients_notifier_register ( void  )

Definition at line 270 of file clnt.c.

void rpc_clients_notifier_unregister ( void  )

Definition at line 275 of file clnt.c.

struct rpc_clnt* rpc_clone_client ( struct rpc_clnt clnt)
read

rpc_clone_client - Clone an RPC client structure

: RPC client whose parameters are copied

Returns a fresh RPC client or an ERR_PTR.

Definition at line 538 of file clnt.c.

struct rpc_clnt* rpc_clone_client_set_auth ( struct rpc_clnt clnt,
rpc_authflavor_t  flavor 
)
read

rpc_clone_client_set_auth - Clone an RPC client structure and set its auth

: RPC client whose parameters are copied : security flavor for new client

Returns a fresh RPC client or an ERR_PTR.

Definition at line 560 of file clnt.c.

struct rpc_clnt* rpc_create ( struct rpc_create_args *  args)
read

rpc_create - create an RPC client and transport with one call : rpc_clnt create argument structure

Creates and initializes an RPC transport and an RPC client.

It can ping the server in order to determine if it is up, and to see if it supports this program and version. RPC_CLNT_CREATE_NOPING disables this behavior so asynchronous tasks can also use rpc_create.

Definition at line 398 of file clnt.c.

void rpc_force_rebind ( struct rpc_clnt clnt)

rpc_force_rebind - force transport to check that remote port is unchanged : client to rebind

Definition at line 1195 of file clnt.c.

void rpc_killall_tasks ( struct rpc_clnt clnt)

Definition at line 577 of file clnt.c.

int rpc_localaddr ( struct rpc_clnt clnt,
struct sockaddr buf,
size_t  buflen 
)

rpc_localaddr - discover local endpoint address for an RPC client : RPC client structure : target buffer : size of target buffer, in bytes

Returns zero and fills in "buf" and "buflen" if successful; otherwise, a negative errno is returned.

This works even if the underlying transport is not currently connected, or if the upper layer never previously provided a source address.

The result of this function call is transient: multiple calls in succession may give different results, depending on how local networking configuration changes over time.

Definition at line 1099 of file clnt.c.

size_t rpc_max_payload ( struct rpc_clnt clnt)

rpc_max_payload - Get maximum payload size for a transport, in bytes : RPC client to query

For stream transports, this is one RPC record fragment (see RFC 1831), as we don't support multi-record requests yet. For datagram transports, this is the size of an IP packet minus the IP, UDP, and RPC header sizes.

Definition at line 1179 of file clnt.c.

struct net* rpc_net_ns ( struct rpc_clnt clnt)
read

rpc_net_ns - Get the network namespace for this RPC client : RPC client to query

Definition at line 1159 of file clnt.c.

size_t rpc_peeraddr ( struct rpc_clnt clnt,
struct sockaddr buf,
size_t  bufsize 
)

rpc_peeraddr - extract remote peer address from clnt's xprt : RPC client structure : target buffer : length of target buffer

Returns the number of bytes that are actually in the stored address.

Definition at line 935 of file clnt.c.

const char* rpc_peeraddr2str ( struct rpc_clnt clnt,
enum rpc_display_format_t  format 
)

rpc_peeraddr2str - return remote peer address in printable format : RPC client structure : address format

NB: the lifetime of the memory referenced by the returned pointer is the same as the rpc_xprt itself. As long as the caller uses this pointer, it must hold the RCU read lock.

Definition at line 962 of file clnt.c.

int rpc_protocol ( struct rpc_clnt clnt)

rpc_protocol - Get transport protocol number for an RPC client : RPC client to query

Definition at line 1143 of file clnt.c.

void rpc_release_client ( struct rpc_clnt clnt)

Definition at line 672 of file clnt.c.

int rpc_restart_call ( struct rpc_task task)

Definition at line 1226 of file clnt.c.

int rpc_restart_call_prepare ( struct rpc_task task)

Definition at line 1210 of file clnt.c.

struct rpc_task* rpc_run_task ( const struct rpc_task_setup task_setup_data)
read

rpc_run_task - Allocate a new RPC task, then run rpc_execute against it : pointer to task initialisation data

Definition at line 797 of file clnt.c.

void rpc_setbufsize ( struct rpc_clnt clnt,
unsigned int  sndsize,
unsigned int  rcvsize 
)

Definition at line 1126 of file clnt.c.

void rpc_shutdown_client ( struct rpc_clnt clnt)

Definition at line 608 of file clnt.c.

void rpc_task_release_client ( struct rpc_task task)

Definition at line 721 of file clnt.c.

void rpc_task_reset_client ( struct rpc_task task,
struct rpc_clnt clnt 
)

Definition at line 761 of file clnt.c.