nfs-ganesha 1.4
Classes | Defines | Typedefs | Functions | Variables

nfs_rpc_dispatcher_thread.c File Reference

#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/file.h>
#include <sys/select.h>
#include <poll.h>
#include <assert.h>
#include "HashData.h"
#include "HashTable.h"
#include "log.h"
#include "ganesha_rpc.h"
#include "nfs23.h"
#include "nfs4.h"
#include "mount.h"
#include "nlm4.h"
#include "rquota.h"
#include "nfs_init.h"
#include "nfs_core.h"
#include "cache_inode.h"
#include "nfs_exports.h"
#include "nfs_creds.h"
#include "nfs_proto_functions.h"
#include "nfs_dupreq.h"
#include "nfs_file_handle.h"
#include "nfs_stat.h"
#include "SemN.h"
#include "nfs_tcb.h"

Go to the source code of this file.

Classes

struct  rpc_evchan
struct  proto_data

Defines

#define P_FAMILY   AF_INET
#define N_TCP_EVENT_CHAN   3
#define UDP_EVENT_CHAN   0
#define TCP_RDVS_CHAN   1
#define TCP_EVCHAN_0   2
#define N_EVENT_CHAN   N_TCP_EVENT_CHAN + 2
#define test_for_additional_nfs_protocols(p)
#define UDP_REGISTER(prot, vers, netconfig)
#define TCP_REGISTER(prot, vers, netconfig)
#define TIRPC_SET_ALLOCATORS   0
#define NO_VALUE_CHOOSEN   1000000

Typedefs

typedef struct proto_data proto_data

Functions

void nfs_rpc_dispatch_dummy (struct svc_req *ptr_req, SVCXPRT *ptr_svc)
void Create_udp (protos prot)
void Create_tcp (protos prot)
void Create_SVCXPRTs (void)
void Bind_sockets (void)
void Clean_RPC (void)
void Register_program (protos prot, int flag, int vers)
void nfs_Init_svc ()
void nfs_rpc_dispatch_threads (pthread_attr_t *attr_thr)
unsigned int nfs_core_select_worker_queue (unsigned int avoid_index)
request_data_tnfs_rpc_get_nfsreq (nfs_worker_data_t *worker, uint32_t flags)
process_status_t dispatch_rpc_subrequest (nfs_worker_data_t *mydata, request_data_t *onfsreq)
process_status_t dispatch_rpc_request (SVCXPRT *xprt)
int print_pending_request (LRU_data_t data, char *str)
void * rpc_dispatcher_thread (void *arg)
void constructor_nfs_request_data_t (void *ptr, void *parameters)
void constructor_request_data_t (void *ptr, void *parameters)

Variables

const char * tags []
proto_data pdata [P_COUNT]
struct netconfig * netconfig_udpv4
struct netconfig * netconfig_tcpv4
int udp_socket [P_COUNT]
int tcp_socket [P_COUNT]
SVCXPRT * udp_xprt [P_COUNT]
SVCXPRT * tcp_xprt [P_COUNT]
cleanup_list_element clean_rpc = {NULL, Clean_RPC}

Define Documentation

#define N_EVENT_CHAN   N_TCP_EVENT_CHAN + 2

Definition at line 95 of file nfs_rpc_dispatcher_thread.c.

#define N_TCP_EVENT_CHAN   3

Definition at line 90 of file nfs_rpc_dispatcher_thread.c.

#define NO_VALUE_CHOOSEN   1000000
#define P_FAMILY   AF_INET

Definition at line 75 of file nfs_rpc_dispatcher_thread.c.

#define TCP_EVCHAN_0   2

Definition at line 94 of file nfs_rpc_dispatcher_thread.c.

#define TCP_RDVS_CHAN   1

Definition at line 93 of file nfs_rpc_dispatcher_thread.c.

#define TCP_REGISTER (   prot,
  vers,
  netconfig 
)
Value:
svc_register(tcp_xprt[prot], nfs_param.core_param.program[prot], (u_long) vers, \
                 nfs_rpc_dispatch_dummy, IPPROTO_TCP)

Definition at line 415 of file nfs_rpc_dispatcher_thread.c.

#define test_for_additional_nfs_protocols (   p)
Value:

Definition at line 198 of file nfs_rpc_dispatcher_thread.c.

#define TIRPC_SET_ALLOCATORS   0
#define UDP_EVENT_CHAN   0

Definition at line 92 of file nfs_rpc_dispatcher_thread.c.

#define UDP_REGISTER (   prot,
  vers,
  netconfig 
)
Value:
svc_register(udp_xprt[prot], nfs_param.core_param.program[prot], (u_long) vers, \
                 nfs_rpc_dispatch_dummy, IPPROTO_UDP)

Definition at line 411 of file nfs_rpc_dispatcher_thread.c.


Typedef Documentation

typedef struct proto_data proto_data

Function Documentation

void Bind_sockets ( void  )

Bind_sockets: bind the udp and tcp sockets.

Definition at line 325 of file nfs_rpc_dispatcher_thread.c.

void Clean_RPC ( void  )

Definition at line 402 of file nfs_rpc_dispatcher_thread.c.

