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
a74ee53e
Commit
a74ee53e
authored
Aug 12, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass done file pointer to block device ioctl's
They'll need it for permission checking.
parent
1dde9f57
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
27 additions
and
27 deletions
+27
-27
drivers/block/paride/pcd.c
drivers/block/paride/pcd.c
+1
-1
drivers/block/scsi_ioctl.c
drivers/block/scsi_ioctl.c
+1
-1
drivers/cdrom/cdrom.c
drivers/cdrom/cdrom.c
+3
-3
drivers/cdrom/cdu31a.c
drivers/cdrom/cdu31a.c
+1
-1
drivers/cdrom/cm206.c
drivers/cdrom/cm206.c
+1
-1
drivers/cdrom/mcd.c
drivers/cdrom/mcd.c
+1
-1
drivers/cdrom/mcdx.c
drivers/cdrom/mcdx.c
+1
-1
drivers/cdrom/sbpcd.c
drivers/cdrom/sbpcd.c
+1
-1
drivers/cdrom/viocd.c
drivers/cdrom/viocd.c
+1
-1
drivers/ide/ide-cd.c
drivers/ide/ide-cd.c
+2
-2
drivers/ide/ide-disk.c
drivers/ide/ide-disk.c
+1
-1
drivers/ide/ide-floppy.c
drivers/ide/ide-floppy.c
+1
-1
drivers/ide/ide-tape.c
drivers/ide/ide-tape.c
+1
-1
drivers/ide/ide.c
drivers/ide/ide.c
+3
-3
drivers/scsi/ide-scsi.c
drivers/scsi/ide-scsi.c
+1
-1
drivers/scsi/sd.c
drivers/scsi/sd.c
+1
-1
drivers/scsi/sr.c
drivers/scsi/sr.c
+1
-1
drivers/scsi/st.c
drivers/scsi/st.c
+1
-1
include/linux/blkdev.h
include/linux/blkdev.h
+1
-1
include/linux/cdrom.h
include/linux/cdrom.h
+2
-2
include/linux/ide.h
include/linux/ide.h
+1
-1
No files found.
drivers/block/paride/pcd.c
View file @
a74ee53e
...
...
@@ -259,7 +259,7 @@ static int pcd_block_ioctl(struct inode *inode, struct file *file,
unsigned
cmd
,
unsigned
long
arg
)
{
struct
pcd_unit
*
cd
=
inode
->
i_bdev
->
bd_disk
->
private_data
;
return
cdrom_ioctl
(
&
cd
->
info
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
&
cd
->
info
,
inode
,
cmd
,
arg
);
}
static
int
pcd_block_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/block/scsi_ioctl.c
View file @
a74ee53e
...
...
@@ -323,7 +323,7 @@ static int sg_scsi_ioctl(request_queue_t *q, struct gendisk *bd_disk,
return
err
;
}
int
scsi_cmd_ioctl
(
struct
gendisk
*
bd_disk
,
unsigned
int
cmd
,
void
__user
*
arg
)
int
scsi_cmd_ioctl
(
struct
file
*
file
,
struct
gendisk
*
bd_disk
,
unsigned
int
cmd
,
void
__user
*
arg
)
{
request_queue_t
*
q
;
struct
request
*
rq
;
...
...
drivers/cdrom/cdrom.c
View file @
a74ee53e
...
...
@@ -2072,14 +2072,14 @@ static int cdrom_read_cdda(struct cdrom_device_info *cdi, __u8 __user *ubuf,
* these days. ATAPI / SCSI specific code now mainly resides in
* mmc_ioct().
*/
int
cdrom_ioctl
(
struct
cdrom_device_info
*
cdi
,
struct
inode
*
ip
,
unsigned
int
cmd
,
unsigned
long
arg
)
int
cdrom_ioctl
(
struct
file
*
file
,
struct
cdrom_device_info
*
cdi
,
struct
inode
*
ip
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
cdrom_device_ops
*
cdo
=
cdi
->
ops
;
int
ret
;
/* Try the generic SCSI command ioctl's first.. */
ret
=
scsi_cmd_ioctl
(
ip
->
i_bdev
->
bd_disk
,
cmd
,
(
void
__user
*
)
arg
);
ret
=
scsi_cmd_ioctl
(
file
,
ip
->
i_bdev
->
bd_disk
,
cmd
,
(
void
__user
*
)
arg
);
if
(
ret
!=
-
ENOTTY
)
return
ret
;
...
...
drivers/cdrom/cdu31a.c
View file @
a74ee53e
...
...
@@ -3179,7 +3179,7 @@ static int scd_block_release(struct inode *inode, struct file *file)
static
int
scd_block_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
cmd
,
unsigned
long
arg
)
{
return
cdrom_ioctl
(
&
scd_info
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
&
scd_info
,
inode
,
cmd
,
arg
);
}
static
int
scd_block_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/cdrom/cm206.c
View file @
a74ee53e
...
...
@@ -1363,7 +1363,7 @@ static int cm206_block_release(struct inode *inode, struct file *file)
static
int
cm206_block_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
cmd
,
unsigned
long
arg
)
{
return
cdrom_ioctl
(
&
cm206_info
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
&
cm206_info
,
inode
,
cmd
,
arg
);
}
static
int
cm206_block_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/cdrom/mcd.c
View file @
a74ee53e
...
...
@@ -227,7 +227,7 @@ static int mcd_block_release(struct inode *inode, struct file *file)
static
int
mcd_block_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
cmd
,
unsigned
long
arg
)
{
return
cdrom_ioctl
(
&
mcd_info
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
&
mcd_info
,
inode
,
cmd
,
arg
);
}
static
int
mcd_block_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/cdrom/mcdx.c
View file @
a74ee53e
...
...
@@ -233,7 +233,7 @@ static int mcdx_block_ioctl(struct inode *inode, struct file *file,
unsigned
cmd
,
unsigned
long
arg
)
{
struct
s_drive_stuff
*
p
=
inode
->
i_bdev
->
bd_disk
->
private_data
;
return
cdrom_ioctl
(
&
p
->
info
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
&
p
->
info
,
inode
,
cmd
,
arg
);
}
static
int
mcdx_block_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/cdrom/sbpcd.c
View file @
a74ee53e
...
...
@@ -5372,7 +5372,7 @@ static int sbpcd_block_ioctl(struct inode *inode, struct file *file,
unsigned
cmd
,
unsigned
long
arg
)
{
struct
sbpcd_drive
*
p
=
inode
->
i_bdev
->
bd_disk
->
private_data
;
return
cdrom_ioctl
(
p
->
sbpcd_infop
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
p
->
sbpcd_infop
,
inode
,
cmd
,
arg
);
}
static
int
sbpcd_block_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/cdrom/viocd.c
View file @
a74ee53e
...
...
@@ -199,7 +199,7 @@ static int viocd_blk_ioctl(struct inode *inode, struct file *file,
unsigned
cmd
,
unsigned
long
arg
)
{
struct
disk_info
*
di
=
inode
->
i_bdev
->
bd_disk
->
private_data
;
return
cdrom_ioctl
(
&
di
->
viocd_info
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
&
di
->
viocd_info
,
inode
,
cmd
,
arg
);
}
static
int
viocd_blk_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/ide/ide-cd.c
View file @
a74ee53e
...
...
@@ -3395,10 +3395,10 @@ static int idecd_ioctl (struct inode *inode, struct file *file,
{
struct
block_device
*
bdev
=
inode
->
i_bdev
;
ide_drive_t
*
drive
=
bdev
->
bd_disk
->
private_data
;
int
err
=
generic_ide_ioctl
(
bdev
,
cmd
,
arg
);
int
err
=
generic_ide_ioctl
(
file
,
bdev
,
cmd
,
arg
);
if
(
err
==
-
EINVAL
)
{
struct
cdrom_info
*
info
=
drive
->
driver_data
;
err
=
cdrom_ioctl
(
&
info
->
devinfo
,
inode
,
cmd
,
arg
);
err
=
cdrom_ioctl
(
file
,
&
info
->
devinfo
,
inode
,
cmd
,
arg
);
}
return
err
;
}
...
...
drivers/ide/ide-disk.c
View file @
a74ee53e
...
...
@@ -1668,7 +1668,7 @@ static int idedisk_ioctl(struct inode *inode, struct file *file,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
block_device
*
bdev
=
inode
->
i_bdev
;
return
generic_ide_ioctl
(
bdev
,
cmd
,
arg
);
return
generic_ide_ioctl
(
file
,
bdev
,
cmd
,
arg
);
}
static
int
idedisk_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/ide/ide-floppy.c
View file @
a74ee53e
...
...
@@ -1946,7 +1946,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
ide_drive_t
*
drive
=
bdev
->
bd_disk
->
private_data
;
idefloppy_floppy_t
*
floppy
=
drive
->
driver_data
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
int
err
=
generic_ide_ioctl
(
bdev
,
cmd
,
arg
);
int
err
=
generic_ide_ioctl
(
file
,
bdev
,
cmd
,
arg
);
int
prevent
=
(
arg
)
?
1
:
0
;
idefloppy_pc_t
pc
;
if
(
err
!=
-
EINVAL
)
...
...
drivers/ide/ide-tape.c
View file @
a74ee53e
...
...
@@ -4807,7 +4807,7 @@ static int idetape_ioctl(struct inode *inode, struct file *file,
{
struct
block_device
*
bdev
=
inode
->
i_bdev
;
ide_drive_t
*
drive
=
bdev
->
bd_disk
->
private_data
;
int
err
=
generic_ide_ioctl
(
bdev
,
cmd
,
arg
);
int
err
=
generic_ide_ioctl
(
file
,
bdev
,
cmd
,
arg
);
if
(
err
==
-
EINVAL
)
err
=
idetape_blkdev_ioctl
(
drive
,
cmd
,
arg
);
return
err
;
...
...
drivers/ide/ide.c
View file @
a74ee53e
...
...
@@ -1453,8 +1453,8 @@ static int generic_ide_resume(struct device *dev)
return
ide_do_drive_cmd
(
drive
,
&
rq
,
ide_head_wait
);
}
int
generic_ide_ioctl
(
struct
block_device
*
bdev
,
unsigned
int
cmd
,
unsigned
long
arg
)
int
generic_ide_ioctl
(
struct
file
*
file
,
struct
block_device
*
bdev
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
ide_drive_t
*
drive
=
bdev
->
bd_disk
->
private_data
;
ide_settings_t
*
setting
;
...
...
@@ -1605,7 +1605,7 @@ int generic_ide_ioctl(struct block_device *bdev, unsigned int cmd,
case
CDROMEJECT
:
case
CDROMCLOSETRAY
:
return
scsi_cmd_ioctl
(
bdev
->
bd_disk
,
cmd
,
p
);
return
scsi_cmd_ioctl
(
file
,
bdev
->
bd_disk
,
cmd
,
p
);
case
HDIO_GET_BUSSTATE
:
if
(
!
capable
(
CAP_SYS_ADMIN
))
...
...
drivers/scsi/ide-scsi.c
View file @
a74ee53e
...
...
@@ -735,7 +735,7 @@ static int idescsi_ide_ioctl(struct inode *inode, struct file *file,
unsigned
int
cmd
,
unsigned
long
arg
)
{
struct
block_device
*
bdev
=
inode
->
i_bdev
;
return
generic_ide_ioctl
(
bdev
,
cmd
,
arg
);
return
generic_ide_ioctl
(
file
,
bdev
,
cmd
,
arg
);
}
static
struct
block_device_operations
idescsi_ops
=
{
...
...
drivers/scsi/sd.c
View file @
a74ee53e
...
...
@@ -594,7 +594,7 @@ static int sd_ioctl(struct inode * inode, struct file * filp,
case
SCSI_IOCTL_GET_BUS_NUMBER
:
return
scsi_ioctl
(
sdp
,
cmd
,
p
);
default:
error
=
scsi_cmd_ioctl
(
disk
,
cmd
,
p
);
error
=
scsi_cmd_ioctl
(
filp
,
disk
,
cmd
,
p
);
if
(
error
!=
-
ENOTTY
)
return
error
;
}
...
...
drivers/scsi/sr.c
View file @
a74ee53e
...
...
@@ -504,7 +504,7 @@ static int sr_block_ioctl(struct inode *inode, struct file *file, unsigned cmd,
case
SCSI_IOCTL_GET_BUS_NUMBER
:
return
scsi_ioctl
(
sdev
,
cmd
,
(
void
__user
*
)
arg
);
}
return
cdrom_ioctl
(
&
cd
->
cdi
,
inode
,
cmd
,
arg
);
return
cdrom_ioctl
(
file
,
&
cd
->
cdi
,
inode
,
cmd
,
arg
);
}
static
int
sr_block_media_changed
(
struct
gendisk
*
disk
)
...
...
drivers/scsi/st.c
View file @
a74ee53e
...
...
@@ -3408,7 +3408,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
case
SCSI_IOCTL_GET_BUS_NUMBER
:
break
;
default:
i
=
scsi_cmd_ioctl
(
STp
->
disk
,
cmd_in
,
p
);
i
=
scsi_cmd_ioctl
(
file
,
STp
->
disk
,
cmd_in
,
p
);
if
(
i
!=
-
ENOTTY
)
return
i
;
break
;
...
...
include/linux/blkdev.h
View file @
a74ee53e
...
...
@@ -517,7 +517,7 @@ extern int blk_remove_plug(request_queue_t *);
extern
void
blk_recount_segments
(
request_queue_t
*
,
struct
bio
*
);
extern
int
blk_phys_contig_segment
(
request_queue_t
*
q
,
struct
bio
*
,
struct
bio
*
);
extern
int
blk_hw_contig_segment
(
request_queue_t
*
q
,
struct
bio
*
,
struct
bio
*
);
extern
int
scsi_cmd_ioctl
(
struct
gendisk
*
,
unsigned
int
,
void
__user
*
);
extern
int
scsi_cmd_ioctl
(
struct
file
*
,
struct
gendisk
*
,
unsigned
int
,
void
__user
*
);
extern
void
blk_start_queue
(
request_queue_t
*
q
);
extern
void
blk_stop_queue
(
request_queue_t
*
q
);
extern
void
__blk_stop_queue
(
request_queue_t
*
q
);
...
...
include/linux/cdrom.h
View file @
a74ee53e
...
...
@@ -984,8 +984,8 @@ struct cdrom_device_ops {
extern
int
cdrom_open
(
struct
cdrom_device_info
*
cdi
,
struct
inode
*
ip
,
struct
file
*
fp
);
extern
int
cdrom_release
(
struct
cdrom_device_info
*
cdi
,
struct
file
*
fp
);
extern
int
cdrom_ioctl
(
struct
cdrom_device_info
*
cdi
,
struct
inode
*
ip
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
cdrom_ioctl
(
struct
file
*
file
,
struct
cdrom_device_info
*
cdi
,
struct
inode
*
ip
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
cdrom_media_changed
(
struct
cdrom_device_info
*
);
extern
int
register_cdrom
(
struct
cdrom_device_info
*
cdi
);
...
...
include/linux/ide.h
View file @
a74ee53e
...
...
@@ -1194,7 +1194,7 @@ typedef struct ide_driver_s {
#define DRIVER(drive) ((drive)->driver)
extern
int
generic_ide_ioctl
(
struct
block_device
*
,
unsigned
,
unsigned
long
);
extern
int
generic_ide_ioctl
(
struct
file
*
,
struct
block_device
*
,
unsigned
,
unsigned
long
);
/*
* ide_hwifs[] is the master data structure used to keep track
...
...
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