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/kernel.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_idmap.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/random.h>
#include <linux/ratelimit.h>
#include <linux/workqueue.h>
#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <linux/sunrpc/clnt.h>
#include "nfs4_fs.h"
#include "callback.h"
#include "delegation.h"
#include "internal.h"
#include "pnfs.h"
#include "netns.h"

Go to the source code of this file.

Macros

#define NFSDBG_FACILITY   NFSDBG_STATE
 
#define OPENOWNER_POOL_SIZE   8
 

Functions

int nfs4_init_clientid (struct nfs_client *clp, struct rpc_cred *cred)
 
int nfs40_discover_server_trunking (struct nfs_client *clp, struct nfs_client **result, struct rpc_cred *cred)
 
struct rpc_cred * nfs4_get_machine_cred_locked (struct nfs_client *clp)
 
struct rpc_cred * nfs4_get_renew_cred_locked (struct nfs_client *clp)
 
struct rpc_cred * nfs4_get_setclientid_cred (struct nfs_client *clp)
 
struct nfs4_state_owner * nfs4_get_state_owner (struct nfs_server *server, struct rpc_cred *cred, gfp_t gfp_flags)
 
void nfs4_put_state_owner (struct nfs4_state_owner *sp)
 
void nfs4_purge_state_owners (struct nfs_server *server)
 
void nfs4_state_set_mode_locked (struct nfs4_state *state, fmode_t fmode)
 
struct nfs4_state * nfs4_get_open_state (struct inode *inode, struct nfs4_state_owner *owner)
 
void nfs4_put_open_state (struct nfs4_state *state)
 
void nfs4_close_state (struct nfs4_state *state, fmode_t fmode)
 
void nfs4_close_sync (struct nfs4_state *state, fmode_t fmode)
 
void nfs4_free_lock_state (struct nfs_server *server, struct nfs4_lock_state *lsp)
 
void nfs4_put_lock_state (struct nfs4_lock_state *lsp)
 
int nfs4_set_lock_state (struct nfs4_state *state, struct file_lock *fl)
 
void nfs4_select_rw_stateid (nfs4_stateid *dst, struct nfs4_state *state, fmode_t fmode, const struct nfs_lockowner *lockowner)
 
struct nfs_seqid * nfs_alloc_seqid (struct nfs_seqid_counter *counter, gfp_t gfp_mask)
 
void nfs_release_seqid (struct nfs_seqid *seqid)
 
void nfs_free_seqid (struct nfs_seqid *seqid)
 
void nfs_increment_open_seqid (int status, struct nfs_seqid *seqid)
 
void nfs_increment_lock_seqid (int status, struct nfs_seqid *seqid)
 
int nfs_wait_on_sequence (struct nfs_seqid *seqid, struct rpc_task *task)
 
void nfs4_schedule_state_manager (struct nfs_client *clp)
 
void nfs4_schedule_lease_recovery (struct nfs_client *clp)
 
 EXPORT_SYMBOL_GPL (nfs4_schedule_lease_recovery)
 
void nfs4_schedule_path_down_recovery (struct nfs_client *clp)
 
void nfs4_schedule_stateid_recovery (const struct nfs_server *server, struct nfs4_state *state)
 
 EXPORT_SYMBOL_GPL (nfs4_schedule_stateid_recovery)
 
void nfs_inode_find_state_and_recover (struct inode *inode, const nfs4_stateid *stateid)
 
int nfs4_discover_server_trunking (struct nfs_client *clp, struct nfs_client **result)
 

Variables

const nfs4_stateid zero_stateid
 

Macro Definition Documentation

#define NFSDBG_FACILITY   NFSDBG_STATE

Definition at line 63 of file nfs4state.c.

#define OPENOWNER_POOL_SIZE   8

Definition at line 65 of file nfs4state.c.

Function Documentation

EXPORT_SYMBOL_GPL ( nfs4_schedule_lease_recovery  )
EXPORT_SYMBOL_GPL ( nfs4_schedule_stateid_recovery  )
int nfs40_discover_server_trunking ( struct nfs_client clp,
struct nfs_client **  result,
struct rpc_cred *  cred 
)

nfs40_discover_server_trunking - Detect server IP address trunking (mv0)

: nfs_client under test

Returns
: OUT: found nfs_client, or clp : credential to use for trunking test

Returns zero, a negative errno, or a negative NFS4ERR status. If zero is returned, an nfs_client pointer is planted in "result".

Note: The returned client may not yet be marked ready.

Definition at line 116 of file nfs4state.c.

void nfs4_close_state ( struct nfs4_state *  state,
fmode_t  fmode 
)

Definition at line 817 of file nfs4state.c.

void nfs4_close_sync ( struct nfs4_state *  state,
fmode_t  fmode 
)

Definition at line 822 of file nfs4state.c.

int nfs4_discover_server_trunking ( struct nfs_client clp,
struct nfs_client **  result 
)

nfs4_discover_server_trunking - Detect server IP address trunking

: nfs_client under test

Returns
: OUT: found nfs_client, or clp

