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
48c22eb2
Commit
48c22eb2
authored
Jan 17, 2012
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: Move struct nfs_unique_id into struct nfs_seqid_counter
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
7ba127ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
12 deletions
+16
-12
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+6
-2
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+5
-5
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+5
-5
No files found.
fs/nfs/nfs4_fs.h
View file @
48c22eb2
...
...
@@ -53,8 +53,14 @@ struct nfs4_minor_version_ops {
const
struct
nfs4_state_maintenance_ops
*
state_renewal_ops
;
};
struct
nfs_unique_id
{
struct
rb_node
rb_node
;
__u64
id
;
};
#define NFS_SEQID_CONFIRMED 1
struct
nfs_seqid_counter
{
int
owner_id
;
int
flags
;
u32
counter
;
spinlock_t
lock
;
/* Protects the list */
...
...
@@ -91,7 +97,6 @@ struct nfs4_state_owner {
unsigned
long
so_flags
;
struct
list_head
so_states
;
struct
nfs_seqid_counter
so_seqid
;
int
so_owner_id
;
};
enum
{
...
...
@@ -131,7 +136,6 @@ struct nfs4_lock_state {
struct
nfs4_state
*
ls_state
;
/* Pointer to open state */
#define NFS_LOCK_INITIALIZED 1
int
ls_flags
;
int
ls_id
;
struct
nfs_seqid_counter
ls_seqid
;
nfs4_stateid
ls_stateid
;
atomic_t
ls_count
;
...
...
fs/nfs/nfs4proc.c
View file @
48c22eb2
...
...
@@ -822,7 +822,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
p
->
o_arg
.
open_flags
=
flags
;
p
->
o_arg
.
fmode
=
fmode
&
(
FMODE_READ
|
FMODE_WRITE
);
p
->
o_arg
.
clientid
=
server
->
nfs_client
->
cl_clientid
;
p
->
o_arg
.
id
=
sp
->
so_owner_id
;
p
->
o_arg
.
id
=
sp
->
so_
seqid
.
owner_id
;
p
->
o_arg
.
name
=
&
dentry
->
d_name
;
p
->
o_arg
.
server
=
server
;
p
->
o_arg
.
bitmask
=
server
->
attr_bitmask
;
...
...
@@ -1447,7 +1447,7 @@ static void nfs4_open_prepare(struct rpc_task *task, void *calldata)
rcu_read_unlock
();
}
/* Update sequence id. */
data
->
o_arg
.
id
=
sp
->
so_owner_id
;
data
->
o_arg
.
id
=
sp
->
so_
seqid
.
owner_id
;
data
->
o_arg
.
clientid
=
sp
->
so_server
->
nfs_client
->
cl_clientid
;
if
(
data
->
o_arg
.
claim
==
NFS4_OPEN_CLAIM_PREVIOUS
)
{
task
->
tk_msg
.
rpc_proc
=
&
nfs4_procedures
[
NFSPROC4_CLNT_OPEN_NOATTR
];
...
...
@@ -4032,7 +4032,7 @@ static int _nfs4_proc_getlk(struct nfs4_state *state, int cmd, struct file_lock
if
(
status
!=
0
)
goto
out
;
lsp
=
request
->
fl_u
.
nfs4_fl
.
owner
;
arg
.
lock_owner
.
id
=
lsp
->
ls_id
;
arg
.
lock_owner
.
id
=
lsp
->
ls_
seqid
.
owner_
id
;
arg
.
lock_owner
.
s_dev
=
server
->
s_dev
;
status
=
nfs4_call_sync
(
server
->
client
,
server
,
&
msg
,
&
arg
.
seq_args
,
&
res
.
seq_res
,
1
);
switch
(
status
)
{
...
...
@@ -4278,7 +4278,7 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,
goto
out_free_seqid
;
p
->
arg
.
lock_stateid
=
&
lsp
->
ls_stateid
;
p
->
arg
.
lock_owner
.
clientid
=
server
->
nfs_client
->
cl_clientid
;
p
->
arg
.
lock_owner
.
id
=
lsp
->
ls_id
;
p
->
arg
.
lock_owner
.
id
=
lsp
->
ls_
seqid
.
owner_
id
;
p
->
arg
.
lock_owner
.
s_dev
=
server
->
s_dev
;
p
->
res
.
lock_seqid
=
p
->
arg
.
lock_seqid
;
p
->
lsp
=
lsp
;
...
...
@@ -4696,7 +4696,7 @@ void nfs4_release_lockowner(const struct nfs4_lock_state *lsp)
if
(
!
args
)
return
;
args
->
lock_owner
.
clientid
=
server
->
nfs_client
->
cl_clientid
;
args
->
lock_owner
.
id
=
lsp
->
ls_id
;
args
->
lock_owner
.
id
=
lsp
->
ls_
seqid
.
owner_
id
;
args
->
lock_owner
.
s_dev
=
server
->
s_dev
;
msg
.
rpc_argp
=
args
;
rpc_call_async
(
server
->
client
,
&
msg
,
0
,
&
nfs4_release_lockowner_ops
,
args
);
...
...
fs/nfs/nfs4state.c
View file @
48c22eb2
...
...
@@ -366,7 +366,7 @@ nfs4_insert_state_owner_locked(struct nfs4_state_owner *new)
return
sp
;
}
}
err
=
ida_get_new
(
&
server
->
openowner_id
,
&
new
->
so_owner_id
);
err
=
ida_get_new
(
&
server
->
openowner_id
,
&
new
->
so_
seqid
.
owner_id
);
if
(
err
)
return
ERR_PTR
(
err
);
rb_link_node
(
&
new
->
so_server_node
,
parent
,
p
);
...
...
@@ -381,7 +381,7 @@ nfs4_remove_state_owner_locked(struct nfs4_state_owner *sp)
if
(
!
RB_EMPTY_NODE
(
&
sp
->
so_server_node
))
rb_erase
(
&
sp
->
so_server_node
,
&
server
->
state_owners
);
ida_remove
(
&
server
->
openowner_id
,
sp
->
so_owner_id
);
ida_remove
(
&
server
->
openowner_id
,
sp
->
so_
seqid
.
owner_id
);
}
static
void
...
...
@@ -775,8 +775,8 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
default:
goto
out_free
;
}
lsp
->
ls_id
=
ida_simple_get
(
&
server
->
lockowner_id
,
0
,
0
,
GFP_NOFS
);
if
(
lsp
->
ls_id
<
0
)
lsp
->
ls_
seqid
.
owner_
id
=
ida_simple_get
(
&
server
->
lockowner_id
,
0
,
0
,
GFP_NOFS
);
if
(
lsp
->
ls_
seqid
.
owner_
id
<
0
)
goto
out_free
;
INIT_LIST_HEAD
(
&
lsp
->
ls_locks
);
return
lsp
;
...
...
@@ -789,7 +789,7 @@ static void nfs4_free_lock_state(struct nfs4_lock_state *lsp)
{
struct
nfs_server
*
server
=
lsp
->
ls_state
->
owner
->
so_server
;
ida_simple_remove
(
&
server
->
lockowner_id
,
lsp
->
ls_id
);
ida_simple_remove
(
&
server
->
lockowner_id
,
lsp
->
ls_
seqid
.
owner_
id
);
nfs4_destroy_seqid_counter
(
&
lsp
->
ls_seqid
);
kfree
(
lsp
);
}
...
...
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