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
7089adfc
Commit
7089adfc
authored
Sep 21, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Sep 21, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] gendisk for swim3
swim3 switched to use of gendisk
parent
443ac9b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
drivers/block/swim3.c
drivers/block/swim3.c
+14
-5
No files found.
drivers/block/swim3.c
View file @
7089adfc
...
@@ -38,8 +38,8 @@
...
@@ -38,8 +38,8 @@
#include <linux/blk.h>
#include <linux/blk.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/devfs_fs_kernel.h>
static
int
floppy_blocksizes
[
2
]
=
{
512
,
512
}
;
static
struct
gendisk
disks
[
2
]
;
static
int
floppy_sizes
[
2
]
=
{
1440
,
1440
}
;
static
char
names
[
2
][
4
]
;
#define MAX_FLOPPIES 2
#define MAX_FLOPPIES 2
...
@@ -1015,6 +1015,7 @@ static devfs_handle_t floppy_devfs_handle;
...
@@ -1015,6 +1015,7 @@ static devfs_handle_t floppy_devfs_handle;
int
swim3_init
(
void
)
int
swim3_init
(
void
)
{
{
struct
device_node
*
swim
;
struct
device_node
*
swim
;
int
i
;
floppy_devfs_handle
=
devfs_mk_dir
(
NULL
,
"floppy"
,
NULL
);
floppy_devfs_handle
=
devfs_mk_dir
(
NULL
,
"floppy"
,
NULL
);
...
@@ -1039,9 +1040,17 @@ int swim3_init(void)
...
@@ -1039,9 +1040,17 @@ int swim3_init(void)
MAJOR_NR
);
MAJOR_NR
);
return
-
EBUSY
;
return
-
EBUSY
;
}
}
blk_init_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
),
DEVICE_REQUEST
,
&
swim3_lock
);
blk_init_queue
(
BLK_DEFAULT_QUEUE
(
MAJOR_NR
),
do_fd_request
,
&
swim3_lock
);
blksize_size
[
MAJOR_NR
]
=
floppy_blocksizes
;
for
(
i
=
0
;
i
<
floppy_count
;
i
++
)
{
blk_size
[
MAJOR_NR
]
=
floppy_sizes
;
struct
gendisk
*
disk
=
disks
+
i
;
disk
->
major
=
MAJOR_NR
;
disk
->
first_minor
=
i
;
disk
->
fops
=
&
floppy_fops
;
sprintf
(
names
[
i
],
"fd%d"
,
i
);
disk
->
major_name
=
names
[
i
];
set_capacity
(
disk
,
2880
);
add_disk
(
disk
);
}
}
}
return
0
;
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