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
Kirill Smelkov
linux
Commits
4d1fc631
Commit
4d1fc631
authored
Oct 05, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Oct 05, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] amiga floppy switched to alloc_disk()
parent
0309add5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
21 deletions
+28
-21
drivers/block/amiflop.c
drivers/block/amiflop.c
+27
-20
include/linux/amifd.h
include/linux/amifd.h
+1
-1
No files found.
drivers/block/amiflop.c
View file @
4d1fc631
...
@@ -1643,7 +1643,7 @@ static int floppy_open(struct inode *inode, struct file *filp)
...
@@ -1643,7 +1643,7 @@ static int floppy_open(struct inode *inode, struct file *filp)
unit
[
drive
].
dtype
=&
data_types
[
system
];
unit
[
drive
].
dtype
=&
data_types
[
system
];
unit
[
drive
].
blocks
=
unit
[
drive
].
type
->
heads
*
unit
[
drive
].
type
->
tracks
*
unit
[
drive
].
blocks
=
unit
[
drive
].
type
->
heads
*
unit
[
drive
].
type
->
tracks
*
data_types
[
system
].
sects
*
unit
[
drive
].
type
->
sect_mult
;
data_types
[
system
].
sects
*
unit
[
drive
].
type
->
sect_mult
;
set_capacity
(
&
unit
[
drive
].
disk
,
unit
[
drive
].
blocks
);
set_capacity
(
unit
[
drive
].
gen
disk
,
unit
[
drive
].
blocks
);
printk
(
KERN_INFO
"fd%d: accessing %s-disk with %s-layout
\n
"
,
drive
,
printk
(
KERN_INFO
"fd%d: accessing %s-disk with %s-layout
\n
"
,
drive
,
unit
[
drive
].
type
->
name
,
data_types
[
system
].
name
);
unit
[
drive
].
type
->
name
,
data_types
[
system
].
name
);
...
@@ -1731,9 +1731,16 @@ static int __init fd_probe_drives(void)
...
@@ -1731,9 +1731,16 @@ static int __init fd_probe_drives(void)
drives
=
0
;
drives
=
0
;
nomem
=
0
;
nomem
=
0
;
for
(
drive
=
0
;
drive
<
FD_MAX_UNITS
;
drive
++
)
{
for
(
drive
=
0
;
drive
<
FD_MAX_UNITS
;
drive
++
)
{
struct
gendisk
*
disk
;
fd_probe
(
drive
);
fd_probe
(
drive
);
if
(
unit
[
drive
].
type
->
code
!=
FD_NODRIVE
)
{
if
(
unit
[
drive
].
type
->
code
==
FD_NODRIVE
)
struct
gendisk
*
disk
=
&
unit
[
drive
].
disk
;
continue
;
disk
=
alloc_disk
();
if
(
!
disk
)
{
unit
[
drive
].
type
->
code
=
FD_NODRIVE
;
continue
;
}
unit
[
drive
].
gendisk
=
disk
;
drives
++
;
drives
++
;
if
((
unit
[
drive
].
trackbuf
=
kmalloc
(
FLOPPY_MAX_SECTORS
*
512
,
GFP_KERNEL
))
==
NULL
)
{
if
((
unit
[
drive
].
trackbuf
=
kmalloc
(
FLOPPY_MAX_SECTORS
*
512
,
GFP_KERNEL
))
==
NULL
)
{
printk
(
"no mem for "
);
printk
(
"no mem for "
);
...
@@ -1750,7 +1757,6 @@ static int __init fd_probe_drives(void)
...
@@ -1750,7 +1757,6 @@ static int __init fd_probe_drives(void)
set_capacity
(
disk
,
880
*
2
);
set_capacity
(
disk
,
880
*
2
);
add_disk
(
disk
);
add_disk
(
disk
);
}
}
}
if
((
drives
>
0
)
||
(
nomem
==
0
))
{
if
((
drives
>
0
)
||
(
nomem
==
0
))
{
if
(
drives
==
0
)
if
(
drives
==
0
)
printk
(
"no drives"
);
printk
(
"no drives"
);
...
@@ -1766,7 +1772,7 @@ static struct gendisk *floppy_find(int minor)
...
@@ -1766,7 +1772,7 @@ static struct gendisk *floppy_find(int minor)
int
drive
=
minor
&
3
;
int
drive
=
minor
&
3
;
if
(
unit
[
drive
].
type
->
code
==
FD_NODRIVE
)
if
(
unit
[
drive
].
type
->
code
==
FD_NODRIVE
)
return
NULL
;
return
NULL
;
return
&
unit
[
drive
].
disk
;
return
unit
[
drive
].
gen
disk
;
}
}
int
__init
amiga_floppy_init
(
void
)
int
__init
amiga_floppy_init
(
void
)
...
@@ -1875,7 +1881,8 @@ void cleanup_module(void)
...
@@ -1875,7 +1881,8 @@ void cleanup_module(void)
for
(
i
=
0
;
i
<
FD_MAX_UNITS
;
i
++
)
{
for
(
i
=
0
;
i
<
FD_MAX_UNITS
;
i
++
)
{
if
(
unit
[
i
].
type
->
code
!=
FD_NODRIVE
)
{
if
(
unit
[
i
].
type
->
code
!=
FD_NODRIVE
)
{
del_gendisk
(
&
unit
[
i
].
disk
);
del_gendisk
(
unit
[
i
].
gendisk
);
put_disk
(
unit
[
i
].
gendisk
);
kfree
(
unit
[
i
].
trackbuf
);
kfree
(
unit
[
i
].
trackbuf
);
}
}
}
}
...
...
include/linux/amifd.h
View file @
4d1fc631
...
@@ -55,7 +55,7 @@ struct amiga_floppy_struct {
...
@@ -55,7 +55,7 @@ struct amiga_floppy_struct {
int
busy
;
/* true when drive is active */
int
busy
;
/* true when drive is active */
int
dirty
;
/* true when trackbuf is not on disk */
int
dirty
;
/* true when trackbuf is not on disk */
int
status
;
/* current error code for unit */
int
status
;
/* current error code for unit */
struct
gendisk
disk
;
struct
gendisk
*
gen
disk
;
};
};
#endif
#endif
...
...
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