Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142184
b: refs/heads/master
c: 7116ed6
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and J. Bruce Fields committed Apr 4, 2009
1 parent 630e1d8 commit 1b42b68
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 10add806c38c022d18af48f3ec28c91b4eaf7bb3
refs/heads/master: 7116ed6b9973021ff43edeb10f4cb834db94000f
18 changes: 18 additions & 0 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,24 @@ static void release_openowner(struct nfs4_stateowner *sop)
nfs4_put_stateowner(sop);
}

static void
release_session(struct nfsd4_session *ses)
{
list_del(&ses->se_hash);
list_del(&ses->se_perclnt);
nfsd4_put_session(ses);
}

void
free_session(struct kref *kref)
{
struct nfsd4_session *ses;

ses = container_of(kref, struct nfsd4_session, se_ref);
kfree(ses->se_slots);
kfree(ses);
}

static inline void
renew_client(struct nfs4_client *clp)
{
Expand Down
33 changes: 33 additions & 0 deletions trunk/include/linux/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,39 @@ struct nfs4_callback {
struct rpc_clnt * cb_client;
};

struct nfsd4_slot {
bool sl_inuse;
u32 sl_seqid;
};

struct nfsd4_session {
struct kref se_ref;
struct list_head se_hash; /* hash by sessionid */
struct list_head se_perclnt;
u32 se_flags;
struct nfs4_client *se_client; /* for expire_client */
struct nfs4_sessionid se_sessionid;
u32 se_fmaxreq_sz;
u32 se_fmaxresp_sz;
u32 se_fmaxresp_cached;
u32 se_fmaxops;
u32 se_fnumslots;
struct nfsd4_slot *se_slots; /* forward channel slots */
};

static inline void
nfsd4_put_session(struct nfsd4_session *ses)
{
extern void free_session(struct kref *kref);
kref_put(&ses->se_ref, free_session);
}

static inline void
nfsd4_get_session(struct nfsd4_session *ses)
{
kref_get(&ses->se_ref);
}

#define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */

/*
Expand Down

0 comments on commit 1b42b68

Please sign in to comment.