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
nexedi
linux
Commits
db90681d
Commit
db90681d
authored
Sep 29, 2010
by
J. Bruce Fields
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd4: refactor connection allocation
Signed-off-by:
J. Bruce Fields
<
bfields@redhat.com
>
parent
19cf5c02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
fs/nfsd/nfs4state.c
fs/nfsd/nfs4state.c
+26
-6
No files found.
fs/nfsd/nfs4state.c
View file @
db90681d
...
...
@@ -644,25 +644,45 @@ static void nfsd4_conn_lost(struct svc_xpt_user *u)
spin_unlock
(
&
clp
->
cl_lock
);
}
static
__be32
nfsd4_new_conn
(
struct
svc_rqst
*
rqstp
,
struct
nfsd4_session
*
ses
)
static
struct
nfsd4_conn
*
alloc_conn
(
struct
svc_rqst
*
rqstp
)
{
struct
nfs4_client
*
clp
=
ses
->
se_client
;
struct
nfsd4_conn
*
conn
;
conn
=
kmalloc
(
sizeof
(
struct
nfsd4_conn
),
GFP_KERNEL
);
if
(
!
conn
)
return
nfserr_jukebox
;
conn
->
cn_flags
=
NFS4_CDFC4_FORE
;
return
NULL
;
svc_xprt_get
(
rqstp
->
rq_xprt
);
conn
->
cn_xprt
=
rqstp
->
rq_xprt
;
conn
->
cn_session
=
ses
;
conn
->
cn_flags
=
NFS4_CDFC4_FORE
;
INIT_LIST_HEAD
(
&
conn
->
cn_xpt_user
.
list
);
return
conn
;
}
static
void
nfsd4_hash_conn
(
struct
nfsd4_conn
*
conn
,
struct
nfsd4_session
*
ses
)
{
struct
nfs4_client
*
clp
=
ses
->
se_client
;
spin_lock
(
&
clp
->
cl_lock
);
conn
->
cn_session
=
ses
;
list_add
(
&
conn
->
cn_persession
,
&
ses
->
se_conns
);
spin_unlock
(
&
clp
->
cl_lock
);
}
static
void
nfsd4_register_conn
(
struct
nfsd4_conn
*
conn
)
{
conn
->
cn_xpt_user
.
callback
=
nfsd4_conn_lost
;
register_xpt_user
(
rqstp
->
rq_xprt
,
&
conn
->
cn_xpt_user
);
register_xpt_user
(
conn
->
cn_xprt
,
&
conn
->
cn_xpt_user
);
}
static
__be32
nfsd4_new_conn
(
struct
svc_rqst
*
rqstp
,
struct
nfsd4_session
*
ses
)
{
struct
nfsd4_conn
*
conn
;
conn
=
alloc_conn
(
rqstp
);
if
(
!
conn
)
return
nfserr_jukebox
;
nfsd4_hash_conn
(
conn
,
ses
);
nfsd4_register_conn
(
conn
);
return
nfs_ok
;
}
...
...
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