Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
nfs4state.c File Reference
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/namei.h>
#include <linux/swap.h>
#include <linux/pagemap.h>
#include <linux/ratelimit.h>
#include <linux/sunrpc/svcauth_gss.h>
#include <linux/sunrpc/clnt.h>
#include "xdr4.h"
#include "vfs.h"
#include "current_stateid.h"
#include "fault_inject.h"
#include "netns.h"

Go to the source code of this file.

Macros

#define NFSDDBG_FACILITY   NFSDDBG_PROC
 
#define all_ones   {{~0,~0},~0}
 
#define ZERO_STATEID(stateid)   (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))
 
#define ONE_STATEID(stateid)   (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))
 
#define CURRENT_STATEID(stateid)   (!memcmp((stateid), &currentstateid, sizeof(stateid_t)))
 
#define OWNER_HASH_BITS   8
 
#define OWNER_HASH_SIZE   (1 << OWNER_HASH_BITS)
 
#define OWNER_HASH_MASK   (OWNER_HASH_SIZE - 1)
 
#define FILE_HASH_BITS   8
 
#define FILE_HASH_SIZE   (1 << FILE_HASH_BITS)
 
#define CLIENT_HASH_BITS   4
 
#define CLIENT_HASH_SIZE   (1 << CLIENT_HASH_BITS)
 
#define CLIENT_HASH_MASK   (CLIENT_HASH_SIZE - 1)
 
#define SESSION_HASH_SIZE   512
 
#define NFSD_MIN_HDR_SEQ_SZ   (24 + 12 + 44)
 
#define NFSD_MIN_REQ_HDR_SEQ_SZ
 
#define NFSD_MIN_RESP_HDR_SEQ_SZ
 
#define LOFF_OVERFLOW(start, len)   ((u64)(len) > ~(u64)(start))
 
#define LOCKOWNER_INO_HASH_BITS   8
 
#define LOCKOWNER_INO_HASH_SIZE   (1 << LOCKOWNER_INO_HASH_BITS)
 
#define LOCKOWNER_INO_HASH_MASK   (LOCKOWNER_INO_HASH_SIZE - 1)
 

Functions

void nfs4_lock_state (void)
 
void nfs4_unlock_state (void)
 
void nfs4_put_delegation (struct nfs4_delegation *dp)
 
void nfsd4_put_session (struct nfsd4_session *ses)
 
void release_session_client (struct nfsd4_session *session)
 
void nfsd4_store_cache_entry (struct nfsd4_compoundres *resp)
 
__be32 nfsd4_replay_cache_entry (struct nfsd4_compoundres *resp, struct nfsd4_sequence *seq)
 
__be32 nfsd4_exchange_id (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_exchange_id *exid)
 
__be32 nfsd4_create_session (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_create_session *cr_ses)
 
__be32 nfsd4_bind_conn_to_session (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_bind_conn_to_session *bcts)
 
__be32 nfsd4_destroy_session (struct svc_rqst *r, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_session *sessionid)
 
__be32 nfsd4_sequence (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_sequence *seq)
 
__be32 nfsd4_destroy_clientid (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_destroy_clientid *dc)
 
__be32 nfsd4_reclaim_complete (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_reclaim_complete *rc)
 
__be32 nfsd4_setclientid (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_setclientid *setclid)
 
__be32 nfsd4_setclientid_confirm (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_setclientid_confirm *setclientid_confirm)
 
void nfsd4_free_slabs (void)
 
int nfsd4_init_slabs (void)
 
void nfs4_free_openowner (struct nfs4_openowner *oo)
 
void nfs4_free_lockowner (struct nfs4_lockowner *lo)
 
