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
5594d5a3
Commit
5594d5a3
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 xpram
xpram switched to use of gendisk
parent
0d608510
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
drivers/s390/block/xpram.c
drivers/s390/block/xpram.c
+14
-1
No files found.
drivers/s390/block/xpram.c
View file @
5594d5a3
...
@@ -59,6 +59,8 @@ typedef struct {
...
@@ -59,6 +59,8 @@ typedef struct {
static
xpram_device_t
xpram_devices
[
XPRAM_MAX_DEVS
];
static
xpram_device_t
xpram_devices
[
XPRAM_MAX_DEVS
];
static
int
xpram_sizes
[
XPRAM_MAX_DEVS
];
static
int
xpram_sizes
[
XPRAM_MAX_DEVS
];
static
struct
gendisk
xpram_disks
[
XPRAM_MAX_DEVS
];
static
char
xpram_names
[
XPRAM_MAX_DEV
][
8
];
static
unsigned
long
xpram_pages
;
static
unsigned
long
xpram_pages
;
static
int
xpram_devs
;
static
int
xpram_devs
;
static
devfs_handle_t
xpram_devfs_handle
;
static
devfs_handle_t
xpram_devfs_handle
;
...
@@ -459,16 +461,24 @@ static int __init xpram_setup_blkdev(void)
...
@@ -459,16 +461,24 @@ static int __init xpram_setup_blkdev(void)
q
=
BLK_DEFAULT_QUEUE
(
XPRAM_MAJOR
);
q
=
BLK_DEFAULT_QUEUE
(
XPRAM_MAJOR
);
blk_queue_make_request
(
q
,
xpram_make_request
);
blk_queue_make_request
(
q
,
xpram_make_request
);
blk_queue_hardsect_size
(
q
,
4096
);
blk_queue_hardsect_size
(
q
,
4096
);
blk_size
[
XPRAM_MAJOR
]
=
xpram_sizes
;
/*
/*
* Setup device structures.
* Setup device structures.
*/
*/
offset
=
0
;
offset
=
0
;
for
(
i
=
0
;
i
<
xpram_devs
;
i
++
)
{
for
(
i
=
0
;
i
<
xpram_devs
;
i
++
)
{
struct
gendisk
*
disk
=
xpram_disks
+
i
;
xpram_devices
[
i
].
size
=
xpram_sizes
[
i
]
/
4
;
xpram_devices
[
i
].
size
=
xpram_sizes
[
i
]
/
4
;
xpram_devices
[
i
].
offset
=
offset
;
xpram_devices
[
i
].
offset
=
offset
;
offset
+=
xpram_devices
[
i
].
size
;
offset
+=
xpram_devices
[
i
].
size
;
disk
->
major
=
XPRAM_MAJOR
;
disk
->
first_minor
=
i
;
disk
->
minor_shift
=
0
;
disk
->
fops
=
&
xpram_devops
;
sprintf
(
xpram_names
[
i
],
"slram%d"
,
i
);
disk
->
major_name
=
xpram_names
[
i
];
set_capacity
(
disk
,
xpram_sizes
[
i
]
<<
1
);
add_disk
(
disk
);
}
}
return
0
;
return
0
;
...
@@ -479,6 +489,9 @@ static int __init xpram_setup_blkdev(void)
...
@@ -479,6 +489,9 @@ static int __init xpram_setup_blkdev(void)
*/
*/
static
void
__exit
xpram_exit
(
void
)
static
void
__exit
xpram_exit
(
void
)
{
{
int
i
;
for
(
i
=
0
;
i
<
xpram_devs
;
i
++
)
del_gendisk
(
xpram_disks
+
i
);
blk_clear
(
XPRAM_MAJOR
);
blk_clear
(
XPRAM_MAJOR
);
unregister_blkdev
(
XPRAM_MAJOR
,
XPRAM_NAME
);
unregister_blkdev
(
XPRAM_MAJOR
,
XPRAM_NAME
);
devfs_unregister
(
xpram_devfs_handle
);
devfs_unregister
(
xpram_devfs_handle
);
...
...
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