Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164594
b: refs/heads/master
c: b101ebb
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and J. Bruce Fields committed Jul 28, 2009
1 parent 4b604b1 commit 9e7b0b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 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: be98d1bbd1b872a10d64cdef0af10b9afcc48092
refs/heads/master: b101ebbc39f50f8af4657e517954ca874b13b364
15 changes: 7 additions & 8 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,26 +423,25 @@ gen_sessionid(struct nfsd4_session *ses)
*/
static int set_forechannel_maxreqs(struct nfsd4_channel_attrs *fchan)
{
int status = 0, np = fchan->maxreqs * NFSD_PAGES_PER_SLOT;
int np;

if (fchan->maxreqs < 1)
return nfserr_inval;
else if (fchan->maxreqs > NFSD_MAX_SLOTS_PER_SESSION)
fchan->maxreqs = NFSD_MAX_SLOTS_PER_SESSION;

np = fchan->maxreqs * NFSD_PAGES_PER_SLOT;

spin_lock(&nfsd_drc_lock);
if (np + nfsd_drc_pages_used > nfsd_drc_max_pages)
np = nfsd_drc_max_pages - nfsd_drc_pages_used;
nfsd_drc_pages_used += np;
spin_unlock(&nfsd_drc_lock);

if (np <= 0) {
status = nfserr_resource;
fchan->maxreqs = 0;
} else
fchan->maxreqs = np / NFSD_PAGES_PER_SLOT;

return status;
fchan->maxreqs = np / NFSD_PAGES_PER_SLOT;
if (fchan->maxreqs == 0)
return nfserr_resource;
return 0;
}

/*
Expand Down

0 comments on commit 9e7b0b2

Please sign in to comment.