/block/partitions/ |
D | check.c | 117 struct parsed_partitions *state; in allocate_partitions() local 120 state = kzalloc(sizeof(*state), GFP_KERNEL); in allocate_partitions() 121 if (!state) in allocate_partitions() 125 state->parts = vzalloc(nr * sizeof(state->parts[0])); in allocate_partitions() 126 if (!state->parts) { in allocate_partitions() 127 kfree(state); in allocate_partitions() 131 state->limit = nr; in allocate_partitions() 133 return state; in allocate_partitions() 136 void free_partitions(struct parsed_partitions *state) in free_partitions() argument 138 vfree(state->parts); in free_partitions() [all …]
|
D | msdos.c | 69 static int aix_magic_present(struct parsed_partitions *state, unsigned char *p) in aix_magic_present() argument 90 d = read_part_sector(state, 7, §); in aix_magic_present() 99 static void set_info(struct parsed_partitions *state, int slot, in set_info() argument 102 struct partition_meta_info *info = &state->parts[slot].info; in set_info() 107 state->parts[slot].has_info = true; in set_info() 121 static void parse_extended(struct parsed_partitions *state, in parse_extended() argument 129 sector_t sector_size = bdev_logical_block_size(state->bdev) / 512; in parse_extended() 140 if (state->next == state->limit) in parse_extended() 142 data = read_part_sector(state, this_sector, §); in parse_extended() 183 put_partition(state, state->next, next, size); in parse_extended() [all …]
|
D | acorn.c | 31 adfs_partition(struct parsed_partitions *state, char *name, char *data, in adfs_partition() argument 49 strlcat(state->pp_buf, " [", PAGE_SIZE); in adfs_partition() 50 strlcat(state->pp_buf, name, PAGE_SIZE); in adfs_partition() 51 strlcat(state->pp_buf, "]", PAGE_SIZE); in adfs_partition() 53 put_partition(state, slot, first_sector, nr_sects); in adfs_partition() 76 static int riscix_partition(struct parsed_partitions *state, in riscix_partition() argument 83 rr = read_part_sector(state, first_sect, §); in riscix_partition() 87 strlcat(state->pp_buf, " [RISCiX]", PAGE_SIZE); in riscix_partition() 94 strlcat(state->pp_buf, " <", PAGE_SIZE); in riscix_partition() 96 put_partition(state, slot++, first_sect, size); in riscix_partition() [all …]
|
D | ibm.c | 64 static int find_label(struct parsed_partitions *state, in find_label() argument 102 data = read_part_sector(state, testsect[i], §); in find_label() 133 static int find_vol1_partitions(struct parsed_partitions *state, in find_vol1_partitions() argument 149 strlcat(state->pp_buf, tmp, PAGE_SIZE); in find_vol1_partitions() 157 data = read_part_sector(state, blk * secperblk, §); in find_vol1_partitions() 167 data = read_part_sector(state, blk * secperblk, §); in find_vol1_partitions() 180 if (counter >= state->limit) in find_vol1_partitions() 182 put_partition(state, counter + 1, offset, size); in find_vol1_partitions() 185 data = read_part_sector(state, blk * secperblk, §); in find_vol1_partitions() 187 strlcat(state->pp_buf, "\n", PAGE_SIZE); in find_vol1_partitions() [all …]
|
D | atari.c | 34 int atari_partition(struct parsed_partitions *state) in atari_partition() argument 50 if (bdev_logical_block_size(state->bdev) != 512) in atari_partition() 53 rs = read_part_sector(state, 0, §); in atari_partition() 58 hd_size = state->bdev->bd_inode->i_size >> 9; in atari_partition() 73 strlcat(state->pp_buf, " AHDI", PAGE_SIZE); in atari_partition() 74 for (slot = 1; pi < &rs->part[4] && slot < state->limit; slot++, pi++) { in atari_partition() 84 put_partition (state, slot, be32_to_cpu(pi->st), in atari_partition() 92 strlcat(state->pp_buf, " XGM<", PAGE_SIZE); in atari_partition() 95 xrs = read_part_sector(state, partsect, §2); in atari_partition() 109 put_partition(state, slot, in atari_partition() [all …]
|
D | aix.c | 96 static size_t read_lba(struct parsed_partitions *state, u64 lba, u8 *buffer, in read_lba() argument 101 if (!buffer || lba + count / 512 > last_lba(state->bdev)) in read_lba() 107 unsigned char *data = read_part_sector(state, lba++, §); in read_lba() 130 static struct pvd *alloc_pvd(struct parsed_partitions *state, u32 lba) in alloc_pvd() argument 139 if (read_lba(state, lba, (u8 *) p, count) < count) { in alloc_pvd() 155 static struct lvname *alloc_lvn(struct parsed_partitions *state, u32 lba) in alloc_lvn() argument 164 if (read_lba(state, lba, (u8 *) p, count) < count) { in alloc_lvn() 171 int aix_partition(struct parsed_partitions *state) in aix_partition() argument 189 d = read_part_sector(state, 7, §); in aix_partition() 210 strlcat(state->pp_buf, tmp, PAGE_SIZE); in aix_partition() [all …]
|
D | efi.c | 251 static size_t read_lba(struct parsed_partitions *state, in read_lba() argument 255 struct block_device *bdev = state->bdev; in read_lba() 264 unsigned char *data = read_part_sector(state, n++, §); in read_lba() 287 static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state, in alloc_read_gpt_entries() argument 304 if (read_lba(state, le64_to_cpu(gpt->partition_entry_lba), in alloc_read_gpt_entries() 322 static gpt_header *alloc_read_gpt_header(struct parsed_partitions *state, in alloc_read_gpt_header() argument 326 unsigned ssz = bdev_logical_block_size(state->bdev); in alloc_read_gpt_header() 332 if (read_lba(state, lba, (u8 *) gpt, ssz) < ssz) { in alloc_read_gpt_header() 351 static int is_gpt_valid(struct parsed_partitions *state, u64 lba, in is_gpt_valid() argument 359 if (!(*gpt = alloc_read_gpt_header(state, lba))) in is_gpt_valid() [all …]
|
D | cmdline.c | 31 struct parsed_partitions *state = (struct parsed_partitions *)param; in add_part() local 33 if (slot >= state->limit) in add_part() 36 put_partition(state, slot, subpart->from >> 9, in add_part() 39 info = &state->parts[slot].info; in add_part() 47 strlcat(state->pp_buf, tmp, PAGE_SIZE); in add_part() 49 state->parts[slot].has_info = true; in add_part() 68 int cmdline_partition(struct parsed_partitions *state) in cmdline_partition() argument 88 bdevname(state->bdev, bdev); in cmdline_partition() 93 disk_size = get_capacity(state->bdev->bd_disk) << 9; in cmdline_partition() 95 cmdline_parts_set(parts, disk_size, 1, add_part, (void *)state); in cmdline_partition() [all …]
|
D | mac.c | 31 int mac_partition(struct parsed_partitions *state) in mac_partition() argument 45 md = read_part_sector(state, 0, §); in mac_partition() 55 data = read_part_sector(state, datasize / 512, §); in mac_partition() 72 if (blocks_in_map >= state->limit) in mac_partition() 73 blocks_in_map = state->limit - 1; in mac_partition() 75 strlcat(state->pp_buf, " [mac]", PAGE_SIZE); in mac_partition() 79 data = read_part_sector(state, pos/512, §); in mac_partition() 85 put_partition(state, slot, in mac_partition() 90 state->parts[slot].flags = ADDPART_FLAG_RAID; in mac_partition() 136 note_bootable_part(state->bdev->bd_dev, found_root, in mac_partition() [all …]
|
D | sysv68.c | 50 int sysv68_partition(struct parsed_partitions *state) in sysv68_partition() argument 60 data = read_part_sector(state, 0, §); in sysv68_partition() 73 data = read_part_sector(state, i, §); in sysv68_partition() 78 snprintf(tmp, sizeof(tmp), "sysV68: %s(s%u)", state->name, slices); in sysv68_partition() 79 strlcat(state->pp_buf, tmp, PAGE_SIZE); in sysv68_partition() 82 if (slot == state->limit) in sysv68_partition() 85 put_partition(state, slot, in sysv68_partition() 89 strlcat(state->pp_buf, tmp, PAGE_SIZE); in sysv68_partition() 93 strlcat(state->pp_buf, "\n", PAGE_SIZE); in sysv68_partition()
|
D | amiga.c | 29 int amiga_partition(struct parsed_partitions *state) in amiga_partition() argument 43 data = read_part_sector(state, blk, §); in amiga_partition() 47 bdevname(state->bdev, b), blk); in amiga_partition() 69 bdevname(state->bdev, b), blk); in amiga_partition() 80 strlcat(state->pp_buf, tmp, PAGE_SIZE); in amiga_partition() 86 data = read_part_sector(state, blk, §); in amiga_partition() 90 bdevname(state->bdev, b), blk); in amiga_partition() 114 put_partition(state,slot++,start_sect,nr_sects); in amiga_partition() 130 strlcat(state->pp_buf, tmp, PAGE_SIZE); in amiga_partition() 134 strlcat(state->pp_buf, tmp, PAGE_SIZE); in amiga_partition() [all …]
|
D | acorn.h | 11 int adfspart_check_CUMANA(struct parsed_partitions *state); 12 int adfspart_check_ADFS(struct parsed_partitions *state); 13 int adfspart_check_ICS(struct parsed_partitions *state); 14 int adfspart_check_POWERTEC(struct parsed_partitions *state); 15 int adfspart_check_EESOX(struct parsed_partitions *state);
|
D | sun.c | 14 int sun_partition(struct parsed_partitions *state) in sun_partition() argument 65 label = read_part_sector(state, 0, §); in sun_partition() 82 bdevname(state->bdev, b)); in sun_partition() 109 put_partition(state, slot, st_sector, num_sectors); in sun_partition() 110 state->parts[slot].flags = 0; in sun_partition() 113 state->parts[slot].flags |= ADDPART_FLAG_RAID; in sun_partition() 115 state->parts[slot].flags |= ADDPART_FLAG_WHOLEDISK; in sun_partition() 120 strlcat(state->pp_buf, "\n", PAGE_SIZE); in sun_partition()
|
D | sgi.c | 31 int sgi_partition(struct parsed_partitions *state) in sgi_partition() argument 43 label = read_part_sector(state, 0, §); in sgi_partition() 61 bdevname(state->bdev, b)); in sgi_partition() 74 put_partition(state, slot, start, blocks); in sgi_partition() 76 state->parts[slot].flags = ADDPART_FLAG_RAID; in sgi_partition() 80 strlcat(state->pp_buf, "\n", PAGE_SIZE); in sgi_partition()
|
D | karma.c | 14 int karma_partition(struct parsed_partitions *state) in karma_partition() argument 34 data = read_part_sector(state, 0, §); in karma_partition() 46 if (slot == state->limit) in karma_partition() 50 put_partition(state, slot, le32_to_cpu(p->p_offset), in karma_partition() 55 strlcat(state->pp_buf, "\n", PAGE_SIZE); in karma_partition()
|
D | check.h | 26 void free_partitions(struct parsed_partitions *state); 31 static inline void *read_part_sector(struct parsed_partitions *state, in read_part_sector() argument 34 if (n >= get_capacity(state->bdev->bd_disk)) { in read_part_sector() 35 state->access_beyond_eod = true; in read_part_sector() 38 return read_dev_sector(state->bdev, n, p); in read_part_sector()
|
D | osf.c | 16 int osf_partition(struct parsed_partitions *state) in osf_partition() argument 56 data = read_part_sector(state, 0, §); in osf_partition() 76 if (slot == state->limit) in osf_partition() 79 put_partition(state, slot, in osf_partition() 84 strlcat(state->pp_buf, "\n", PAGE_SIZE); in osf_partition()
|
D | ultrix.c | 13 int ultrix_partition(struct parsed_partitions *state) in ultrix_partition() argument 30 data = read_part_sector(state, (16384 - sizeof(*label))/512, §); in ultrix_partition() 39 put_partition(state, i+1, in ultrix_partition() 43 strlcat(state->pp_buf, "\n", PAGE_SIZE); in ultrix_partition()
|
D | ldm.c | 279 static bool ldm_validate_privheads(struct parsed_partitions *state, in ldm_validate_privheads() argument 290 BUG_ON (!state || !ph1); in ldm_validate_privheads() 304 data = read_part_sector(state, ph[0]->config_start + off[i], in ldm_validate_privheads() 321 num_sects = state->bdev->bd_inode->i_size >> 9; in ldm_validate_privheads() 367 static bool ldm_validate_tocblocks(struct parsed_partitions *state, in ldm_validate_tocblocks() argument 378 BUG_ON(!state || !ldb); in ldm_validate_tocblocks() 395 data = read_part_sector(state, base + off[i], §); in ldm_validate_tocblocks() 441 static bool ldm_validate_vmdb(struct parsed_partitions *state, in ldm_validate_vmdb() argument 450 BUG_ON (!state || !ldb); in ldm_validate_vmdb() 455 data = read_part_sector(state, base + OFF_VMDB, §); in ldm_validate_vmdb() [all …]
|
D | ldm.h | 143 u8 state[16]; member 210 int ldm_partition(struct parsed_partitions *state);
|
D | cmdline.h | 3 int cmdline_partition(struct parsed_partitions *state);
|
/block/ |
D | partition-generic.c | 506 struct parsed_partitions *state = NULL; in rescan_partitions() local 510 if (state && !IS_ERR(state)) { in rescan_partitions() 511 free_partitions(state); in rescan_partitions() 512 state = NULL; in rescan_partitions() 523 if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) in rescan_partitions() 525 if (IS_ERR(state)) { in rescan_partitions() 531 if (PTR_ERR(state) == -ENOSPC) { in rescan_partitions() 544 if (state->access_beyond_eod) { in rescan_partitions() 559 for (p = 1, highest = 0; p < state->limit; p++) in rescan_partitions() 560 if (state->parts[p].size) in rescan_partitions() [all …]
|
D | blk-mq-sched.c | 59 if (test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) in blk_mq_sched_mark_restart_hctx() 65 if (!test_and_set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) in blk_mq_sched_mark_restart_hctx() 68 set_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); in blk_mq_sched_mark_restart_hctx() 73 if (!test_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) in blk_mq_sched_restart_hctx() 79 if (test_and_clear_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state)) in blk_mq_sched_restart_hctx() 82 clear_bit(BLK_MQ_S_SCHED_RESTART, &hctx->state); in blk_mq_sched_restart_hctx()
|
D | blk-mq.c | 1010 clear_bit_unlock(BLK_MQ_S_TAG_WAITING, &hctx->state); in blk_mq_dispatch_wake() 1024 if (test_bit(BLK_MQ_S_TAG_WAITING, &hctx->state) || in blk_mq_dispatch_wait_add() 1025 test_and_set_bit_lock(BLK_MQ_S_TAG_WAITING, &hctx->state)) in blk_mq_dispatch_wait_add() 1151 !test_bit(BLK_MQ_S_TAG_WAITING, &hctx->state)) in blk_mq_dispatch_rq_list() 1316 set_bit(BLK_MQ_S_STOPPED, &hctx->state); in blk_mq_stop_hw_queue() 1341 clear_bit(BLK_MQ_S_STOPPED, &hctx->state); in blk_mq_start_hw_queue() 1362 clear_bit(BLK_MQ_S_STOPPED, &hctx->state); in blk_mq_start_stopped_hw_queue() 1388 if (test_bit(BLK_MQ_S_STOPPED, &hctx->state)) { in blk_mq_run_work_fn() 1389 if (!test_bit(BLK_MQ_S_START_ON_RUN, &hctx->state)) in blk_mq_run_work_fn() 1392 clear_bit(BLK_MQ_S_START_ON_RUN, &hctx->state); in blk_mq_run_work_fn() [all …]
|
D | blk-mq-tag.c | 29 if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state) && in __blk_mq_tag_busy() 30 !test_and_set_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state)) in __blk_mq_tag_busy() 54 if (!test_and_clear_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state)) in __blk_mq_tag_idle() 73 if (!test_bit(BLK_MQ_S_TAG_ACTIVE, &hctx->state)) in hctx_may_queue()
|