mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
[PATCH] Fix block device symlink name
As noted further on the this file, some block devices have a / in their name, so fix the "block:..." symlink name the same as the /sys/block name. Signed-off-by: Stephen Rothwell <[email protected]> Cc: Al Viro <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
66e0a9888b
commit
2436f039d2
1 changed files with 5 additions and 0 deletions
|
|
@ -372,6 +372,7 @@ static char *make_block_name(struct gendisk *disk)
|
|||
char *name;
|
||||
static char *block_str = "block:";
|
||||
int size;
|
||||
char *s;
|
||||
|
||||
size = strlen(block_str) + strlen(disk->disk_name) + 1;
|
||||
name = kmalloc(size, GFP_KERNEL);
|
||||
|
|
@ -379,6 +380,10 @@ static char *make_block_name(struct gendisk *disk)
|
|||
return NULL;
|
||||
strcpy(name, block_str);
|
||||
strcat(name, disk->disk_name);
|
||||
/* ewww... some of these buggers have / in name... */
|
||||
s = strchr(name, '/');
|
||||
if (s)
|
||||
*s = '!';
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue