nfs-ganesha 1.4
|
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include "log.h"
#include "ganesha_rpc.h"
#include "nlm4.h"
#include "sal_functions.h"
#include "nlm_util.h"
#include "nsm.h"
#include "nlm_async.h"
#include "nfs_core.h"
#include "nfs_tcb.h"
Go to the source code of this file.
Classes | |
struct | granted_cookie_t |
Defines | |
#define | NLM4_GRACE_PERIOD 10 |
#define | NLM4_CLIENT_GRACE_PERIOD 3 |
Typedefs | |
typedef struct granted_cookie_t | granted_cookie_t |
Functions | |
void | next_granted_cookie (granted_cookie_t *cookie) |
const char * | lock_result_str (int rc) |
uint64_t | lock_end (uint64_t start, uint64_t len) |
bool_t | fill_netobj (netobj *dst, char *data, int len) |
netobj * | copy_netobj (netobj *dst, netobj *src) |
void | netobj_free (netobj *obj) |
void | netobj_to_string (netobj *obj, char *buffer, int maxlen) |
void | nlm_init (void) |
void | free_grant_arg (state_async_queue_t *arg) |
int | nlm_process_parameters (struct svc_req *preq, bool_t exclusive, nlm4_lock *alock, fsal_lock_param_t *plock, cache_entry_t **ppentry, fsal_op_context_t *pcontext, care_t care, state_nsm_client_t **ppnsm_client, state_nlm_client_t **ppnlm_client, state_owner_t **ppowner, state_block_data_t **ppblock_data) |
int | nlm_process_share_parms (struct svc_req *preq, nlm4_share *share, cache_entry_t **ppentry, fsal_op_context_t *pcontext, care_t care, state_nsm_client_t **ppnsm_client, state_nlm_client_t **ppnlm_client, state_owner_t **ppowner) |
void | nlm_process_conflict (nlm4_holder *nlm_holder, state_owner_t *holder, fsal_lock_param_t *conflict) |
nlm4_stats | nlm_convert_state_error (state_status_t status) |
bool_t | nlm_block_data_to_fsal_context (state_block_data_t *block_data, fsal_op_context_t *fsal_context) |
state_status_t | nlm_granted_callback (cache_entry_t *pentry, state_lock_entry_t *lock_entry, state_status_t *pstatus) |
Variables | |
granted_cookie_t | granted_cookie |
pthread_mutex_t | granted_mutex = PTHREAD_MUTEX_INITIALIZER |
#define NLM4_CLIENT_GRACE_PERIOD 3 |
Definition at line 52 of file nlm_util.c.
#define NLM4_GRACE_PERIOD 10 |
Definition at line 47 of file nlm_util.c.
typedef struct granted_cookie_t granted_cookie_t |
netobj* copy_netobj | ( | netobj * | dst, |
netobj * | src | ||
) |
Definition at line 119 of file nlm_util.c.
bool_t fill_netobj | ( | netobj * | dst, |
char * | data, | ||
int | len | ||
) |
Definition at line 101 of file nlm_util.c.
void free_grant_arg | ( | state_async_queue_t * | arg | ) |
Definition at line 164 of file nlm_util.c.
Definition at line 93 of file nlm_util.c.
const char* lock_result_str | ( | int | rc | ) |
Definition at line 75 of file nlm_util.c.
void netobj_free | ( | netobj * | obj | ) |
Definition at line 138 of file nlm_util.c.
void netobj_to_string | ( | netobj * | obj, |
char * | buffer, | ||
int | maxlen | ||
) |
Definition at line 144 of file nlm_util.c.
void next_granted_cookie | ( | granted_cookie_t * | cookie | ) |
Definition at line 67 of file nlm_util.c.
bool_t nlm_block_data_to_fsal_context | ( | state_block_data_t * | block_data, |
fsal_op_context_t * | fsal_context | ||
) |
Definition at line 587 of file nlm_util.c.
nlm4_stats nlm_convert_state_error | ( | state_status_t | status | ) |
Definition at line 568 of file nlm_util.c.
state_status_t nlm_granted_callback | ( | cache_entry_t * | pentry, |
state_lock_entry_t * | lock_entry, | ||
state_status_t * | pstatus | ||
) |
Definition at line 656 of file nlm_util.c.
void nlm_init | ( | void | ) |
Definition at line 153 of file nlm_util.c.
void nlm_process_conflict | ( | nlm4_holder * | nlm_holder, |
state_owner_t * | holder, | ||
fsal_lock_param_t * | conflict | ||
) |
Definition at line 523 of file nlm_util.c.
int nlm_process_parameters | ( | struct svc_req * | preq, |
bool_t | exclusive, | ||
nlm4_lock * | alock, | ||
fsal_lock_param_t * | plock, | ||
cache_entry_t ** | ppentry, | ||
fsal_op_context_t * | pcontext, | ||
care_t | care, | ||
state_nsm_client_t ** | ppnsm_client, | ||
state_nlm_client_t ** | ppnlm_client, | ||
state_owner_t ** | ppowner, | ||
state_block_data_t ** | ppblock_data | ||
) |
process_nlm_parameters: Process NLM parameters
Returns -1 for a request that needs processing, otherwise returns an NLM status
preq: passed in so interface doesn't need to change when NLM Client uses IP address exclusive: TRUE if lock is a write lock alock: nlm4_lock request structure plock: cache_lock_desc_t to fill in from alock ppentry: cache inode entry pointer to fill in pcontext: FSAL op context pclient: cache inode client care: TRUE if this caller cares if an owner is found (otherwise return NLM4_GRANTED because the caller will have nothing to do) ppnlm_client: NLM Client to fill in, returns a reference to the client ppowner: NLM Owner to fill in, returns a reference to the owner ppblock_data: Data required to make a call back to the client to grant a blocked lock
Definition at line 262 of file nlm_util.c.
int nlm_process_share_parms | ( | struct svc_req * | preq, |
nlm4_share * | share, | ||
cache_entry_t ** | ppentry, | ||
fsal_op_context_t * | pcontext, | ||
care_t | care, | ||
state_nsm_client_t ** | ppnsm_client, | ||
state_nlm_client_t ** | ppnlm_client, | ||
state_owner_t ** | ppowner | ||
) |
Definition at line 415 of file nlm_util.c.
Definition at line 64 of file nlm_util.c.
pthread_mutex_t granted_mutex = PTHREAD_MUTEX_INITIALIZER |
Definition at line 65 of file nlm_util.c.