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
91e7ecdc
Commit
91e7ecdc
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] dasd switched to alloc_disk()
parent
529ba807
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
32 deletions
+4
-32
drivers/s390/block/dasd.c
drivers/s390/block/dasd.c
+1
-1
drivers/s390/block/dasd_genhd.c
drivers/s390/block/dasd_genhd.c
+3
-30
drivers/s390/block/dasd_int.h
drivers/s390/block/dasd_int.h
+0
-1
No files found.
drivers/s390/block/dasd.c
View file @
91e7ecdc
...
...
@@ -270,7 +270,7 @@ dasd_free_device(dasd_device_t *device)
kfree
(
device
->
private
);
free_page
((
unsigned
long
)
device
->
erp_mem
);
free_pages
((
unsigned
long
)
device
->
ccw_mem
,
1
);
dasd_gendisk_free
(
device
->
gdp
);
put_disk
(
device
->
gdp
);
kfree
(
device
);
}
...
...
drivers/s390/block/dasd_genhd.c
View file @
91e7ecdc
...
...
@@ -167,7 +167,6 @@ dasd_gendisk_alloc(char *device_name, int devindex)
struct
list_head
*
l
;
struct
major_info
*
mi
;
struct
gendisk
*
gdp
;
struct
hd_struct
*
gd_part
;
int
index
,
len
,
rc
;
/* Make sure the major for this device exists. */
...
...
@@ -191,26 +190,15 @@ dasd_gendisk_alloc(char *device_name, int devindex)
}
}
/* Allocate genhd structure and gendisk arrays. */
gdp
=
kmalloc
(
sizeof
(
struct
gendisk
),
GFP_KERNEL
);
gd_part
=
kmalloc
(
sizeof
(
struct
hd_struct
)
<<
DASD_PARTN_BITS
,
GFP_ATOMIC
);
/* Check if one of the allocations failed. */
if
(
gdp
==
NULL
||
gd_part
==
NULL
)
{
/* We rely on kfree to do the != NULL check. */
kfree
(
gd_part
);
kfree
(
gdp
);
gdp
=
alloc_disk
();
if
(
!
gdp
)
return
ERR_PTR
(
-
ENOMEM
);
}
/* Initialize gendisk structure. */
memset
(
gdp
,
0
,
sizeof
(
struct
gendisk
));
memcpy
(
gdp
->
disk_name
,
device_name
,
16
);
memcpy
(
gdp
->
disk_name
,
device_name
,
16
);
/* huh? -- AV */
gdp
->
major
=
mi
->
major
;
gdp
->
first_minor
=
index
<<
DASD_PARTN_BITS
;
gdp
->
minor_shift
=
DASD_PARTN_BITS
;
gdp
->
part
=
gd_part
;
gdp
->
fops
=
&
dasd_device_operations
;
/*
...
...
@@ -228,24 +216,9 @@ dasd_gendisk_alloc(char *device_name, int devindex)
'a'
+
(((
devindex
-
26
)
/
26
)
%
26
));
}
len
+=
sprintf
(
device_name
+
len
,
"%c"
,
'a'
+
(
devindex
%
26
));
/* Initialize the gendisk arrays. */
memset
(
gd_part
,
0
,
sizeof
(
struct
hd_struct
)
<<
DASD_PARTN_BITS
);
return
gdp
;
}
/*
* Free gendisk structure for devindex.
*/
void
dasd_gendisk_free
(
struct
gendisk
*
gdp
)
{
/* Free memory. */
kfree
(
gdp
->
part
);
kfree
(
gdp
);
}
/*
* Return devindex of first device using a specific major number.
*/
...
...
drivers/s390/block/dasd_int.h
View file @
91e7ecdc
...
...
@@ -480,7 +480,6 @@ void dasd_gendisk_exit(void);
int
dasd_gendisk_major_index
(
int
);
int
dasd_gendisk_index_major
(
int
);
struct
gendisk
*
dasd_gendisk_alloc
(
char
*
,
int
);
void
dasd_gendisk_free
(
struct
gendisk
*
);
void
dasd_setup_partitions
(
dasd_device_t
*
);
void
dasd_destroy_partitions
(
dasd_device_t
*
);
...
...
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