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
f2791e7e
Commit
f2791e7e
authored
Aug 25, 2016
by
Jens Axboe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "floppy: refactor open() flags handling"
This reverts commit
09954bad
.
parent
468c298a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
19 deletions
+15
-19
drivers/block/floppy.c
drivers/block/floppy.c
+15
-19
No files found.
drivers/block/floppy.c
View file @
f2791e7e
...
...
@@ -3663,11 +3663,6 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
opened_bdev
[
drive
]
=
bdev
;
if
(
!
(
mode
&
(
FMODE_READ
|
FMODE_WRITE
)))
{
res
=
-
EINVAL
;
goto
out
;
}
res
=
-
ENXIO
;
if
(
!
floppy_track_buffer
)
{
...
...
@@ -3711,20 +3706,21 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
if
(
UFDCS
->
rawcmd
==
1
)
UFDCS
->
rawcmd
=
2
;
UDRS
->
last_checked
=
0
;
clear_bit
(
FD_OPEN_SHOULD_FAIL_BIT
,
&
UDRS
->
flags
);
check_disk_change
(
bdev
);
if
(
test_bit
(
FD_DISK_CHANGED_BIT
,
&
UDRS
->
flags
))
goto
out
;
if
(
test_bit
(
FD_OPEN_SHOULD_FAIL_BIT
,
&
UDRS
->
flags
))
goto
out
;
res
=
-
EROFS
;
if
((
mode
&
FMODE_WRITE
)
&&
!
test_bit
(
FD_DISK_WRITABLE_BIT
,
&
UDRS
->
flags
))
goto
out
;
if
(
!
(
mode
&
FMODE_NDELAY
))
{
if
(
mode
&
(
FMODE_READ
|
FMODE_WRITE
))
{
UDRS
->
last_checked
=
0
;
clear_bit
(
FD_OPEN_SHOULD_FAIL_BIT
,
&
UDRS
->
flags
);
check_disk_change
(
bdev
);
if
(
test_bit
(
FD_DISK_CHANGED_BIT
,
&
UDRS
->
flags
))
goto
out
;
if
(
test_bit
(
FD_OPEN_SHOULD_FAIL_BIT
,
&
UDRS
->
flags
))
goto
out
;
}
res
=
-
EROFS
;
if
((
mode
&
FMODE_WRITE
)
&&
!
test_bit
(
FD_DISK_WRITABLE_BIT
,
&
UDRS
->
flags
))
goto
out
;
}
mutex_unlock
(
&
open_lock
);
mutex_unlock
(
&
floppy_mutex
);
return
0
;
...
...
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