Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334072
b: refs/heads/master
c: a827bcb
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Oct 1, 2012
1 parent f55b0c0 commit 75e8082
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1377b69e68241826761d257ac26dd4285c3f9e9b
refs/heads/master: a827bcb242ecc884d38af8145e1d9a112b739b35
32 changes: 20 additions & 12 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ static void nfsd4_put_drc_mem(int slotsize, int num)
spin_unlock(&nfsd_drc_lock);
}

static struct nfsd4_session *alloc_session(int slotsize, int numslots)
static struct nfsd4_session *__alloc_session(int slotsize, int numslots)
{
struct nfsd4_session *new;
int mem, i;
Expand Down Expand Up @@ -921,14 +921,10 @@ void nfsd4_put_session(struct nfsd4_session *ses)
spin_unlock(&client_lock);
}

static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct nfs4_client *clp, struct nfsd4_create_session *cses)
static struct nfsd4_session *alloc_session(struct nfsd4_channel_attrs *fchan)
{
struct nfsd4_session *new;
struct nfsd4_conn *conn;
struct nfsd4_channel_attrs *fchan = &cses->fore_channel;
int numslots, slotsize;
int idx;

/*
* Note decreasing slot size below client's request may
* make it difficult for client to function correctly, whereas
Expand All @@ -941,13 +937,30 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n
if (numslots < 1)
return NULL;

new = alloc_session(slotsize, numslots);
new = __alloc_session(slotsize, numslots);
if (!new) {
nfsd4_put_drc_mem(slotsize, fchan->maxreqs);
return NULL;
}
init_forechannel_attrs(&new->se_fchannel, fchan, numslots, slotsize);
return new;
}

static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct nfs4_client *clp, struct nfsd4_create_session *cses)
{
struct nfsd4_session *new;
struct nfsd4_conn *conn;
int idx;

new = alloc_session(&cses->fore_channel);
if (!new)
return NULL;

conn = alloc_conn_from_crses(rqstp, cses);
if (!conn) {
__free_session(new);
return NULL;
}
new->se_client = clp;
gen_sessionid(new);

Expand All @@ -965,11 +978,6 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n
spin_unlock(&clp->cl_lock);
spin_unlock(&client_lock);

conn = alloc_conn_from_crses(rqstp, cses);
if (!conn) {
__free_session(new);
return NULL;
}
nfsd4_init_conn(rqstp, conn, new);
if (cses->flags & SESSION4_BACK_CHAN) {
struct sockaddr *sa = svc_addr(rqstp);
Expand Down

0 comments on commit 75e8082

Please sign in to comment.