Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
60ad2340
Commit
60ad2340
authored
Mar 02, 2008
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] switch ataflop
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
94562c17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
21 deletions
+20
-21
drivers/block/ataflop.c
drivers/block/ataflop.c
+20
-21
No files found.
drivers/block/ataflop.c
View file @
60ad2340
...
...
@@ -361,13 +361,13 @@ static void finish_fdc( void );
static
void
finish_fdc_done
(
int
dummy
);
static
void
setup_req_params
(
int
drive
);
static
void
redo_fd_request
(
void
);
static
int
fd_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
unsigned
int
static
int
fd_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
param
);
static
void
fd_probe
(
int
drive
);
static
int
fd_test_drive_present
(
int
drive
);
static
void
config_types
(
void
);
static
int
floppy_open
(
struct
inode
*
inode
,
struct
file
*
filp
);
static
int
floppy_release
(
struct
inode
*
inode
,
struct
file
*
filp
);
static
int
floppy_open
(
struct
block_device
*
bdev
,
fmode_t
mode
);
static
int
floppy_release
(
struct
gendisk
*
disk
,
fmode_t
mode
);
/************************* End of Prototypes **************************/
...
...
@@ -1483,10 +1483,10 @@ void do_fd_request(struct request_queue * q)
atari_enable_irq
(
IRQ_MFP_FDC
);
}
static
int
fd_ioctl
(
struct
inode
*
inode
,
struct
file
*
filp
,
static
int
fd_ioctl
(
struct
block_device
*
bdev
,
fmode_t
mode
,
unsigned
int
cmd
,
unsigned
long
param
)
{
struct
gendisk
*
disk
=
inode
->
i_
bdev
->
bd_disk
;
struct
gendisk
*
disk
=
bdev
->
bd_disk
;
struct
atari_floppy_struct
*
floppy
=
disk
->
private_data
;
int
drive
=
floppy
-
unit
;
int
type
=
floppy
->
type
;
...
...
@@ -1661,7 +1661,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
/* invalidate the buffer track to force a reread */
BufferDrive
=
-
1
;
set_bit
(
drive
,
&
fake_change
);
check_disk_change
(
inode
->
i_
bdev
);
check_disk_change
(
bdev
);
return
0
;
default:
return
-
EINVAL
;
...
...
@@ -1804,37 +1804,36 @@ static void __init config_types( void )
* drive with different device numbers.
*/
static
int
floppy_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
floppy_open
(
struct
block_device
*
bdev
,
fmode_t
mode
)
{
struct
atari_floppy_struct
*
p
=
inode
->
i_
bdev
->
bd_disk
->
private_data
;
int
type
=
iminor
(
inode
)
>>
2
;
struct
atari_floppy_struct
*
p
=
bdev
->
bd_disk
->
private_data
;
int
type
=
MINOR
(
bdev
->
bd_dev
)
>>
2
;
DPRINT
((
"fd_open: type=%d
\n
"
,
type
));
if
(
p
->
ref
&&
p
->
type
!=
type
)
return
-
EBUSY
;
if
(
p
->
ref
==
-
1
||
(
p
->
ref
&&
filp
->
f_
mode
&
FMODE_EXCL
))
if
(
p
->
ref
==
-
1
||
(
p
->
ref
&&
mode
&
FMODE_EXCL
))
return
-
EBUSY
;
if
(
filp
->
f_
mode
&
FMODE_EXCL
)
if
(
mode
&
FMODE_EXCL
)
p
->
ref
=
-
1
;
else
p
->
ref
++
;
p
->
type
=
type
;
if
(
filp
->
f_
mode
&
FMODE_NDELAY
)
if
(
mode
&
FMODE_NDELAY
)
return
0
;
if
(
filp
->
f_
mode
&
(
FMODE_READ
|
FMODE_WRITE
))
{
check_disk_change
(
inode
->
i_
bdev
);
if
(
filp
->
f_
mode
&
FMODE_WRITE
)
{
if
(
mode
&
(
FMODE_READ
|
FMODE_WRITE
))
{
check_disk_change
(
bdev
);
if
(
mode
&
FMODE_WRITE
)
{
if
(
p
->
wpstat
)
{
if
(
p
->
ref
<
0
)
p
->
ref
=
0
;
else
p
->
ref
--
;
floppy_release
(
inode
,
filp
);
return
-
EROFS
;
}
}
...
...
@@ -1843,9 +1842,9 @@ static int floppy_open( struct inode *inode, struct file *filp )
}
static
int
floppy_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
floppy_release
(
struct
gendisk
*
disk
,
fmode_t
mode
)
{
struct
atari_floppy_struct
*
p
=
inode
->
i_bdev
->
bd_
disk
->
private_data
;
struct
atari_floppy_struct
*
p
=
disk
->
private_data
;
if
(
p
->
ref
<
0
)
p
->
ref
=
0
;
else
if
(
!
p
->
ref
--
)
{
...
...
@@ -1857,9 +1856,9 @@ static int floppy_release( struct inode * inode, struct file * filp )
static
struct
block_device_operations
floppy_fops
=
{
.
owner
=
THIS_MODULE
,
.
__
open
=
floppy_open
,
.
__
release
=
floppy_release
,
.
__ioctl
=
fd_ioctl
,
.
open
=
floppy_open
,
.
release
=
floppy_release
,
.
locked_ioctl
=
fd_ioctl
,
.
media_changed
=
check_floppy_change
,
.
revalidate_disk
=
floppy_revalidate
,
};
...
...
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