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
c44fe705
Commit
c44fe705
authored
Jun 16, 2007
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SUNRPC: Clean up tk_pid allocation and make it lockless
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
4bef61ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
net/sunrpc/sched.c
net/sunrpc/sched.c
+15
-7
No files found.
net/sunrpc/sched.c
View file @
c44fe705
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#ifdef RPC_DEBUG
#ifdef RPC_DEBUG
#define RPCDBG_FACILITY RPCDBG_SCHED
#define RPCDBG_FACILITY RPCDBG_SCHED
#define RPC_TASK_MAGIC_ID 0xf00baa
#define RPC_TASK_MAGIC_ID 0xf00baa
static
int
rpc_task_id
;
#endif
#endif
/*
/*
...
@@ -268,17 +267,26 @@ static int rpc_wait_bit_interruptible(void *word)
...
@@ -268,17 +267,26 @@ static int rpc_wait_bit_interruptible(void *word)
return
0
;
return
0
;
}
}
#ifdef RPC_DEBUG
static
void
rpc_task_set_debuginfo
(
struct
rpc_task
*
task
)
{
static
atomic_t
rpc_pid
;
task
->
tk_magic
=
RPC_TASK_MAGIC_ID
;
task
->
tk_pid
=
atomic_inc_return
(
&
rpc_pid
);
}
#else
static
inline
void
rpc_task_set_debuginfo
(
struct
rpc_task
*
task
)
{
}
#endif
static
void
rpc_set_active
(
struct
rpc_task
*
task
)
static
void
rpc_set_active
(
struct
rpc_task
*
task
)
{
{
struct
rpc_clnt
*
clnt
;
struct
rpc_clnt
*
clnt
;
if
(
test_and_set_bit
(
RPC_TASK_ACTIVE
,
&
task
->
tk_runstate
)
!=
0
)
if
(
test_and_set_bit
(
RPC_TASK_ACTIVE
,
&
task
->
tk_runstate
)
!=
0
)
return
;
return
;
#ifdef RPC_DEBUG
rpc_task_set_debuginfo
(
task
);
task
->
tk_magic
=
RPC_TASK_MAGIC_ID
;
spin_lock
(
&
rpc_sched_lock
);
task
->
tk_pid
=
rpc_task_id
++
;
spin_unlock
(
&
rpc_sched_lock
);
#endif
/* Add to global list of all tasks */
/* Add to global list of all tasks */
clnt
=
task
->
tk_client
;
clnt
=
task
->
tk_client
;
if
(
clnt
!=
NULL
)
{
if
(
clnt
!=
NULL
)
{
...
...
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