__be32 nfsd4_process_open1 (struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
 
__be32 nfsd4_process_open2 (struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
 
void nfsd4_cleanup_open_state (struct nfsd4_open *open, __be32 status)
 
__be32 nfsd4_renew (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, clientid_t *clid)
 
__be32 nfs4_preprocess_stateid_op (struct net *net, struct nfsd4_compound_state *cstate, stateid_t *stateid, int flags, struct file **filpp)
 
__be32 nfsd4_test_stateid (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_test_stateid *test_stateid)
 
__be32 nfsd4_free_stateid (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_free_stateid *free_stateid)
 
__be32 nfsd4_open_confirm (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open_confirm *oc)
 
__be32 nfsd4_open_downgrade (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *od)
 
void nfsd4_purge_closed_stateid (struct nfs4_stateowner *so)
 
__be32 nfsd4_close (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
 
__be32 nfsd4_delegreturn (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_delegreturn *dr)
 
__be32 nfsd4_lock (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_lock *lock)
 
__be32 nfsd4_lockt (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_lockt *lockt)
 
__be32 nfsd4_locku (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_locku *locku)
 
__be32 nfsd4_release_lockowner (struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, struct nfsd4_release_lockowner *rlockowner)
 
int nfs4_has_reclaimed_state (const char *name, bool use_exchange_id)
 
int nfs4_client_to_reclaim (const char *name)
 
void nfs4_release_reclaim (void)
 
struct nfs4_client_reclaimnfsd4_find_reclaim_client (struct nfs4_client *clp)
 
__be32 nfs4_check_open_reclaim (clientid_t *clid, bool sessions)
 
void nfs4_state_init (void)
 
int nfs4_state_start (void)
 
void nfs4_state_shutdown (void)
 
void clear_current_stateid (struct nfsd4_compound_state *cstate)
 
void nfsd4_set_opendowngradestateid (struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp)
 
void nfsd4_set_openstateid (struct nfsd4_compound_state *cstate, struct nfsd4_open *open)
 
void nfsd4_set_closestateid (struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
 
void nfsd4_set_lockstateid (struct nfsd4_compound_state *cstate, struct nfsd4_lock *lock)
 
void nfsd4_get_opendowngradestateid (struct nfsd4_compound_state *cstate, struct nfsd4_open_downgrade *odp)
 
void nfsd4_get_delegreturnstateid (struct nfsd4_compound_state *cstate, struct nfsd4_delegreturn *drp)
 
void nfsd4_get_freestateid (struct nfsd4_compound_state *cstate, struct nfsd4_free_stateid *fsp)
 
void nfsd4_get_setattrstateid (struct nfsd4_compound_state *cstate, struct nfsd4_setattr *setattr)
 
void nfsd4_get_closestateid (struct nfsd4_compound_state *cstate, struct nfsd4_close *close)
 
void nfsd4_get_lockustateid (struct nfsd4_compound_state *cstate, struct nfsd4_locku *locku)
 
void nfsd4_get_readstateid (struct nfsd4_compound_state *cstate, struct nfsd4_read *read)
 
void nfsd4_get_writestateid (struct nfsd4_compound_state *cstate, struct nfsd4_write *write)
 

Variables

time_t nfsd4_lease = 90
 
time_t nfsd4_grace = 90
 
unsigned int max_delegations
 

Macro Definition Documentation

#define all_ones   {{~0,~0},~0}

Definition at line 57 of file nfs4state.c.

#define CLIENT_HASH_BITS   4

Definition at line 397 of file nfs4state.c.

#define CLIENT_HASH_MASK   (CLIENT_HASH_SIZE - 1)

Definition at line 399 of file nfs4state.c.

#define CLIENT_HASH_SIZE   (1 << CLIENT_HASH_BITS)

Definition at line 398 of file nfs4state.c.

#define CURRENT_STATEID (   stateid)    (!memcmp((stateid), &currentstateid, sizeof(stateid_t)))

Definition at line 73 of file nfs4state.c.

#define FILE_HASH_BITS   8

Definition at line 182 of file nfs4state.c.

#define FILE_HASH_SIZE   (1 << FILE_HASH_BITS)

Definition at line 183 of file nfs4state.c.

#define LOCKOWNER_INO_HASH_BITS   8

Definition at line 3836 of file nfs4state.c.

#define LOCKOWNER_INO_HASH_MASK   (LOCKOWNER_INO_HASH_SIZE - 1)

Definition at line 3838 of file nfs4state.c.

#define LOCKOWNER_INO_HASH_SIZE   (1 << LOCKOWNER_INO_HASH_BITS)

Definition at line 3837 of file nfs4state.c.

#define LOFF_OVERFLOW (   start,
  len 
)    ((u64)(len) > ~(u64)(start))

Definition at line 3834 of file nfs4state.c.

#define NFSD_MIN_HDR_SEQ_SZ   (24 + 12 + 44)

Definition at line 705 of file nfs4state.c.

#define NFSD_MIN_REQ_HDR_SEQ_SZ
Value:
((\
2 * 2 + /* credential,verifier: AUTH_NULL, length 0 */ \
1 + /* MIN tag is length with zero, only length */ \
3 + /* version, opcount, opcode */ \
XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + \
/* seqid, slotID, slotID, cache */ \
4 ) * sizeof(__be32))

Definition at line 1730 of file nfs4state.c.

#define NFSD_MIN_RESP_HDR_SEQ_SZ
Value:
((\
2 + /* verifier: AUTH_NULL, length 0 */\
1 + /* status */ \
1 + /* MIN tag is length with zero, only length */ \
3 + /* opcount, opcode, opstatus*/ \
XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + \
/* seqid, slotID, slotID, slotID, status */ \
5 ) * sizeof(__be32))

Definition at line 1738 of file nfs4state.c.

#define NFSDDBG_FACILITY   NFSDDBG_PROC

Definition at line 51 of file nfs4state.c.

#define ONE_STATEID (   stateid)    (!memcmp((stateid), &one_stateid, sizeof(stateid_t)))

Definition at line 72 of file nfs4state.c.

#define OWNER_HASH_BITS   8

Definition at line 166 of file nfs4state.c.

#define OWNER_HASH_MASK   (OWNER_HASH_SIZE - 1)

Definition at line 168 of file nfs4state.c.

#define OWNER_HASH_SIZE   (1 << OWNER_HASH_BITS)

Definition at line 167 of file nfs4state.c.

#define SESSION_HASH_SIZE   512

Definition at line 655 of file nfs4state.c.

#define ZERO_STATEID (   stateid)    (!memcmp((stateid), &zero_stateid, sizeof(stateid_t)))

Definition at line 71 of file nfs4state.c.

Function Documentation

void clear_current_stateid ( struct nfsd4_compound_state cstate)

Definition at line 4846 of file nfs4state.c.

__be32 nfs4_check_open_reclaim ( clientid_t clid,
bool  sessions 
)

Definition at line 4546 of file nfs4state.c.

int nfs4_client_to_reclaim ( const char name)

Definition at line 4485 of file nfs4state.c.

void nfs4_free_lockowner ( struct nfs4_lockowner lo)

Definition at line 2371 of file nfs4state.c.

void nfs4_free_openowner ( struct nfs4_openowner oo)

Definition at line 2365 of file nfs4state.c.

int nfs4_has_reclaimed_state ( const char name,
bool  use_exchange_id 
)

Definition at line 4470 of file nfs4state.c.

void nfs4_lock_state ( void  )

Definition at line 97 of file nfs4state.c.

__be32 nfs4_preprocess_stateid_op ( struct net net,
struct nfsd4_compound_state cstate,
stateid_t stateid,
int  flags,
struct file **  filpp 
)

Definition at line 3411 of file nfs4state.c.

void nfs4_put_delegation ( struct nfs4_delegation dp)

Definition at line 348 of file nfs4state.c.

void nfs4_release_reclaim ( void  )

Definition at line 4503 of file nfs4state.c.

void nfs4_state_init ( void  )

Definition at line 4685 of file nfs4state.c.

void nfs4_state_shutdown ( void  )

Definition at line 4815 of file nfs4state.c.

int nfs4_state_start ( void  )

Definition at line 4736 of file nfs4state.c.

void nfs4_unlock_state ( void  )

Definition at line 116 of file nfs4state.c.

Definition at line 1868 of file nfs4state.c.

void nfsd4_cleanup_open_state ( struct nfsd4_open open,
__be32  status 
)

Definition at line 3086 of file nfs4state.c.

Definition at line 3757 of file nfs4state.c.

Definition at line 1754 of file nfs4state.c.

Definition at line 3804 of file nfs4state.c.

Definition at line 2103 of file nfs4state.c.

Definition at line 1907 of file nfs4state.c.

Definition at line 1569 of file nfs4state.c.

struct nfs4_client_reclaim* nfsd4_find_reclaim_client ( struct nfs4_client clp)
read

Definition at line 4523 of file nfs4state.c.

void nfsd4_free_slabs ( void  )

Definition at line 2326 of file nfs4state.c.

Definition at line 3503 of file nfs4state.c.

void nfsd4_get_closestateid ( struct nfsd4_compound_state cstate,
struct nfsd4_close close 
)

Definition at line 4907 of file nfs4state.c.

void nfsd4_get_delegreturnstateid ( struct nfsd4_compound_state cstate,
struct nfsd4_delegreturn drp 
)

Definition at line 4889 of file nfs4state.c.

void nfsd4_get_freestateid ( struct nfsd4_compound_state cstate,
struct nfsd4_free_stateid fsp 
)

Definition at line 4895 of file nfs4state.c.

void nfsd4_get_lockustateid ( struct nfsd4_compound_state cstate,
struct nfsd4_locku locku 
)

Definition at line 4913 of file nfs4state.c.

void nfsd4_get_opendowngradestateid ( struct nfsd4_compound_state cstate,
struct nfsd4_open_downgrade odp 
)

Definition at line 4883 of file nfs4state.c.

void nfsd4_get_readstateid ( struct nfsd4_compound_state cstate,
struct nfsd4_read read 
)

Definition at line 4919 of file nfs4state.c.

void nfsd4_get_setattrstateid ( struct nfsd4_compound_state cstate,
struct nfsd4_setattr setattr 
)

Definition at line 4901 of file nfs4state.c.

void nfsd4_get_writestateid ( struct nfsd4_compound_state cstate,
struct nfsd4_write write 
)

Definition at line 4925 of file nfs4state.c.

int nfsd4_init_slabs ( void  )

Definition at line 2336 of file nfs4state.c.

Definition at line 4055 of file nfs4state.c.

Definition at line 4234 of file nfs4state.c.

Definition at line 4308 of file nfs4state.c.

Definition at line 3605 of file nfs4state.c.

Definition at line 3682 of file nfs4state.c.

__be32 nfsd4_process_open1 ( struct nfsd4_compound_state cstate,
struct nfsd4_open open 
)

Definition at line 2601 of file nfs4state.c.

__be32 nfsd4_process_open2 ( struct svc_rqst rqstp,
struct svc_fh current_fh,
struct nfsd4_open open 
)

Definition at line 2990 of file nfs4state.c.

void nfsd4_purge_closed_stateid ( struct nfs4_stateowner so)

Definition at line 3727 of file nfs4state.c.

void nfsd4_put_session ( struct nfsd4_session ses)

Definition at line 916 of file nfs4state.c.

Definition at line 2140 of file nfs4state.c.

Definition at line 4405 of file nfs4state.c.

__be32 nfsd4_renew ( struct svc_rqst rqstp,
struct nfsd4_compound_state cstate,
clientid_t clid 
)

Definition at line 3108 of file nfs4state.c.

__be32 nfsd4_replay_cache_entry ( struct nfsd4_compoundres resp,
struct nfsd4_sequence seq 
)

Definition at line 1516 of file nfs4state.c.

Definition at line 2000 of file nfs4state.c.

void nfsd4_set_closestateid ( struct nfsd4_compound_state cstate,
struct nfsd4_close close 
)

Definition at line 4867 of file nfs4state.c.

void nfsd4_set_lockstateid ( struct nfsd4_compound_state cstate,
struct nfsd4_lock lock 
)

Definition at line 4873 of file nfs4state.c.

void nfsd4_set_opendowngradestateid ( struct nfsd4_compound_state cstate,
struct nfsd4_open_downgrade odp 
)

Definition at line 4855 of file nfs4state.c.

void nfsd4_set_openstateid ( struct nfsd4_compound_state cstate,
struct nfsd4_open open 
)

Definition at line 4861 of file nfs4state.c.

Definition at line 2179 of file nfs4state.c.

Definition at line 2238 of file nfs4state.c.

void nfsd4_store_cache_entry ( struct nfsd4_compoundres resp)

Definition at line 1460 of file nfs4state.c.

Definition at line 3487 of file nfs4state.c.

void release_session_client ( struct nfsd4_session session)

Definition at line 1092 of file nfs4state.c.

Variable Documentation

unsigned int max_delegations

Definition at line 159 of file nfs4state.c.

time_t nfsd4_grace = 90

Definition at line 55 of file nfs4state.c.

time_t nfsd4_lease = 90

Definition at line 54 of file nfs4state.c.