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
2387e11c
Commit
2387e11c
authored
Nov 13, 2004
by
Andries E. Brouwer
Committed by
Linus Torvalds
Nov 13, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] __initdata in dm.c
parent
c6114f41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
drivers/md/dm.c
drivers/md/dm.c
+18
-21
No files found.
drivers/md/dm.c
View file @
2387e11c
...
...
@@ -138,23 +138,20 @@ static void local_exit(void)
DMINFO
(
"cleaned up"
);
}
/*
* We have a lot of init/exit functions, so it seems easier to
* store them in an array. The disposable macro 'xx'
* expands a prefix into a pair of function names.
*/
static
struct
{
int
(
*
init
)
(
void
);
void
(
*
exit
)
(
void
);
}
_inits
[]
=
{
#define xx(n) {n ## _init, n ## _exit},
xx
(
local
)
xx
(
dm_target
)
xx
(
dm_linear
)
xx
(
dm_stripe
)
xx
(
dm_interface
)
#undef xx
int
(
*
_inits
[])(
void
)
__initdata
=
{
local_init
,
dm_target_init
,
dm_linear_init
,
dm_stripe_init
,
dm_interface_init
,
};
void
(
*
_exits
[])(
void
)
__exitdata
=
{
local_exit
,
dm_target_exit
,
dm_linear_exit
,
dm_stripe_exit
,
dm_interface_exit
,
};
static
int
__init
dm_init
(
void
)
...
...
@@ -164,7 +161,7 @@ static int __init dm_init(void)
int
r
,
i
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
r
=
_inits
[
i
]
.
init
();
r
=
_inits
[
i
]();
if
(
r
)
goto
bad
;
}
...
...
@@ -173,17 +170,17 @@ static int __init dm_init(void)
bad:
while
(
i
--
)
_
inits
[
i
].
exit
();
_
exits
[
i
]
();
return
r
;
}
static
void
__exit
dm_exit
(
void
)
{
int
i
=
ARRAY_SIZE
(
_
in
its
);
int
i
=
ARRAY_SIZE
(
_
ex
its
);
while
(
i
--
)
_
inits
[
i
].
exit
();
_
exits
[
i
]
();
}
/*
...
...
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