Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a827bcb2
Commit
a827bcb2
authored
Sep 12, 2012
by
J. Bruce Fields
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd4: clean up session allocation
Signed-off-by:
J. Bruce Fields
<
bfields@redhat.com
>
parent
1377b69e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
fs/nfsd/nfs4state.c
fs/nfsd/nfs4state.c
+20
-12
No files found.
fs/nfsd/nfs4state.c
View file @
a827bcb2
...
...
@@ -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
;
...
...
@@ -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
...
...
@@ -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
);
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment