nfs-ganesha 1.4
|
The file that contain the 'worker_thread' routine for the nfsd. More...
#include <assert.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <pthread.h>
#include <fcntl.h>
#include <sys/file.h>
#include <sys/signal.h>
#include <poll.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_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 "nfs_tcb.h"
#include "SemN.h"
Go to the source code of this file.
The file that contain the 'worker_thread' routine for the nfsd.
Definition in file nfs_worker_thread.c.
#define DISP_LOCK | ( | x | ) |
do { \ if (! locked) { \ svc_dplx_lock_x(xprt, &pmydata->sigmask); \ locked = TRUE; \ }\ } while (0);
nfs_worker_process_rpc_requests: read and process a sequence of RPC requests.
Definition at line 1788 of file nfs_worker_thread.c.
#define DISP_UNLOCK | ( | x | ) |
do { \ if (locked) { \ svc_dplx_unlock_x(xprt, &pmydata->sigmask); \ locked = FALSE; \ }\ } while (0);
Definition at line 1795 of file nfs_worker_thread.c.
#define nlm4_Unsupported nlm_Null |
Definition at line 271 of file nfs_worker_thread.c.
#define nlm4_Unsupported_Free nlm_Null_Free |
Definition at line 272 of file nfs_worker_thread.c.
enum auth_stat AuthenticateRequest | ( | nfs_request_data_t * | nfsreq, |
bool_t * | no_dispatch | ||
) |
Definition at line 1642 of file nfs_worker_thread.c.
void DispatchWorkNFS | ( | request_data_t * | nfsreq, |
unsigned int | worker_index | ||
) |
Definition at line 1606 of file nfs_worker_thread.c.
int is_rpc_call_valid | ( | SVCXPRT * | xprt, |
struct svc_req * | preq | ||
) |
is_rpc_call_valid: helper function to validate rpc calls.
Definition at line 499 of file nfs_worker_thread.c.
int nfs_Init_gc_counter | ( | void | ) |
nfs_Init_gc_counter: Init the worker's gc counters.
This functions is used to init a mutex and a counter associated with it, to keep track of the number of worker currently performing the garbage collection.
void | No parameters |
Definition at line 461 of file nfs_worker_thread.c.
int nfs_Init_worker_data | ( | nfs_worker_data_t * | pdata | ) |
nfs_Init_worker_data: Init the data associated with a worker instance.
This function is used to init the nfs_worker_data for a worker thread. These data are used by the worker for RPC processing.
param | A structure of type nfs_worker_parameter_t with all the necessary information related to a worker |
pdata | Pointer to the data to be initialized. |
Definition at line 1573 of file nfs_worker_thread.c.
int nfs_rpc_get_args | ( | nfs_request_data_t * | preqnfs, |
const nfs_function_desc_t * | pfuncdesc | ||
) |
Definition at line 724 of file nfs_worker_thread.c.
const nfs_function_desc_t* nfs_rpc_get_funcdesc | ( | nfs_request_data_t * | preqnfs | ) |
Definition at line 664 of file nfs_worker_thread.c.
process_status_t nfs_worker_process_rpc_requests | ( | nfs_worker_data_t * | pmydata, |
request_data_t * | nfsreq | ||
) |
Definition at line 1803 of file nfs_worker_thread.c.
struct timeval time_diff | ( | struct timeval | time_from, |
struct timeval | time_to | ||
) | [read] |
Definition at line 476 of file nfs_worker_thread.c.
void* worker_thread | ( | void * | IndexArg | ) |
worker_thread: The main function for a worker thread
This is the body of the worker thread. Its starting arguments are located in global array worker_data. The argument is no pointer but the worker's index. It then uses this index to address its own worker data in the array.
IndexArg | the index for the worker thread, in fact an integer cast as a void * |
Definition at line 1966 of file nfs_worker_thread.c.
Definition at line 79 of file nfs_worker_thread.c.
{nfs_Null, nfs_Null_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_void, "invalid_function", NOTHING_SPECIAL}
Definition at line 86 of file nfs_worker_thread.c.
Definition at line 90 of file nfs_worker_thread.c.
Definition at line 80 of file nfs_worker_thread.c.
pthread_mutex_t lock_nb_current_gc_workers |
Definition at line 84 of file nfs_worker_thread.c.
const nfs_function_desc_t mnt1_func_desc[] |
{ {mnt_Null, mnt_Null_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_void, "mnt_Null", NOTHING_SPECIAL}, {mnt_Mnt, mnt1_Mnt_Free, (xdrproc_t) xdr_dirpath, (xdrproc_t) xdr_fhstatus2, "mnt_Mnt", NEEDS_CRED}, {mnt_Dump, mnt_Dump_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_mountlist, "mnt_Dump", NOTHING_SPECIAL}, {mnt_Umnt, mnt_Umnt_Free, (xdrproc_t) xdr_dirpath, (xdrproc_t) xdr_void, "mnt_Umnt", NOTHING_SPECIAL}, {mnt_UmntAll, mnt_UmntAll_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_void, "mnt_UmntAll", NOTHING_SPECIAL}, {mnt_Export, mnt_Export_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_exports, "mnt_Export", NOTHING_SPECIAL} }
Definition at line 229 of file nfs_worker_thread.c.
const nfs_function_desc_t mnt3_func_desc[] |
{ {mnt_Null, mnt_Null_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_void, "mnt_Null", NOTHING_SPECIAL}, {mnt_Mnt, mnt3_Mnt_Free, (xdrproc_t) xdr_dirpath, (xdrproc_t) xdr_mountres3, "mnt_Mnt", NEEDS_CRED}, {mnt_Dump, mnt_Dump_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_mountlist, "mnt_Dump", NOTHING_SPECIAL}, {mnt_Umnt, mnt_Umnt_Free, (xdrproc_t) xdr_dirpath, (xdrproc_t) xdr_void, "mnt_Umnt", NOTHING_SPECIAL}, {mnt_UmntAll, mnt_UmntAll_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_void, "mnt_UmntAll", NOTHING_SPECIAL}, {mnt_Export, mnt_Export_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_exports, "mnt_Export", NOTHING_SPECIAL} }
Definition at line 250 of file nfs_worker_thread.c.
unsigned int nb_current_gc_workers |
Definition at line 83 of file nfs_worker_thread.c.
const nfs_function_desc_t nfs2_func_desc[] |
Definition at line 93 of file nfs_worker_thread.c.
const nfs_function_desc_t nfs3_func_desc[] |
Definition at line 150 of file nfs_worker_thread.c.
const nfs_function_desc_t nfs4_func_desc[] |
{ {nfs_Null, nfs_Null_Free, (xdrproc_t) xdr_void, (xdrproc_t) xdr_void, "nfs_Null", NOTHING_SPECIAL}, {nfs4_Compound, nfs4_Compound_Free, (xdrproc_t) xdr_COMPOUND4args, (xdrproc_t) xdr_COMPOUND4res, "nfs4_Compound", NEEDS_CRED} }
Definition at line 221 of file nfs_worker_thread.c.
const char* pause_state_str[] |
Definition at line 78 of file nfs_worker_thread.c.
Definition at line 77 of file nfs_worker_thread.c.
Definition at line 93 of file nfs_init.c.