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
nexedi
linux
Commits
16096694
Commit
16096694
authored
Jul 17, 2003
by
Andrew Morton
Committed by
Linus Torvalds
Jul 17, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] unline most of put_namespace()
It has five callsites, and is big.
parent
909cc4ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
fs/namespace.c
fs/namespace.c
+10
-0
include/linux/namespace.h
include/linux/namespace.h
+3
-8
No files found.
fs/namespace.c
View file @
16096694
...
@@ -1158,3 +1158,13 @@ void __init mnt_init(unsigned long mempages)
...
@@ -1158,3 +1158,13 @@ void __init mnt_init(unsigned long mempages)
init_rootfs
();
init_rootfs
();
init_mount_tree
();
init_mount_tree
();
}
}
void
__put_namespace
(
struct
namespace
*
namespace
)
{
down_write
(
&
namespace
->
sem
);
spin_lock
(
&
vfsmount_lock
);
umount_tree
(
namespace
->
root
);
spin_unlock
(
&
vfsmount_lock
);
up_write
(
&
namespace
->
sem
);
kfree
(
namespace
);
}
include/linux/namespace.h
View file @
16096694
...
@@ -14,17 +14,12 @@ struct namespace {
...
@@ -14,17 +14,12 @@ struct namespace {
extern
void
umount_tree
(
struct
vfsmount
*
);
extern
void
umount_tree
(
struct
vfsmount
*
);
extern
int
copy_namespace
(
int
,
struct
task_struct
*
);
extern
int
copy_namespace
(
int
,
struct
task_struct
*
);
void
__put_namespace
(
struct
namespace
*
namespace
);
static
inline
void
put_namespace
(
struct
namespace
*
namespace
)
static
inline
void
put_namespace
(
struct
namespace
*
namespace
)
{
{
if
(
atomic_dec_and_test
(
&
namespace
->
count
))
{
if
(
atomic_dec_and_test
(
&
namespace
->
count
))
down_write
(
&
namespace
->
sem
);
__put_namespace
(
namespace
);
spin_lock
(
&
vfsmount_lock
);
umount_tree
(
namespace
->
root
);
spin_unlock
(
&
vfsmount_lock
);
up_write
(
&
namespace
->
sem
);
kfree
(
namespace
);
}
}
}
static
inline
void
exit_namespace
(
struct
task_struct
*
p
)
static
inline
void
exit_namespace
(
struct
task_struct
*
p
)
...
...
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