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
8d690346
Commit
8d690346
authored
Apr 04, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block: add /sbin/hotplug support for when block devices are created and destroyed.
parent
91c17143
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
drivers/block/genhd.c
drivers/block/genhd.c
+13
-1
fs/partitions/check.c
fs/partitions/check.c
+1
-1
No files found.
drivers/block/genhd.c
View file @
8d690346
...
@@ -525,9 +525,21 @@ static struct kobj_type ktype_block = {
...
@@ -525,9 +525,21 @@ static struct kobj_type ktype_block = {
.
default_attrs
=
default_attrs
,
.
default_attrs
=
default_attrs
,
};
};
extern
struct
kobj_type
ktype_part
;
static
int
block_hotplug_filter
(
struct
kset
*
kset
,
struct
kobject
*
kobj
)
{
struct
kobj_type
*
ktype
=
get_ktype
(
kobj
);
return
((
ktype
==
&
ktype_block
)
||
(
ktype
==
&
ktype_part
));
}
static
struct
kset_hotplug_ops
block_hotplug_ops
=
{
.
filter
=
block_hotplug_filter
,
};
/* declare block_subsys. */
/* declare block_subsys. */
static
decl_subsys
(
block
,
&
ktype_block
);
static
decl_subsys
(
block
,
&
ktype_block
,
&
block_hotplug_ops
);
struct
gendisk
*
alloc_disk
(
int
minors
)
struct
gendisk
*
alloc_disk
(
int
minors
)
...
...
fs/partitions/check.c
View file @
8d690346
...
@@ -248,7 +248,7 @@ static struct attribute * default_attrs[] = {
...
@@ -248,7 +248,7 @@ static struct attribute * default_attrs[] = {
extern
struct
subsystem
block_subsys
;
extern
struct
subsystem
block_subsys
;
st
atic
st
ruct
kobj_type
ktype_part
=
{
struct
kobj_type
ktype_part
=
{
.
default_attrs
=
default_attrs
,
.
default_attrs
=
default_attrs
,
.
sysfs_ops
=
&
part_sysfs_ops
,
.
sysfs_ops
=
&
part_sysfs_ops
,
};
};
...
...
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