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
4581d140
Commit
4581d140
authored
Sep 06, 2011
by
J. Bruce Fields
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd4: rearrange to avoid a forward reference
Signed-off-by:
J. Bruce Fields
<
bfields@redhat.com
>
parent
4665e2ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
27 deletions
+26
-27
fs/nfsd/nfs4state.c
fs/nfsd/nfs4state.c
+26
-27
No files found.
fs/nfsd/nfs4state.c
View file @
4581d140
...
...
@@ -60,7 +60,6 @@ static u64 current_sessionid = 1;
#define ONE_STATEID(stateid) (!memcmp((stateid), &onestateid, sizeof(stateid_t)))
/* forward declarations */
static
struct
nfs4_stateid
*
find_stateid
(
stateid_t
*
stid
,
int
flags
);
static
struct
nfs4_delegation
*
search_for_delegation
(
stateid_t
*
stid
);
static
struct
nfs4_delegation
*
find_delegation_stateid
(
struct
inode
*
ino
,
stateid_t
*
stid
);
static
int
check_for_locks
(
struct
nfs4_file
*
filp
,
struct
nfs4_lockowner
*
lowner
);
...
...
@@ -1061,6 +1060,32 @@ static void gen_confirm(struct nfs4_client *clp)
*
p
++
=
i
++
;
}
static
int
same_stateid
(
stateid_t
*
id_one
,
stateid_t
*
id_two
)
{
if
(
id_one
->
si_stateownerid
!=
id_two
->
si_stateownerid
)
return
0
;
return
id_one
->
si_fileid
==
id_two
->
si_fileid
;
}
static
struct
nfs4_stateid
*
find_stateid
(
stateid_t
*
t
,
int
flags
)
{
struct
nfs4_stateid
*
s
;
unsigned
int
hashval
;
hashval
=
stateid_hashval
(
t
->
si_stateownerid
,
t
->
si_fileid
);
list_for_each_entry
(
s
,
&
stateid_hashtbl
[
hashval
],
st_hash
)
{
if
(
!
same_stateid
(
&
s
->
st_stateid
,
t
))
continue
;
if
(
flags
&
LOCK_STATE
&&
s
->
st_type
!=
NFS4_LOCK_STID
)
return
NULL
;
if
(
flags
&
OPEN_STATE
&&
s
->
st_type
!=
NFS4_OPEN_STID
)
return
NULL
;
return
s
;
}
return
NULL
;
}
static
struct
nfs4_client
*
create_client
(
struct
xdr_netobj
name
,
char
*
recdir
,
struct
svc_rqst
*
rqstp
,
nfs4_verifier
*
verf
)
{
...
...
@@ -3694,32 +3719,6 @@ lock_ownerstr_hashval(struct inode *inode, u32 cl_id,
static
struct
list_head
lock_ownerid_hashtbl
[
LOCK_HASH_SIZE
];
static
struct
list_head
lock_ownerstr_hashtbl
[
LOCK_HASH_SIZE
];
static
int
same_stateid
(
stateid_t
*
id_one
,
stateid_t
*
id_two
)
{
if
(
id_one
->
si_stateownerid
!=
id_two
->
si_stateownerid
)
return
0
;
return
id_one
->
si_fileid
==
id_two
->
si_fileid
;
}
static
struct
nfs4_stateid
*
find_stateid
(
stateid_t
*
t
,
int
flags
)
{
struct
nfs4_stateid
*
s
;
unsigned
int
hashval
;
hashval
=
stateid_hashval
(
t
->
si_stateownerid
,
t
->
si_fileid
);
list_for_each_entry
(
s
,
&
stateid_hashtbl
[
hashval
],
st_hash
)
{
if
(
!
same_stateid
(
&
s
->
st_stateid
,
t
))
continue
;
if
(
flags
&
LOCK_STATE
&&
s
->
st_type
!=
NFS4_LOCK_STID
)
return
NULL
;
if
(
flags
&
OPEN_STATE
&&
s
->
st_type
!=
NFS4_OPEN_STID
)
return
NULL
;
return
s
;
}
return
NULL
;
}
static
struct
nfs4_delegation
*
search_for_delegation
(
stateid_t
*
stid
)
{
...
...
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