@@ -1631,11 +1631,12 @@ static struct io_policy_node *policy_search_node(const struct io_cgroup *iocg,
return NULL;
}
-static int devname_to_devnum(const char *buf, dev_t *dev)
+static int devname_to_devnum(char *buf, dev_t *dev)
{
struct block_device *bdev;
struct gendisk *disk;
int part;
+ char *c;
bdev = lookup_bdev(buf);
if (IS_ERR(bdev))
@@ -1645,6 +1646,10 @@ static int devname_to_devnum(const char *buf, dev_t *dev)
*dev = MKDEV(disk->major, disk->first_minor);
bdput(bdev);
+ c = strrchr(buf, '/');
+ if (c)
+ strcpy(c+1, disk->disk_name);
+
return 0;
}