| #include <linux/pagemap.h> |
| #include <linux/blkdev.h> |
| * add_gd_partition adds a partitions details to the devices partition |
| struct parsed_partitions { |
| struct block_device *bdev; |
| char name[BDEVNAME_SIZE]; |
| struct partition_meta_info info; |
| static inline void *read_part_sector(struct parsed_partitions *state, |
| if (n >= get_capacity(state->bdev->bd_disk)) { |
| state->access_beyond_eod = true; |
| return read_dev_sector(state->bdev, n, p); |
| put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size) |
| char tmp[1 + BDEVNAME_SIZE + 10 + 1]; |
| snprintf(tmp, sizeof(tmp), " %s%d", p->name, n); |
| strlcat(p->pp_buf, tmp, PAGE_SIZE); |