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
bbad4394
Commit
bbad4394
authored
Sep 29, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Sep 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] floppy fixes
corrected handling of sizes. Ugh.
parent
02bf8fda
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 @
bbad4394
...
...
@@ -777,7 +777,7 @@ static int disk_change(int drive)
DPRINT
(
"Disk type is undefined after "
"disk change
\n
"
);
current_type
[
drive
]
=
NULL
;
floppy_sizes
[
TOMINOR
(
drive
)]
=
MAX_DISK_SIZE
;
floppy_sizes
[
TOMINOR
(
drive
)]
=
MAX_DISK_SIZE
<<
1
;
}
/*USETF(FD_DISK_NEWCHANGE);*/
...
...
@@ -2424,8 +2424,7 @@ static void rw_interrupt(void)
return
;
}
current_type
[
current_drive
]
=
_floppy
;
floppy_sizes
[
TOMINOR
(
current_drive
)
]
=
(
_floppy
->
size
+
1
)
>>
1
;
floppy_sizes
[
TOMINOR
(
current_drive
)
]
=
_floppy
->
size
;
break
;
}
...
...
@@ -2434,7 +2433,7 @@ static void rw_interrupt(void)
DPRINT
(
"Auto-detected floppy type %s in fd%d
\n
"
,
_floppy
->
name
,
current_drive
);
current_type
[
current_drive
]
=
_floppy
;
floppy_sizes
[
TOMINOR
(
current_drive
)]
=
(
_floppy
->
size
+
1
)
>>
1
;
floppy_sizes
[
TOMINOR
(
current_drive
)]
=
_floppy
->
size
;
probing
=
0
;
}
...
...
@@ -3343,7 +3342,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
floppy_type
[
type
].
name
=
"user format"
;
for
(
cnt
=
type
<<
2
;
cnt
<
(
type
<<
2
)
+
4
;
cnt
++
)
floppy_sizes
[
cnt
]
=
floppy_sizes
[
cnt
+
0x80
]
=
(
floppy_type
[
type
].
size
+
1
)
>>
1
;
floppy_type
[
type
].
size
+
1
;
process_fd_request
();
for
(
cnt
=
0
;
cnt
<
N_DRIVE
;
cnt
++
){
if
(
ITYPE
(
drive_state
[
cnt
].
fd_device
)
==
type
&&
...
...
@@ -3362,7 +3361,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
if
(
buffer_drive
==
drive
)
SUPBOUND
(
buffer_max
,
user_params
[
drive
].
sect
);
current_type
[
drive
]
=
&
user_params
[
drive
];
floppy_sizes
[
drive
]
=
(
user_params
[
drive
].
size
+
1
)
>>
1
;
floppy_sizes
[
drive
]
=
user_params
[
drive
].
size
;
if
(
cmd
==
FDDEFPRM
)
DRS
->
keep_data
=
-
1
;
else
...
...
@@ -3536,7 +3535,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
case
FDCLRPRM
:
LOCK_FDC
(
drive
,
1
);
current_type
[
drive
]
=
NULL
;
floppy_sizes
[
drive
]
=
MAX_DISK_SIZE
;
floppy_sizes
[
drive
]
=
MAX_DISK_SIZE
<<
1
;
UDRS
->
keep_data
=
0
;
return
invalidate_drive
(
inode
->
i_bdev
);
case
FDSETPRM
:
...
...
@@ -3710,11 +3709,6 @@ static int floppy_open(struct inode * inode, struct file * filp)
int
try
;
char
*
tmp
;
if
(
!
filp
)
{
DPRINT
(
"Weird, open called with filp=0
\n
"
);
return
-
EIO
;
}
filp
->
private_data
=
(
void
*
)
0
;
drive
=
DRIVE
(
inode
->
i_rdev
);
...
...
@@ -3925,6 +3919,7 @@ static int floppy_revalidate(kdev_t dev)
#define NO_GEOM (!current_type[drive] && !TYPE(dev))
int
drive
=
DRIVE
(
dev
);
int
cf
;
int
res
=
0
;
if
(
UTESTF
(
FD_DISK_CHANGED
)
||
UTESTF
(
FD_VERIFY
)
||
...
...
@@ -3950,14 +3945,15 @@ static int floppy_revalidate(kdev_t dev)
UDRS
->
generation
++
;
if
(
NO_GEOM
){
/* auto-sensing */
return
floppy_read_block_0
(
dev
);
res
=
floppy_read_block_0
(
dev
);
}
else
{
if
(
cf
)
poll_drive
(
0
,
FD_RAW_NEED_DISK
);
process_fd_request
();
}
if
(
cf
)
poll_drive
(
0
,
FD_RAW_NEED_DISK
);
process_fd_request
();
}
set_capacity
(
&
disks
[
drive
],
floppy_sizes
[
minor
(
dev
)]);
return
0
;
return
res
;
}
static
struct
block_device_operations
floppy_fops
=
{
...
...
@@ -4261,9 +4257,9 @@ int __init floppy_init(void)
for
(
i
=
0
;
i
<
256
;
i
++
)
if
(
ITYPE
(
i
))
floppy_sizes
[
i
]
=
(
floppy_type
[
ITYPE
(
i
)].
size
+
1
)
>>
1
;
floppy_sizes
[
i
]
=
floppy_type
[
ITYPE
(
i
)].
size
;
else
floppy_sizes
[
i
]
=
MAX_DISK_SIZE
;
floppy_sizes
[
i
]
=
MAX_DISK_SIZE
<<
1
;
blk_init_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
),
do_fd_request
,
&
floppy_lock
);
reschedule_timeout
(
MAXTIMEOUT
,
"floppy init"
,
MAXTIMEOUT
);
...
...
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