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
nexedi
linux
Commits
c509ddbb
Commit
c509ddbb
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] pd.c cleanups
Removed cruft from pd_ioctl() and friends.
parent
d01cb174
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
25 deletions
+11
-25
drivers/block/paride/pd.c
drivers/block/paride/pd.c
+11
-25
No files found.
drivers/block/paride/pd.c
View file @
c509ddbb
...
...
@@ -287,8 +287,6 @@ static void pd_doorlock(struct pd_unit *disk, int func);
static
int
pd_check_media
(
kdev_t
dev
);
static
void
pd_eject
(
struct
pd_unit
*
disk
);
/* 'unit' must be defined in all functions - either as a local or a param */
static
char
pd_scratch
[
512
];
/* scratch block buffer */
/* the variables below are used mainly in the I/O request engine, which
...
...
@@ -368,11 +366,8 @@ static int pd_ioctl(struct inode *inode, struct file *file,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
hd_geometry
*
geo
=
(
struct
hd_geometry
*
)
arg
;
int
err
,
unit
=
DEVICE_NR
(
inode
->
i_rdev
);
struct
pd_unit
*
disk
=
pd
+
unit
;
if
(
!
disk
->
present
)
return
-
ENODEV
;
struct
hd_geometry
g
;
struct
pd_unit
*
disk
=
pd
+
DEVICE_NR
(
inode
->
i_rdev
);
switch
(
cmd
)
{
case
CDROMEJECT
:
...
...
@@ -380,23 +375,18 @@ static int pd_ioctl(struct inode *inode, struct file *file,
pd_eject
(
disk
);
return
0
;
case
HDIO_GETGEO
:
if
(
!
geo
)
return
-
EINVAL
;
err
=
verify_area
(
VERIFY_WRITE
,
geo
,
sizeof
(
*
geo
));
if
(
err
)
return
err
;
if
(
disk
->
alt_geom
)
{
put_user
(
disk
->
capacity
/
(
PD_LOG_HEADS
*
PD_LOG_SECTS
),
(
short
*
)
&
geo
->
cylinders
);
put_user
(
PD_LOG_HEADS
,
(
char
*
)
&
geo
->
heads
);
put_user
(
PD_LOG_SECTS
,
(
char
*
)
&
geo
->
sectors
);
g
.
heads
=
PD_LOG_HEADS
;
g
.
sectors
=
PD_LOG_SECTS
;
g
.
cylinders
=
disk
->
capacity
/
(
g
.
heads
*
g
.
sectors
);
}
else
{
put_user
(
disk
->
cylinders
,
(
short
*
)
&
geo
->
cylinders
)
;
put_user
(
disk
->
heads
,
(
char
*
)
&
geo
->
heads
)
;
put_user
(
disk
->
sectors
,
(
char
*
)
&
geo
->
sectors
)
;
g
.
heads
=
disk
->
heads
;
g
.
sectors
=
disk
->
sectors
;
g
.
cylinders
=
disk
->
cylinders
;
}
put_user
(
get_start_sect
(
inode
->
i_bdev
),
(
long
*
)
&
geo
->
start
);
g
.
start
=
get_start_sect
(
inode
->
i_bdev
);
if
(
copy_to_user
(
geo
,
&
g
,
sizeof
(
struct
hd_geometry
)))
return
-
EFAULT
;
return
0
;
default:
return
-
EINVAL
;
...
...
@@ -418,8 +408,6 @@ static int pd_check_media(kdev_t dev)
{
int
r
,
unit
=
DEVICE_NR
(
dev
);
struct
pd_unit
*
disk
=
pd
+
unit
;
if
(
unit
>=
PD_UNITS
||
(
!
disk
->
present
))
return
-
ENODEV
;
if
(
!
disk
->
removable
)
return
0
;
pd_media_check
(
disk
);
...
...
@@ -432,8 +420,6 @@ static int pd_revalidate(kdev_t dev)
{
int
unit
=
DEVICE_NR
(
dev
);
struct
pd_unit
*
disk
=
pd
+
unit
;
if
(
unit
>=
PD_UNITS
||
!
disk
->
present
)
return
-
ENODEV
;
if
(
pd_identify
(
disk
))
set_capacity
(
disk
->
gd
,
disk
->
capacity
);
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