search for: hd_struct

Displaying 15 results from an estimated 15 matches for "hd_struct".

Did you mean: destruct
2016 Jun 30
0
[PATCH v2 02/12] genhd: Honor gen_uevent and add disk_gen_uevents
...,10 @@ static int exact_lock(dev_t devt, void *data) return 0; } -static void register_disk(struct gendisk *disk) +static void register_disk(struct gendisk *disk, bool gen_uevent) { struct device *ddev = disk_to_dev(disk); struct block_device *bdev; - struct disk_part_iter piter; - struct hd_struct *part; int err; ddev->parent = disk->driverfs_dev; @@ -563,6 +561,22 @@ static void register_disk(struct gendisk *disk) exit: /* announce disk after possible partitions are created */ dev_set_uevent_suppress(ddev, 0); + if (gen_uevent) + disk_gen_uevents(disk); +} + +/** + * disk_...
2016 Aug 17
0
[PATCH 06/15] genhd: Add return code to device_add_disk
...ents(disk); - blk_integrity_add(disk); + return retval; } EXPORT_SYMBOL(device_add_disk); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 85ce560..991b5ff 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -413,7 +413,7 @@ static inline void free_part_info(struct hd_struct *part) extern void part_round_stats(int cpu, struct hd_struct *part); /* block/genhd.c */ -extern void device_add_disk(struct device *parent, struct gendisk *disk); +extern int device_add_disk(struct device *parent, struct gendisk *disk); extern void del_gendisk(struct gendisk *gp); extern...
2016 Jun 30
17
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
The race condition is noticed between disk_add() and disk attributes, on virtio-blk hotplug. Userspace listens to the KOBJ_ADD uevent generated in add_disk(). At that point we haven't created the serial attribute file, therefore depending on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get created. As pointed out by Christoph Hellwig in the specific fix [1], virtio-blk
2016 Jun 30
17
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
The race condition is noticed between disk_add() and disk attributes, on virtio-blk hotplug. Userspace listens to the KOBJ_ADD uevent generated in add_disk(). At that point we haven't created the serial attribute file, therefore depending on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get created. As pointed out by Christoph Hellwig in the specific fix [1], virtio-blk
2012 Mar 30
10
[PATCH 0/4] block: move sd_format_disk_name() into block core as disk_name_format()
This patch series renames "sd_format_disk_name()" to "disk_name_format()" and moves it into block core. So that who needs formatting disk name can use it, instead of duplicating these similar help functions. Ren Mingxin (4): block: add function disk_name_format() into block core scsi: replace sd_format_disk_name() to disk_name_format() block: replace
2012 Mar 30
10
[PATCH 0/4] block: move sd_format_disk_name() into block core as disk_name_format()
This patch series renames "sd_format_disk_name()" to "disk_name_format()" and moves it into block core. So that who needs formatting disk name can use it, instead of duplicating these similar help functions. Ren Mingxin (4): block: add function disk_name_format() into block core scsi: replace sd_format_disk_name() to disk_name_format() block: replace
2011 Aug 16
1
[PATCH] virtio-blk: Add stats VQ to collect information about devices
...uct virtblk_req u8 status; }; +static inline void update_stat(struct virtio_blk *vb, int idx, + u16 tag, u64 val) +{ + BUG_ON(idx >= VIRTIO_BLK_S_NR); + vb->stats[idx].tag = tag; + vb->stats[idx].val = val; +} + +static void update_blk_stats(struct virtio_blk *vb) +{ + struct hd_struct *p = disk_get_part(vb->disk, 0); + int cpu; + int idx = 0; + + cpu = part_stat_lock(); + part_round_stats(cpu, p); + part_stat_unlock(); + + update_stat(vb, idx++, VIRTIO_BLK_S_READ_IO, + part_stat_read(p, ios[READ])); + update_stat(vb, idx++, VIRTIO_BLK_S_READ_MERGES, + part_stat_read...
2011 Aug 16
1
[PATCH] virtio-blk: Add stats VQ to collect information about devices
...uct virtblk_req u8 status; }; +static inline void update_stat(struct virtio_blk *vb, int idx, + u16 tag, u64 val) +{ + BUG_ON(idx >= VIRTIO_BLK_S_NR); + vb->stats[idx].tag = tag; + vb->stats[idx].val = val; +} + +static void update_blk_stats(struct virtio_blk *vb) +{ + struct hd_struct *p = disk_get_part(vb->disk, 0); + int cpu; + int idx = 0; + + cpu = part_stat_lock(); + part_round_stats(cpu, p); + part_stat_unlock(); + + update_stat(vb, idx++, VIRTIO_BLK_S_READ_IO, + part_stat_read(p, ios[READ])); + update_stat(vb, idx++, VIRTIO_BLK_S_READ_MERGES, + part_stat_read...
2016 Aug 17
20
[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes
This is an attempt to fix the issue that some disks' sysfs attributes are not ready at the time its KOBJ_ADD event is sent. The symptom is during device hotplug, udev may fail to find certain attributes, such as serial or wwn, of the disk. As a result the /dev/disk/by-id entries are not created. The cause is device_add_disk emits the uevent before returning, and the callers have to create
2016 Aug 17
20
[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes
This is an attempt to fix the issue that some disks' sysfs attributes are not ready at the time its KOBJ_ADD event is sent. The symptom is during device hotplug, udev may fail to find certain attributes, such as serial or wwn, of the disk. As a result the /dev/disk/by-id entries are not created. The cause is device_add_disk emits the uevent before returning, and the callers have to create
2019 Jul 24
20
[PATCH 00/12] block/bio, fs: convert put_page() to put_user_page*()
From: John Hubbard <jhubbard at nvidia.com> Hi, This is mostly Jerome's work, converting the block/bio and related areas to call put_user_page*() instead of put_page(). Because I've changed Jerome's patches, in some cases significantly, I'd like to get his feedback before we actually leave him listed as the author (he might want to disown some or all of these). I added a
2019 Jul 24
20
[PATCH 00/12] block/bio, fs: convert put_page() to put_user_page*()
From: John Hubbard <jhubbard at nvidia.com> Hi, This is mostly Jerome's work, converting the block/bio and related areas to call put_user_page*() instead of put_page(). Because I've changed Jerome's patches, in some cases significantly, I'd like to get his feedback before we actually leave him listed as the author (he might want to disown some or all of these). I added a
2020 Sep 01
10
remove revalidate_disk()
Hi Jens, this series removes the revalidate_disk() function, which has been a really odd duck in the last years. The prime reason why most people use it is because it propagates a size change from the gendisk to the block_device structure. But it also calls into the rather ill defined ->revalidate_disk method which is rather useless for the callers. So this adds a new helper to just
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...{ + struct blk_queue_ctx *ctx = rq->queue_ctx; + + BUG_ON(!irqs_disabled()); + drive_stat_acct(rq, 1); - __elv_add_request(q, rq, where); + spin_lock(&ctx->lock); + __elv_add_request(rq, where); + spin_unlock(&ctx->lock); } static void part_round_stats_single(int cpu, struct hd_struct *part, unsigned long now) { if (now == part->stamp) return; if (part_in_flight(part)) { @@ -1116,54 +1087,56 @@ void part_round_stats(int cpu, struct hd_struct *part) if (part->partno) part_round_stats_single(cpu, &part_to_disk(part)->part0, now); part_round_s...
2012 Apr 20
1
[PATCH] multiqueue: a hodge podge of things
...{ + struct blk_queue_ctx *ctx = rq->queue_ctx; + + BUG_ON(!irqs_disabled()); + drive_stat_acct(rq, 1); - __elv_add_request(q, rq, where); + spin_lock(&ctx->lock); + __elv_add_request(rq, where); + spin_unlock(&ctx->lock); } static void part_round_stats_single(int cpu, struct hd_struct *part, unsigned long now) { if (now == part->stamp) return; if (part_in_flight(part)) { @@ -1116,54 +1087,56 @@ void part_round_stats(int cpu, struct hd_struct *part) if (part->partno) part_round_stats_single(cpu, &part_to_disk(part)->part0, now); part_round_s...