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
d9036aaf
Commit
d9036aaf
authored
Mar 04, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Mar 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] (3/3) more kdev_t removals
parent
ebe5c28e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
drivers/block/blkpg.c
drivers/block/blkpg.c
+8
-6
No files found.
drivers/block/blkpg.c
View file @
d9036aaf
...
...
@@ -63,12 +63,13 @@
* or has the same number as an existing one
* 0: all OK.
*/
int
add_partition
(
kdev_t
dev
,
struct
blkpg_partition
*
p
)
int
add_partition
(
struct
block_device
*
b
dev
,
struct
blkpg_partition
*
p
)
{
struct
gendisk
*
g
;
long
long
ppstart
,
pplength
;
long
pstart
,
plength
;
int
i
,
drive
,
first_minor
,
end_minor
,
minor
;
kdev_t
dev
=
to_kdev_t
(
bdev
->
bd_dev
);
/* convert bytes to sectors, check for fit in a hd_struct */
ppstart
=
(
p
->
start
>>
9
);
...
...
@@ -126,8 +127,9 @@ int add_partition(kdev_t dev, struct blkpg_partition *p)
*
* Note that the dev argument refers to the entire disk, not the partition.
*/
int
del_partition
(
kdev_t
dev
,
struct
blkpg_partition
*
p
)
int
del_partition
(
struct
block_device
*
b
dev
,
struct
blkpg_partition
*
p
)
{
kdev_t
dev
=
to_kdev_t
(
bdev
->
bd_dev
);
struct
gendisk
*
g
;
kdev_t
devp
;
int
drive
,
first_minor
,
minor
;
...
...
@@ -168,7 +170,7 @@ int del_partition(kdev_t dev, struct blkpg_partition *p)
return
0
;
}
int
blkpg_ioctl
(
kdev_t
dev
,
struct
blkpg_ioctl_arg
*
arg
)
int
blkpg_ioctl
(
struct
block_device
*
b
dev
,
struct
blkpg_ioctl_arg
*
arg
)
{
struct
blkpg_ioctl_arg
a
;
struct
blkpg_partition
p
;
...
...
@@ -188,9 +190,9 @@ int blkpg_ioctl(kdev_t dev, struct blkpg_ioctl_arg *arg)
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
-
EACCES
;
if
(
a
.
op
==
BLKPG_ADD_PARTITION
)
return
add_partition
(
dev
,
&
p
);
return
add_partition
(
b
dev
,
&
p
);
else
return
del_partition
(
dev
,
&
p
);
return
del_partition
(
b
dev
,
&
p
);
default:
return
-
EINVAL
;
}
...
...
@@ -263,7 +265,7 @@ int blk_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg)
#endif
case
BLKPG
:
return
blkpg_ioctl
(
dev
,
(
struct
blkpg_ioctl_arg
*
)
arg
);
return
blkpg_ioctl
(
b
dev
,
(
struct
blkpg_ioctl_arg
*
)
arg
);
/*
* deprecated, use the /proc/iosched interface instead
...
...
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