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
e8b177ce
Commit
e8b177ce
authored
Aug 23, 2011
by
Jens Axboe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-3.2/core' into for-3.2/drivers
parents
dfaa2ef6
d27769ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
block/genhd.c
block/genhd.c
+2
-2
block/ioctl.c
block/ioctl.c
+1
-1
fs/block_dev.c
fs/block_dev.c
+1
-1
include/linux/genhd.h
include/linux/genhd.h
+4
-2
No files found.
block/genhd.c
View file @
e8b177ce
...
...
@@ -536,7 +536,7 @@ void register_disk(struct gendisk *disk)
disk
->
slave_dir
=
kobject_create_and_add
(
"slaves"
,
&
ddev
->
kobj
);
/* No minors to use for partitions */
if
(
!
disk_part
itionable
(
disk
))
if
(
!
disk_part
_scan_enabled
(
disk
))
goto
exit
;
/* No such device (e.g., media were just removed) */
...
...
@@ -841,7 +841,7 @@ static int show_partition(struct seq_file *seqf, void *v)
char
buf
[
BDEVNAME_SIZE
];
/* Don't show non-partitionable removeable devices or empty devices */
if
(
!
get_capacity
(
sgp
)
||
(
!
disk_
partitionable
(
sgp
)
&&
if
(
!
get_capacity
(
sgp
)
||
(
!
disk_
max_parts
(
sgp
)
&&
(
sgp
->
flags
&
GENHD_FL_REMOVABLE
)))
return
0
;
if
(
sgp
->
flags
&
GENHD_FL_SUPPRESS_PARTITION_INFO
)
...
...
block/ioctl.c
View file @
e8b177ce
...
...
@@ -101,7 +101,7 @@ static int blkdev_reread_part(struct block_device *bdev)
struct
gendisk
*
disk
=
bdev
->
bd_disk
;
int
res
;
if
(
!
disk_part
itionable
(
disk
)
||
bdev
!=
bdev
->
bd_contains
)
if
(
!
disk_part
_scan_enabled
(
disk
)
||
bdev
!=
bdev
->
bd_contains
)
return
-
EINVAL
;
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EACCES
;
...
...
fs/block_dev.c
View file @
e8b177ce
...
...
@@ -971,7 +971,7 @@ static void flush_disk(struct block_device *bdev, bool kill_dirty)
if
(
!
bdev
->
bd_disk
)
return
;
if
(
disk_part
itionable
(
bdev
->
bd_disk
))
if
(
disk_part
_scan_enabled
(
bdev
->
bd_disk
))
bdev
->
bd_invalidated
=
1
;
}
...
...
include/linux/genhd.h
View file @
e8b177ce
...
...
@@ -128,6 +128,7 @@ struct hd_struct {
#define GENHD_FL_EXT_DEVT 64
/* allow extended devt */
#define GENHD_FL_NATIVE_CAPACITY 128
#define GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE 256
#define GENHD_FL_NO_PART_SCAN 512
enum
{
DISK_EVENT_MEDIA_CHANGE
=
1
<<
0
,
/* media changed */
...
...
@@ -234,9 +235,10 @@ static inline int disk_max_parts(struct gendisk *disk)
return
disk
->
minors
;
}
static
inline
bool
disk_part
itionable
(
struct
gendisk
*
disk
)
static
inline
bool
disk_part
_scan_enabled
(
struct
gendisk
*
disk
)
{
return
disk_max_parts
(
disk
)
>
1
;
return
disk_max_parts
(
disk
)
>
1
&&
!
(
disk
->
flags
&
GENHD_FL_NO_PART_SCAN
);
}
static
inline
dev_t
disk_devt
(
struct
gendisk
*
disk
)
...
...
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