Returns zero or a negative errno. If zero is returned, an nfs_client pointer is planted in "result".

Note: since we are invoked in process context, and not from inside the state manager, we cannot use nfs4_handle_reclaim_lease_error().

Definition at line 1804 of file nfs4state.c.

void nfs4_free_lock_state ( struct nfs_server server,
struct nfs4_lock_state lsp 
)

Definition at line 890 of file nfs4state.c.

struct rpc_cred* nfs4_get_machine_cred_locked ( struct nfs_client clp)
read

Definition at line 153 of file nfs4state.c.

struct nfs4_state* nfs4_get_open_state ( struct inode inode,
struct nfs4_state_owner *  owner 
)
read

Definition at line 716 of file nfs4state.c.

struct rpc_cred* nfs4_get_renew_cred_locked ( struct nfs_client clp)
read

nfs4_get_renew_cred_locked - Acquire credential for a renew operation : client state handle

Returns an rpc_cred with reference count bumped, or NULL. Caller must hold clp->cl_lock.

Definition at line 200 of file nfs4state.c.

struct rpc_cred* nfs4_get_setclientid_cred ( struct nfs_client clp)
read

nfs4_get_setclientid_cred - Acquire credential for a setclientid operation : client state handle

Returns an rpc_cred with reference count bumped, or NULL.

Definition at line 395 of file nfs4state.c.

struct nfs4_state_owner* nfs4_get_state_owner ( struct nfs_server server,
struct rpc_cred *  cred,
gfp_t  gfp_flags 
)
read

nfs4_get_state_owner - Look up a state owner given a credential : nfs_server to search : RPC credential to match

Returns a pointer to an instantiated nfs4_state_owner struct, or NULL.

Definition at line 584 of file nfs4state.c.

int nfs4_init_clientid ( struct nfs_client clp,
struct rpc_cred *  cred 
)

Definition at line 71 of file nfs4state.c.

void nfs4_purge_state_owners ( struct nfs_server server)

nfs4_purge_state_owners - Release all cached state owners : nfs_server with cached state owners to release

Called at umount time. Remaining state owners will be on the LRU with ref count of zero.

Definition at line 645 of file nfs4state.c.

void nfs4_put_lock_state ( struct nfs4_lock_state lsp)

Definition at line 933 of file nfs4state.c.

void nfs4_put_open_state ( struct nfs4_state *  state)

Definition at line 752 of file nfs4state.c.

void nfs4_put_state_owner ( struct nfs4_state_owner *  sp)

nfs4_put_state_owner - Release a nfs4_state_owner : state owner data to release

Note that we keep released state owners on an LRU list. This caches valid state owners so that they can be reused, to avoid the OPEN_CONFIRM on minor version 0. It also pins the uniquifier of dropped state owners for a while, to ensure that those state owner names are never reused.

Definition at line 625 of file nfs4state.c.

void nfs4_schedule_lease_recovery ( struct nfs_client clp)

Definition at line 1200 of file nfs4state.c.

void nfs4_schedule_path_down_recovery ( struct nfs_client clp)

Definition at line 1228 of file nfs4state.c.

void nfs4_schedule_state_manager ( struct nfs_client clp)

Definition at line 1170 of file nfs4state.c.

void nfs4_schedule_stateid_recovery ( const struct nfs_server server,
struct nfs4_state *  state 
)

Definition at line 1257 of file nfs4state.c.

void nfs4_select_rw_stateid ( nfs4_stateid dst,
struct nfs4_state *  state,
fmode_t  fmode,
const struct nfs_lockowner lockowner 
)

Definition at line 1034 of file nfs4state.c.

int nfs4_set_lock_state ( struct nfs4_state *  state,
struct file_lock fl 
)

Definition at line 971 of file nfs4state.c.

void nfs4_state_set_mode_locked ( struct nfs4_state *  state,
fmode_t  fmode 
)

Definition at line 680 of file nfs4state.c.

struct nfs_seqid* nfs_alloc_seqid ( struct nfs_seqid_counter *  counter,
gfp_t  gfp_mask 
)
read

Definition at line 1044 of file nfs4state.c.

void nfs_free_seqid ( struct nfs_seqid *  seqid)

Definition at line 1076 of file nfs4state.c.

void nfs_increment_lock_seqid ( int  status,
struct nfs_seqid *  seqid 
)

Definition at line 1133 of file nfs4state.c.

void nfs_increment_open_seqid ( int  status,
struct nfs_seqid *  seqid 
)

Definition at line 1116 of file nfs4state.c.

void nfs_inode_find_state_and_recover ( struct inode inode,
const nfs4_stateid stateid 
)

Definition at line 1268 of file nfs4state.c.

void nfs_release_seqid ( struct nfs_seqid *  seqid)

Definition at line 1057 of file nfs4state.c.

int nfs_wait_on_sequence ( struct nfs_seqid *  seqid,
struct rpc_task task 
)

Definition at line 1138 of file nfs4state.c.

Variable Documentation

const nfs4_stateid zero_stateid

Definition at line 67 of file nfs4state.c.