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
b4274bcf
Commit
b4274bcf
authored
Feb 20, 2003
by
Brian Gerst
Committed by
Linus Torvalds
Feb 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Clean up list head usage in sysrq.c
Use list_for_each_entry() instead of open code.
parent
91bdae7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
drivers/char/sysrq.c
drivers/char/sysrq.c
+4
-9
No files found.
drivers/char/sysrq.c
View file @
b4274bcf
...
...
@@ -153,7 +153,7 @@ static void go_sync(struct super_block *sb, int remount_flag)
if
(
remount_flag
)
{
/* Remount R/O */
int
ret
,
flags
;
struct
list_head
*
p
;
struct
file
*
file
;
if
(
sb
->
s_flags
&
MS_RDONLY
)
{
printk
(
"R/O
\n
"
);
...
...
@@ -161,8 +161,7 @@ static void go_sync(struct super_block *sb, int remount_flag)
}
file_list_lock
();
for
(
p
=
sb
->
s_files
.
next
;
p
!=
&
sb
->
s_files
;
p
=
p
->
next
)
{
struct
file
*
file
=
list_entry
(
p
,
struct
file
,
f_list
);
list_for_each_entry
(
file
,
&
sb
->
s_files
,
f_list
)
{
if
(
file
->
f_dentry
&&
file_count
(
file
)
&&
S_ISREG
(
file
->
f_dentry
->
d_inode
->
i_mode
))
file
->
f_mode
&=
~
2
;
...
...
@@ -205,15 +204,11 @@ void do_emergency_sync(void) {
remount_flag
=
(
emergency_sync_scheduled
==
EMERG_REMOUNT
);
emergency_sync_scheduled
=
0
;
for
(
sb
=
sb_entry
(
super_blocks
.
next
);
sb
!=
sb_entry
(
&
super_blocks
);
sb
=
sb_entry
(
sb
->
s_list
.
next
))
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
if
(
sb
->
s_bdev
&&
is_local_disk
(
sb
->
s_bdev
))
go_sync
(
sb
,
remount_flag
);
for
(
sb
=
sb_entry
(
super_blocks
.
next
);
sb
!=
sb_entry
(
&
super_blocks
);
sb
=
sb_entry
(
sb
->
s_list
.
next
))
list_for_each_entry
(
sb
,
&
super_blocks
,
s_list
)
if
(
sb
->
s_bdev
&&
!
is_local_disk
(
sb
->
s_bdev
))
go_sync
(
sb
,
remount_flag
);
...
...
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