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
d5477a8d
Commit
d5477a8d
authored
Sep 08, 2011
by
J. Bruce Fields
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd4: add common dl_stid field to delegation
Signed-off-by:
J. Bruce Fields
<
bfields@redhat.com
>
parent
dcef0413
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
20 deletions
+22
-20
fs/nfsd/nfs4callback.c
fs/nfsd/nfs4callback.c
+1
-1
fs/nfsd/nfs4state.c
fs/nfsd/nfs4state.c
+10
-10
fs/nfsd/state.h
fs/nfsd/state.h
+11
-9
No files found.
fs/nfsd/nfs4callback.c
View file @
d5477a8d
...
@@ -351,7 +351,7 @@ static void encode_cb_recall4args(struct xdr_stream *xdr,
...
@@ -351,7 +351,7 @@ static void encode_cb_recall4args(struct xdr_stream *xdr,
__be32
*
p
;
__be32
*
p
;
encode_nfs_cb_opnum4
(
xdr
,
OP_CB_RECALL
);
encode_nfs_cb_opnum4
(
xdr
,
OP_CB_RECALL
);
encode_stateid4
(
xdr
,
&
dp
->
dl_stateid
);
encode_stateid4
(
xdr
,
&
dp
->
dl_st
id
.
sc_st
ateid
);
p
=
xdr_reserve_space
(
xdr
,
4
);
p
=
xdr_reserve_space
(
xdr
,
4
);
*
p
++
=
xdr_zero
;
/* truncate */
*
p
++
=
xdr_zero
;
/* truncate */
...
...
fs/nfsd/nfs4state.c
View file @
d5477a8d
...
@@ -247,10 +247,10 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_ol_stateid *stp, struct sv
...
@@ -247,10 +247,10 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_ol_stateid *stp, struct sv
get_nfs4_file
(
fp
);
get_nfs4_file
(
fp
);
dp
->
dl_file
=
fp
;
dp
->
dl_file
=
fp
;
dp
->
dl_type
=
type
;
dp
->
dl_type
=
type
;
dp
->
dl_stateid
.
si_boot
=
boot_time
;
dp
->
dl_st
id
.
sc_st
ateid
.
si_boot
=
boot_time
;
dp
->
dl_stateid
.
si_stateownerid
=
current_delegid
++
;
dp
->
dl_st
id
.
sc_st
ateid
.
si_stateownerid
=
current_delegid
++
;
dp
->
dl_stateid
.
si_fileid
=
0
;
dp
->
dl_st
id
.
sc_st
ateid
.
si_fileid
=
0
;
dp
->
dl_stateid
.
si_generation
=
1
;
dp
->
dl_st
id
.
sc_st
ateid
.
si_generation
=
1
;
fh_copy_shallow
(
&
dp
->
dl_fh
,
&
current_fh
->
fh_handle
);
fh_copy_shallow
(
&
dp
->
dl_fh
,
&
current_fh
->
fh_handle
);
dp
->
dl_time
=
0
;
dp
->
dl_time
=
0
;
atomic_set
(
&
dp
->
dl_count
,
1
);
atomic_set
(
&
dp
->
dl_count
,
1
);
...
@@ -2572,7 +2572,7 @@ find_delegation_file(struct nfs4_file *fp, stateid_t *stid)
...
@@ -2572,7 +2572,7 @@ find_delegation_file(struct nfs4_file *fp, stateid_t *stid)
spin_lock
(
&
recall_lock
);
spin_lock
(
&
recall_lock
);
list_for_each_entry
(
dp
,
&
fp
->
fi_delegations
,
dl_perfile
)
list_for_each_entry
(
dp
,
&
fp
->
fi_delegations
,
dl_perfile
)
if
(
dp
->
dl_stateid
.
si_stateownerid
==
stid
->
si_stateownerid
)
{
if
(
dp
->
dl_st
id
.
sc_st
ateid
.
si_stateownerid
==
stid
->
si_stateownerid
)
{
spin_unlock
(
&
recall_lock
);
spin_unlock
(
&
recall_lock
);
return
dp
;
return
dp
;
}
}
...
@@ -2861,10 +2861,10 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_ol_
...
@@ -2861,10 +2861,10 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, struct nfs4_ol_
if
(
status
)
if
(
status
)
goto
out_free
;
goto
out_free
;
memcpy
(
&
open
->
op_delegate_stateid
,
&
dp
->
dl_st
ateid
,
sizeof
(
dp
->
dl
_stateid
));
memcpy
(
&
open
->
op_delegate_stateid
,
&
dp
->
dl_st
id
.
sc_stateid
,
sizeof
(
dp
->
dl_stid
.
sc
_stateid
));
dprintk
(
"NFSD: delegation stateid="
STATEID_FMT
"
\n
"
,
dprintk
(
"NFSD: delegation stateid="
STATEID_FMT
"
\n
"
,
STATEID_VAL
(
&
dp
->
dl_stateid
));
STATEID_VAL
(
&
dp
->
dl_st
id
.
sc_st
ateid
));
out:
out:
if
(
open
->
op_claim_type
==
NFS4_OPEN_CLAIM_PREVIOUS
if
(
open
->
op_claim_type
==
NFS4_OPEN_CLAIM_PREVIOUS
&&
flag
==
NFS4_OPEN_DELEGATE_NONE
&&
flag
==
NFS4_OPEN_DELEGATE_NONE
...
@@ -3296,7 +3296,7 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
...
@@ -3296,7 +3296,7 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
dp
=
find_delegation_stateid
(
ino
,
stateid
);
dp
=
find_delegation_stateid
(
ino
,
stateid
);
if
(
!
dp
)
if
(
!
dp
)
goto
out
;
goto
out
;
status
=
check_stateid_generation
(
stateid
,
&
dp
->
dl_stateid
,
nfsd4_has_session
(
cstate
));
status
=
check_stateid_generation
(
stateid
,
&
dp
->
dl_st
id
.
sc_st
ateid
,
nfsd4_has_session
(
cstate
));
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
status
=
nfs4_check_delegmode
(
dp
,
flags
);
status
=
nfs4_check_delegmode
(
dp
,
flags
);
...
@@ -3667,7 +3667,7 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
...
@@ -3667,7 +3667,7 @@ nfsd4_delegreturn(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
dp
=
find_delegation_stateid
(
inode
,
stateid
);
dp
=
find_delegation_stateid
(
inode
,
stateid
);
if
(
!
dp
)
if
(
!
dp
)
goto
out
;
goto
out
;
status
=
check_stateid_generation
(
stateid
,
&
dp
->
dl_stateid
,
nfsd4_has_session
(
cstate
));
status
=
check_stateid_generation
(
stateid
,
&
dp
->
dl_st
id
.
sc_st
ateid
,
nfsd4_has_session
(
cstate
));
if
(
status
)
if
(
status
)
goto
out
;
goto
out
;
renew_client
(
dp
->
dl_client
);
renew_client
(
dp
->
dl_client
);
...
@@ -3737,7 +3737,7 @@ search_for_delegation(stateid_t *stid)
...
@@ -3737,7 +3737,7 @@ search_for_delegation(stateid_t *stid)
list_for_each_entry
(
fp
,
&
file_hashtbl
[
i
],
fi_hash
)
{
list_for_each_entry
(
fp
,
&
file_hashtbl
[
i
],
fi_hash
)
{
list_for_each
(
pos
,
&
fp
->
fi_delegations
)
{
list_for_each
(
pos
,
&
fp
->
fi_delegations
)
{
dp
=
list_entry
(
pos
,
struct
nfs4_delegation
,
dl_perfile
);
dp
=
list_entry
(
pos
,
struct
nfs4_delegation
,
dl_perfile
);
if
(
same_stateid
(
&
dp
->
dl_stateid
,
stid
))
if
(
same_stateid
(
&
dp
->
dl_st
id
.
sc_st
ateid
,
stid
))
return
dp
;
return
dp
;
}
}
}
}
...
...
fs/nfsd/state.h
View file @
d5477a8d
...
@@ -76,6 +76,15 @@ struct nfsd4_callback {
...
@@ -76,6 +76,15 @@ struct nfsd4_callback {
bool
cb_done
;
bool
cb_done
;
};
};
struct
nfs4_stid
{
#define NFS4_OPEN_STID 1
#define NFS4_LOCK_STID 2
#define NFS4_DELEG_STID 4
char
sc_type
;
struct
list_head
sc_hash
;
stateid_t
sc_stateid
;
};
struct
nfs4_delegation
{
struct
nfs4_delegation
{
struct
list_head
dl_perfile
;
struct
list_head
dl_perfile
;
struct
list_head
dl_perclnt
;
struct
list_head
dl_perclnt
;
...
@@ -86,7 +95,7 @@ struct nfs4_delegation {
...
@@ -86,7 +95,7 @@ struct nfs4_delegation {
u32
dl_type
;
u32
dl_type
;
time_t
dl_time
;
time_t
dl_time
;
/* For recall: */
/* For recall: */
st
ateid_t
dl_state
id
;
st
ruct
nfs4_stid
dl_st
id
;
struct
knfsd_fh
dl_fh
;
struct
knfsd_fh
dl_fh
;
int
dl_retries
;
int
dl_retries
;
struct
nfsd4_callback
dl_recall
;
struct
nfsd4_callback
dl_recall
;
...
@@ -446,14 +455,7 @@ static inline struct file *find_any_file(struct nfs4_file *f)
...
@@ -446,14 +455,7 @@ static inline struct file *find_any_file(struct nfs4_file *f)
* we should consider defining separate structs for the two cases.
* we should consider defining separate structs for the two cases.
*/
*/
struct
nfs4_stid
{
/* "ol" stands for "Open or Lock". Better suggestions welcome. */
#define NFS4_OPEN_STID 1
#define NFS4_LOCK_STID 2
char
sc_type
;
struct
list_head
sc_hash
;
stateid_t
sc_stateid
;
};
struct
nfs4_ol_stateid
{
struct
nfs4_ol_stateid
{
struct
nfs4_stid
st_stid
;
struct
nfs4_stid
st_stid
;
struct
list_head
st_perfile
;
struct
list_head
st_perfile
;
...
...
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