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
fdab684d
Commit
fdab684d
authored
Jan 11, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow attaching fs_pin to a group not associated with some superblock
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
3b994d98
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
10 deletions
+17
-10
fs/fs_pin.c
fs/fs_pin.c
+13
-7
fs/internal.h
fs/internal.h
+1
-1
fs/super.c
fs/super.c
+2
-2
include/linux/fs_pin.h
include/linux/fs_pin.h
+1
-0
No files found.
fs/fs_pin.c
View file @
fdab684d
...
...
@@ -14,14 +14,20 @@ void pin_remove(struct fs_pin *pin)
spin_unlock
(
&
pin_lock
);
}
void
pin_insert
(
struct
fs_pin
*
pin
,
struct
vfsmount
*
m
)
void
pin_insert
_group
(
struct
fs_pin
*
pin
,
struct
vfsmount
*
m
,
struct
hlist_head
*
p
)
{
spin_lock
(
&
pin_lock
);
hlist_add_head
(
&
pin
->
s_list
,
&
m
->
mnt_sb
->
s_pins
);
if
(
p
)
hlist_add_head
(
&
pin
->
s_list
,
p
);
hlist_add_head
(
&
pin
->
m_list
,
&
real_mount
(
m
)
->
mnt_pins
);
spin_unlock
(
&
pin_lock
);
}
void
pin_insert
(
struct
fs_pin
*
pin
,
struct
vfsmount
*
m
)
{
pin_insert_group
(
pin
,
m
,
&
m
->
mnt_sb
->
s_pins
);
}
void
mnt_pin_kill
(
struct
mount
*
m
)
{
while
(
1
)
{
...
...
@@ -38,18 +44,18 @@ void mnt_pin_kill(struct mount *m)
}
}
void
sb_pin_kill
(
struct
super_block
*
sb
)
void
group_pin_kill
(
struct
hlist_head
*
p
)
{
while
(
1
)
{
struct
hlist_node
*
p
;
struct
hlist_node
*
q
;
struct
fs_pin
*
pin
;
rcu_read_lock
();
p
=
ACCESS_ONCE
(
sb
->
s_pins
.
first
);
if
(
!
p
)
{
q
=
ACCESS_ONCE
(
p
->
first
);
if
(
!
q
)
{
rcu_read_unlock
();
break
;
}
pin
=
hlist_entry
(
p
,
struct
fs_pin
,
s_list
);
pin
=
hlist_entry
(
q
,
struct
fs_pin
,
s_list
);
pin
->
kill
(
pin
);
}
}
fs/internal.h
View file @
fdab684d
...
...
@@ -145,7 +145,7 @@ extern const struct file_operations pipefifo_fops;
/*
* fs_pin.c
*/
extern
void
sb_pin_kill
(
struct
super_block
*
sb
);
extern
void
group_pin_kill
(
struct
hlist_head
*
p
);
extern
void
mnt_pin_kill
(
struct
mount
*
m
);
/*
...
...
fs/super.c
View file @
fdab684d
...
...
@@ -706,9 +706,9 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
remount_ro
=
(
flags
&
MS_RDONLY
)
&&
!
(
sb
->
s_flags
&
MS_RDONLY
);
if
(
remount_ro
)
{
if
(
sb
->
s_pins
.
first
)
{
if
(
!
hlist_empty
(
&
sb
->
s_pins
)
)
{
up_write
(
&
sb
->
s_umount
);
sb_pin_kill
(
sb
);
group_pin_kill
(
&
sb
->
s_pins
);
down_write
(
&
sb
->
s_umount
);
if
(
!
sb
->
s_root
)
return
0
;
...
...
include/linux/fs_pin.h
View file @
fdab684d
...
...
@@ -7,4 +7,5 @@ struct fs_pin {
};
void
pin_remove
(
struct
fs_pin
*
);
void
pin_insert_group
(
struct
fs_pin
*
,
struct
vfsmount
*
,
struct
hlist_head
*
);
void
pin_insert
(
struct
fs_pin
*
,
struct
vfsmount
*
);
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