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
8892097c
Commit
8892097c
authored
Jun 18, 2002
by
Neil Brown
Committed by
Linus Torvalds
Jun 18, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] md 11 of 22 - Get rid of "OUT" macro in md.c
It doesn't really help clarity or brevity.
parent
2dc0a8b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
drivers/md/md.c
drivers/md/md.c
+13
-11
No files found.
drivers/md/md.c
View file @
8892097c
...
...
@@ -1654,21 +1654,21 @@ static int do_md_run(mddev_t * mddev)
#undef TOO_BIG_CHUNKSIZE
#undef BAD_CHUNKSIZE
#define OUT(x) do { err = (x); goto out; } while (0)
static
int
restart_array
(
mddev_t
*
mddev
)
{
int
err
=
0
;
int
err
;
/*
* Complain if it has no devices
*/
err
=
-
ENXIO
;
if
(
list_empty
(
&
mddev
->
disks
))
OUT
(
-
ENXIO
)
;
goto
out
;
if
(
mddev
->
pers
)
{
err
=
-
EBUSY
;
if
(
!
mddev
->
ro
)
OUT
(
-
EBUSY
)
;
goto
out
;
mddev
->
ro
=
0
;
set_device_ro
(
mddev_to_kdev
(
mddev
),
0
);
...
...
@@ -1681,6 +1681,7 @@ static int restart_array(mddev_t *mddev)
md_recover_arrays
();
if
(
mddev
->
pers
->
restart_resync
)
mddev
->
pers
->
restart_resync
(
mddev
);
err
=
0
;
}
else
{
printk
(
KERN_ERR
"md: md%d has no personality assigned.
\n
"
,
mdidx
(
mddev
));
...
...
@@ -1703,7 +1704,8 @@ static int do_md_stop(mddev_t * mddev, int ro)
if
(
atomic_read
(
&
mddev
->
active
)
>
1
)
{
printk
(
STILL_IN_USE
,
mdidx
(
mddev
));
OUT
(
-
EBUSY
);
err
=
-
EBUSY
;
goto
out
;
}
if
(
mddev
->
pers
)
{
...
...
@@ -1731,16 +1733,18 @@ static int do_md_stop(mddev_t * mddev, int ro)
invalidate_device
(
dev
,
1
);
if
(
ro
)
{
err
=
-
ENXIO
;
if
(
mddev
->
ro
)
OUT
(
-
ENXIO
)
;
goto
out
;
mddev
->
ro
=
1
;
}
else
{
if
(
mddev
->
ro
)
set_device_ro
(
dev
,
0
);
if
(
mddev
->
pers
->
stop
(
mddev
))
{
err
=
-
EBUSY
;
if
(
mddev
->
ro
)
set_device_ro
(
dev
,
1
);
OUT
(
-
EBUSY
)
;
goto
out
;
}
if
(
mddev
->
ro
)
mddev
->
ro
=
0
;
...
...
@@ -1766,15 +1770,13 @@ static int do_md_stop(mddev_t * mddev, int ro)
if
(
!
ro
)
{
printk
(
KERN_INFO
"md: md%d stopped.
\n
"
,
mdidx
(
mddev
));
free_mddev
(
mddev
);
}
else
printk
(
KERN_INFO
"md: md%d switched to read-only mode.
\n
"
,
mdidx
(
mddev
));
err
=
0
;
out:
return
err
;
}
#undef OUT
/*
* We have to safely support old arrays too.
*/
...
...
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