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
6754af64
Commit
6754af64
authored
Mar 22, 2010
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert simple loops over superblocks to list_for_each_entry_safe
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8edd64bd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
20 deletions
+11
-20
fs/buffer.c
fs/buffer.c
+2
-5
fs/drop_caches.c
fs/drop_caches.c
+3
-5
fs/quota/quota.c
fs/quota/quota.c
+3
-5
fs/super.c
fs/super.c
+3
-5
No files found.
fs/buffer.c
View file @
6754af64
...
...
@@ -562,12 +562,11 @@ static int osync_buffers_list(spinlock_t *lock, struct list_head *list)
static
void
do_thaw_all
(
struct
work_struct
*
work
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
char
b
[
BDEVNAME_SIZE
];
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
sb
->
s_count
++
;
...
...
@@ -578,8 +577,6 @@ static void do_thaw_all(struct work_struct *work)
bdevname
(
sb
->
s_bdev
,
b
));
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
}
spin_unlock
(
&
sb_lock
);
kfree
(
work
);
...
...
fs/drop_caches.c
View file @
6754af64
...
...
@@ -35,11 +35,10 @@ static void drop_pagecache_sb(struct super_block *sb)
static
void
drop_pagecache
(
void
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
sb
->
s_count
++
;
...
...
@@ -49,8 +48,7 @@ static void drop_pagecache(void)
drop_pagecache_sb
(
sb
);
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
__put_super
(
sb
);
}
spin_unlock
(
&
sb_lock
);
}
...
...
fs/quota/quota.c
View file @
6754af64
...
...
@@ -47,7 +47,7 @@ static int check_quotactl_permission(struct super_block *sb, int type, int cmd,
static
int
quota_sync_all
(
int
type
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
int
ret
;
if
(
type
>=
MAXQUOTAS
)
...
...
@@ -57,8 +57,7 @@ static int quota_sync_all(int type)
return
ret
;
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
if
(
!
sb
->
s_qcop
||
!
sb
->
s_qcop
->
quota_sync
)
...
...
@@ -71,8 +70,7 @@ static int quota_sync_all(int type)
sb
->
s_qcop
->
quota_sync
(
sb
,
type
,
1
);
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
__put_super
(
sb
);
}
spin_unlock
(
&
sb_lock
);
...
...
fs/super.c
View file @
6754af64
...
...
@@ -395,11 +395,10 @@ EXPORT_SYMBOL(drop_super);
*/
void
sync_supers
(
void
)
{
struct
super_block
*
sb
;
struct
super_block
*
sb
,
*
n
;
spin_lock
(
&
sb_lock
);
restart:
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
{
list_for_each_entry_safe
(
sb
,
n
,
&
super_blocks
,
s_list
)
{
if
(
list_empty
(
&
sb
->
s_instances
))
continue
;
if
(
sb
->
s_op
->
write_super
&&
sb
->
s_dirt
)
{
...
...
@@ -412,8 +411,7 @@ void sync_supers(void)
up_read
(
&
sb
->
s_umount
);
spin_lock
(
&
sb_lock
);
if
(
__put_super_and_need_restart
(
sb
))
goto
restart
;
__put_super
(
sb
);
}
}
spin_unlock
(
&
sb_lock
);
...
...
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