mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 14:12:51 +00:00
block: struct device - replace bus_id with dev_name(), dev_set_name()
Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
4383fc3d9a
commit
3ada8b7e98
@ -42,7 +42,7 @@ struct bsg_device {
|
|||||||
int done_cmds;
|
int done_cmds;
|
||||||
wait_queue_head_t wq_done;
|
wait_queue_head_t wq_done;
|
||||||
wait_queue_head_t wq_free;
|
wait_queue_head_t wq_free;
|
||||||
char name[BUS_ID_SIZE];
|
char name[20];
|
||||||
int max_queue;
|
int max_queue;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
};
|
};
|
||||||
@ -781,7 +781,7 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
|
|||||||
mutex_lock(&bsg_mutex);
|
mutex_lock(&bsg_mutex);
|
||||||
hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(iminor(inode)));
|
hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(iminor(inode)));
|
||||||
|
|
||||||
strncpy(bd->name, rq->bsg_dev.class_dev->bus_id, sizeof(bd->name) - 1);
|
strncpy(bd->name, dev_name(rq->bsg_dev.class_dev), sizeof(bd->name) - 1);
|
||||||
dprintk("bound to <%s>, max queue %d\n",
|
dprintk("bound to <%s>, max queue %d\n",
|
||||||
format_dev_t(buf, inode->i_rdev), bd->max_queue);
|
format_dev_t(buf, inode->i_rdev), bd->max_queue);
|
||||||
|
|
||||||
@ -992,7 +992,7 @@ int bsg_register_queue(struct request_queue *q, struct device *parent,
|
|||||||
if (name)
|
if (name)
|
||||||
devname = name;
|
devname = name;
|
||||||
else
|
else
|
||||||
devname = parent->bus_id;
|
devname = dev_name(parent);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we need a proper transport to send commands, not a stacked device
|
* we need a proper transport to send commands, not a stacked device
|
||||||
|
@ -1084,7 +1084,7 @@ dev_t blk_lookup_devt(const char *name, int partno)
|
|||||||
struct gendisk *disk = dev_to_disk(dev);
|
struct gendisk *disk = dev_to_disk(dev);
|
||||||
struct hd_struct *part;
|
struct hd_struct *part;
|
||||||
|
|
||||||
if (strcmp(dev->bus_id, name))
|
if (strcmp(dev_name(dev), name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
part = disk_get_part(disk, partno);
|
part = disk_get_part(disk, partno);
|
||||||
|
@ -384,9 +384,9 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
|
|||||||
|
|
||||||
dname = dev_name(ddev);
|
dname = dev_name(ddev);
|
||||||
if (isdigit(dname[strlen(dname) - 1]))
|
if (isdigit(dname[strlen(dname) - 1]))
|
||||||
snprintf(pdev->bus_id, BUS_ID_SIZE, "%sp%d", dname, partno);
|
dev_set_name(pdev, "%sp%d", dname, partno);
|
||||||
else
|
else
|
||||||
snprintf(pdev->bus_id, BUS_ID_SIZE, "%s%d", dname, partno);
|
dev_set_name(pdev, "%s%d", dname, partno);
|
||||||
|
|
||||||
device_initialize(pdev);
|
device_initialize(pdev);
|
||||||
pdev->class = &block_class;
|
pdev->class = &block_class;
|
||||||
@ -447,16 +447,11 @@ void register_disk(struct gendisk *disk)
|
|||||||
struct block_device *bdev;
|
struct block_device *bdev;
|
||||||
struct disk_part_iter piter;
|
struct disk_part_iter piter;
|
||||||
struct hd_struct *part;
|
struct hd_struct *part;
|
||||||
char *s;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
ddev->parent = disk->driverfs_dev;
|
ddev->parent = disk->driverfs_dev;
|
||||||
|
|
||||||
strlcpy(ddev->bus_id, disk->disk_name, BUS_ID_SIZE);
|
dev_set_name(ddev, disk->disk_name);
|
||||||
/* ewww... some of these buggers have / in the name... */
|
|
||||||
s = strchr(ddev->bus_id, '/');
|
|
||||||
if (s)
|
|
||||||
*s = '!';
|
|
||||||
|
|
||||||
/* delay uevents, until we scanned partition table */
|
/* delay uevents, until we scanned partition table */
|
||||||
ddev->uevent_suppress = 1;
|
ddev->uevent_suppress = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user