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
9e251d02
Commit
9e251d02
authored
Jan 09, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kill pin_put()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
92fc41c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
16 deletions
+10
-16
fs/fs_pin.c
fs/fs_pin.c
+0
-11
include/linux/fs_pin.h
include/linux/fs_pin.h
+0
-1
kernel/acct.c
kernel/acct.c
+10
-4
No files found.
fs/fs_pin.c
View file @
9e251d02
...
...
@@ -4,19 +4,8 @@
#include "internal.h"
#include "mount.h"
static
void
pin_free_rcu
(
struct
rcu_head
*
head
)
{
kfree
(
container_of
(
head
,
struct
fs_pin
,
rcu
));
}
static
DEFINE_SPINLOCK
(
pin_lock
);
void
pin_put
(
struct
fs_pin
*
p
)
{
if
(
atomic_long_dec_and_test
(
&
p
->
count
))
call_rcu
(
&
p
->
rcu
,
pin_free_rcu
);
}
void
pin_remove
(
struct
fs_pin
*
pin
)
{
spin_lock
(
&
pin_lock
);
...
...
include/linux/fs_pin.h
View file @
9e251d02
...
...
@@ -12,6 +12,5 @@ struct fs_pin {
void
(
*
kill
)(
struct
fs_pin
*
);
};
void
pin_put
(
struct
fs_pin
*
);
void
pin_remove
(
struct
fs_pin
*
);
void
pin_insert
(
struct
fs_pin
*
,
struct
vfsmount
*
);
kernel/acct.c
View file @
9e251d02
...
...
@@ -124,6 +124,12 @@ static int check_free_space(struct bsd_acct_struct *acct)
return
acct
->
active
;
}
static
void
acct_put
(
struct
bsd_acct_struct
*
p
)
{
if
(
atomic_long_dec_and_test
(
&
p
->
pin
.
count
))
kfree_rcu
(
p
,
pin
.
rcu
);
}
static
struct
bsd_acct_struct
*
acct_get
(
struct
pid_namespace
*
ns
)
{
struct
bsd_acct_struct
*
res
;
...
...
@@ -144,7 +150,7 @@ static struct bsd_acct_struct *acct_get(struct pid_namespace *ns)
mutex_lock
(
&
res
->
lock
);
if
(
!
res
->
ns
)
{
mutex_unlock
(
&
res
->
lock
);
pin_put
(
&
res
->
pin
);
acct_put
(
res
);
goto
again
;
}
return
res
;
...
...
@@ -175,7 +181,7 @@ static void acct_kill(struct bsd_acct_struct *acct,
acct
->
ns
=
NULL
;
atomic_long_dec
(
&
acct
->
pin
.
count
);
mutex_unlock
(
&
acct
->
lock
);
pin_put
(
&
acct
->
pin
);
acct_put
(
acct
);
}
}
...
...
@@ -186,7 +192,7 @@ static void acct_pin_kill(struct fs_pin *pin)
mutex_lock
(
&
acct
->
lock
);
if
(
!
acct
->
ns
)
{
mutex_unlock
(
&
acct
->
lock
);
pin_put
(
pin
);
acct_put
(
acct
);
acct
=
NULL
;
}
acct_kill
(
acct
,
NULL
);
...
...
@@ -576,7 +582,7 @@ static void slow_acct_process(struct pid_namespace *ns)
if
(
acct
)
{
do_acct_process
(
acct
);
mutex_unlock
(
&
acct
->
lock
);
pin_put
(
&
acct
->
pin
);
acct_put
(
acct
);
}
}
}
...
...
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