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
80f6d6c0
Commit
80f6d6c0
authored
Oct 02, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Oct 02, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] md switched to dynamic allocation
parent
7665869a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
drivers/md/md.c
drivers/md/md.c
+3
-4
No files found.
drivers/md/md.c
View file @
80f6d6c0
...
@@ -1389,10 +1389,9 @@ static int do_md_run(mddev_t * mddev)
...
@@ -1389,10 +1389,9 @@ static int do_md_run(mddev_t * mddev)
#endif
#endif
}
}
disk
=
kmalloc
(
sizeof
(
struct
gendisk
),
GFP_KERNEL
);
disk
=
alloc_disk
(
);
if
(
!
disk
)
if
(
!
disk
)
return
-
ENOMEM
;
return
-
ENOMEM
;
memset
(
disk
,
0
,
sizeof
(
struct
gendisk
));
disk
->
major
=
MD_MAJOR
;
disk
->
major
=
MD_MAJOR
;
disk
->
first_minor
=
mdidx
(
mddev
);
disk
->
first_minor
=
mdidx
(
mddev
);
disk
->
minor_shift
=
0
;
disk
->
minor_shift
=
0
;
...
@@ -1408,7 +1407,7 @@ static int do_md_run(mddev_t * mddev)
...
@@ -1408,7 +1407,7 @@ static int do_md_run(mddev_t * mddev)
if
(
err
)
{
if
(
err
)
{
printk
(
KERN_ERR
"md: pers->run() failed ...
\n
"
);
printk
(
KERN_ERR
"md: pers->run() failed ...
\n
"
);
mddev
->
pers
=
NULL
;
mddev
->
pers
=
NULL
;
kfree
(
disk
);
put_disk
(
disk
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -1538,7 +1537,7 @@ static int do_md_stop(mddev_t * mddev, int ro)
...
@@ -1538,7 +1537,7 @@ static int do_md_stop(mddev_t * mddev, int ro)
if
(
disk
)
{
if
(
disk
)
{
del_gendisk
(
disk
);
del_gendisk
(
disk
);
kfree
(
disk
);
put_disk
(
disk
);
}
}
}
else
}
else
...
...
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