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
01e198f0
Commit
01e198f0
authored
Apr 12, 2024
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bdev: move ->bd_read_only to ->__bd_flags
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
1116b9fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
block/ioctl.c
block/ioctl.c
+4
-1
include/linux/blk_types.h
include/linux/blk_types.h
+1
-1
include/linux/blkdev.h
include/linux/blkdev.h
+2
-2
No files found.
block/ioctl.c
View file @
01e198f0
...
...
@@ -402,7 +402,10 @@ static int blkdev_roset(struct block_device *bdev, unsigned cmd,
if
(
ret
)
return
ret
;
}
bdev
->
bd_read_only
=
n
;
if
(
n
)
bdev_set_flag
(
bdev
,
BD_READ_ONLY
);
else
bdev_clear_flag
(
bdev
,
BD_READ_ONLY
);
return
0
;
}
...
...
include/linux/blk_types.h
View file @
01e198f0
...
...
@@ -47,7 +47,7 @@ struct block_device {
unsigned
long
bd_stamp
;
atomic_t
__bd_flags
;
// partition number + flags
#define BD_PARTNO 255 // lower 8 bits; assign-once
bool
bd_read_only
;
/* read-only policy */
#define BD_READ_ONLY (1u<<8) // read-only policy
bool
bd_write_holder
;
bool
bd_has_submit_bio
;
dev_t
bd_dev
;
...
...
include/linux/blkdev.h
View file @
01e198f0
...
...
@@ -742,13 +742,13 @@ static inline void bdev_clear_flag(struct block_device *bdev, unsigned flag)
static
inline
int
get_disk_ro
(
struct
gendisk
*
disk
)
{
return
disk
->
part0
->
bd_read_only
||
return
bdev_test_flag
(
disk
->
part0
,
BD_READ_ONLY
)
||
test_bit
(
GD_READ_ONLY
,
&
disk
->
state
);
}
static
inline
int
bdev_read_only
(
struct
block_device
*
bdev
)
{
return
bdev
->
bd_read_only
||
get_disk_ro
(
bdev
->
bd_disk
);
return
bdev
_test_flag
(
bdev
,
BD_READ_ONLY
)
||
get_disk_ro
(
bdev
->
bd_disk
);
}
bool
set_capacity_and_notify
(
struct
gendisk
*
disk
,
sector_t
size
);
...
...
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