void constructor_nfs_request_data_t ( void *  ptr,
void *  parameters 
)

constructor_nfs_request_data_t: Constructor for a nfs_request_data_t structure

This function is used to init the nfs_request_data for a worker. These data are used by the worker for RPC processing.

Parameters:
ptrvoid pointer to the structure to be managed
Returns:
nothing (void function) will exit the program if failed.

Definition at line 1191 of file nfs_rpc_dispatcher_thread.c.

void constructor_request_data_t ( void *  ptr,
void *  parameters 
)

constructor_request_data_t: Constructor for a request_data_t structure

This function is used to init the request_data for a worker. These data are used by the worker for RPC processing.

Parameters:
ptrvoid pointer to the structure to be managed
Returns:
nothing (void function) will exit the program if failed.

Definition at line 1208 of file nfs_rpc_dispatcher_thread.c.

void Create_SVCXPRTs ( void  )

Create_SVCXPRTs: Create the SVCXPRT for each protocol in use.

Definition at line 308 of file nfs_rpc_dispatcher_thread.c.

void Create_tcp ( protos  prot)

Definition at line 257 of file nfs_rpc_dispatcher_thread.c.

void Create_udp ( protos  prot)

Definition at line 227 of file nfs_rpc_dispatcher_thread.c.

process_status_t dispatch_rpc_request ( SVCXPRT *  xprt)

process_rpc_request: process an RPC request.

Definition at line 957 of file nfs_rpc_dispatcher_thread.c.

process_status_t dispatch_rpc_subrequest ( nfs_worker_data_t mydata,
request_data_t onfsreq 
)

Definition at line 886 of file nfs_rpc_dispatcher_thread.c.

unsigned int nfs_core_select_worker_queue ( unsigned int  avoid_index)

Definition at line 805 of file nfs_rpc_dispatcher_thread.c.

void nfs_Init_svc ( void  )

nfs_Init_svc: Init the svc descriptors for the nfs daemon.

Perform all the required initialization for the RPC subsystem and event channels.

Parameters:
attr_thrpointer to a set of pre-initialized pthread attributes that should be used for new threads

Definition at line 475 of file nfs_rpc_dispatcher_thread.c.

void nfs_rpc_dispatch_dummy ( struct svc_req *  ptr_req,
SVCXPRT *  ptr_svc 
)

nfs_rpc_dispatch_dummy: Function never called, but the symbol is needed for svc_register.

Parameters:
ptr_reqthe RPC request to be managed
ptr_svcSVCXPRT pointer to be used for managing this request
Returns:
nothing (void function) and is never called indeed.

Definition at line 115 of file nfs_rpc_dispatcher_thread.c.

void nfs_rpc_dispatch_threads ( pthread_attr_t *  attr_thr)

Definition at line 693 of file nfs_rpc_dispatcher_thread.c.

request_data_t* nfs_rpc_get_nfsreq ( nfs_worker_data_t worker,
uint32_t  flags 
)

nfs_rpc_get_nfsreq: get a request frame (call or svc request)

Definition at line 876 of file nfs_rpc_dispatcher_thread.c.

int print_pending_request ( LRU_data_t  data,
char *  str 
)

print_pending_request: prints an entry related to a pending request in the LRU list.

prints an entry related to a pending request in the LRU list.

Parameters:
data[IN] data stored in a LRU entry to be printed.
str[OUT] string used to store the result.
Returns:
0 if ok, other values mean an error.

Definition at line 1146 of file nfs_rpc_dispatcher_thread.c.

void Register_program ( protos  prot,
int  flag,
int  vers 
)

Definition at line 419 of file nfs_rpc_dispatcher_thread.c.

void* rpc_dispatcher_thread ( void *  arg)

rpc_dispatcher_thread

Thread used to service an (epoll, etc) event channel.

Parameters:
arg,pointsto the id of the associated event channel
Returns:
Pointer to the result (but this function will mostly loop forever).

Definition at line 1161 of file nfs_rpc_dispatcher_thread.c.


Variable Documentation

cleanup_list_element clean_rpc = {NULL, Clean_RPC}

Definition at line 409 of file nfs_rpc_dispatcher_thread.c.

struct netconfig* netconfig_tcpv4

Definition at line 151 of file nfs_rpc_dispatcher_thread.c.

struct netconfig* netconfig_udpv4

Definition at line 150 of file nfs_rpc_dispatcher_thread.c.

proto_data pdata[P_COUNT]

Definition at line 148 of file nfs_rpc_dispatcher_thread.c.

const char* tags[]
Initial value:
 {
  "NFS",
  "MNT",






}

Definition at line 122 of file nfs_rpc_dispatcher_thread.c.

int tcp_socket[P_COUNT]

Definition at line 159 of file nfs_rpc_dispatcher_thread.c.

SVCXPRT* tcp_xprt[P_COUNT]

Definition at line 161 of file nfs_rpc_dispatcher_thread.c.

int udp_socket[P_COUNT]

Definition at line 158 of file nfs_rpc_dispatcher_thread.c.

SVCXPRT* udp_xprt[P_COUNT]

Definition at line 160 of file nfs_rpc_dispatcher_thread.c.