Lines Matching full:zones
17 /* Maximum number of zones to report per blkdev_report_zones() call */
38 /* Number of superblock log zones */
50 struct blk_zone *zones = data; in copy_zone_info_cb() local
52 memcpy(&zones[idx], zone, sizeof(*zone)); in copy_zone_info_cb()
57 static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones, in sb_write_pointer() argument
64 ASSERT(zones[0].type != BLK_ZONE_TYPE_CONVENTIONAL && in sb_write_pointer()
65 zones[1].type != BLK_ZONE_TYPE_CONVENTIONAL); in sb_write_pointer()
67 empty[0] = (zones[0].cond == BLK_ZONE_COND_EMPTY); in sb_write_pointer()
68 empty[1] = (zones[1].cond == BLK_ZONE_COND_EMPTY); in sb_write_pointer()
69 full[0] = (zones[0].cond == BLK_ZONE_COND_FULL); in sb_write_pointer()
70 full[1] = (zones[1].cond == BLK_ZONE_COND_FULL); in sb_write_pointer()
73 * Possible states of log buffer zones in sb_write_pointer()
82 * 0: Use write pointer of zones[0] in sb_write_pointer()
83 * 1: Use write pointer of zones[1] in sb_write_pointer()
84 * C: Compare super blocks from zones[0] and zones[1], use the latest in sb_write_pointer()
91 *wp_ret = zones[0].start << SECTOR_SHIFT; in sb_write_pointer()
103 bytenr = ((zones[i].start + zones[i].len) in sb_write_pointer()
117 sector = zones[1].start; in sb_write_pointer()
119 sector = zones[0].start; in sb_write_pointer()
124 sector = zones[0].wp; in sb_write_pointer()
126 sector = zones[1].wp; in sb_write_pointer()
171 struct blk_zone *zones, unsigned int nr_zones) in emulate_report_zones() argument
179 zones[i].start = i * zone_sectors + pos; in emulate_report_zones()
180 zones[i].len = zone_sectors; in emulate_report_zones()
181 zones[i].capacity = zone_sectors; in emulate_report_zones()
182 zones[i].wp = zones[i].start + zone_sectors; in emulate_report_zones()
183 zones[i].type = BLK_ZONE_TYPE_CONVENTIONAL; in emulate_report_zones()
184 zones[i].cond = BLK_ZONE_COND_NOT_WP; in emulate_report_zones()
186 if (zones[i].wp >= bdev_size) { in emulate_report_zones()
196 struct blk_zone *zones, unsigned int *nr_zones) in btrfs_get_dev_zones() argument
204 ret = emulate_report_zones(device, pos, zones, *nr_zones); in btrfs_get_dev_zones()
210 copy_zone_info_cb, zones); in btrfs_get_dev_zones()
301 struct blk_zone *zones = NULL; in btrfs_get_dev_zone_info() local
366 zones = kcalloc(BTRFS_REPORT_NR_ZONES, sizeof(struct blk_zone), GFP_KERNEL); in btrfs_get_dev_zone_info()
367 if (!zones) { in btrfs_get_dev_zone_info()
372 /* Get zones type */ in btrfs_get_dev_zone_info()
375 ret = btrfs_get_dev_zones(device, sector << SECTOR_SHIFT, zones, in btrfs_get_dev_zone_info()
381 if (zones[i].type == BLK_ZONE_TYPE_SEQWRITE_REQ) in btrfs_get_dev_zone_info()
383 if (zones[i].cond == BLK_ZONE_COND_EMPTY) in btrfs_get_dev_zone_info()
387 sector = zones[nr_zones - 1].start + zones[nr_zones - 1].len; in btrfs_get_dev_zone_info()
392 "inconsistent number of zones on %s (%u/%u)", in btrfs_get_dev_zone_info()
426 * If zones[0] is conventional, always use the beginning of the in btrfs_get_dev_zone_info()
445 kfree(zones); in btrfs_get_dev_zone_info()
479 kfree(zones); in btrfs_get_dev_zone_info()
628 * in sequential zones. in btrfs_check_mountopts_zoned()
643 static int sb_log_location(struct block_device *bdev, struct blk_zone *zones, in sb_log_location() argument
649 if (zones[0].type == BLK_ZONE_TYPE_CONVENTIONAL) { in sb_log_location()
650 *bytenr_ret = zones[0].start << SECTOR_SHIFT; in sb_log_location()
654 ret = sb_write_pointer(bdev, zones, &wp); in sb_log_location()
661 if (wp == zones[0].start << SECTOR_SHIFT) in sb_log_location()
662 reset = &zones[0]; in sb_log_location()
663 else if (wp == zones[1].start << SECTOR_SHIFT) in sb_log_location()
664 reset = &zones[1]; in sb_log_location()
680 if (wp == zones[0].start << SECTOR_SHIFT) in sb_log_location()
681 wp = (zones[1].start + zones[1].len) << SECTOR_SHIFT; in sb_log_location()
693 struct blk_zone zones[BTRFS_NR_SB_LOG_ZONES]; in btrfs_sb_log_location_bdev() local
721 zones); in btrfs_sb_log_location_bdev()
727 return sb_log_location(bdev, zones, rw, bytenr_ret); in btrfs_sb_log_location_bdev()
829 * btrfs_find_allocatable_zones - find allocatable zones within a given region
835 * @return: position of allocatable zones
860 /* Check if zones in the region are all empty */ in btrfs_find_allocatable_zones()
935 /* All the zones are conventional */ in btrfs_ensure_empty_zones()
939 /* All the zones are sequential and empty */ in btrfs_ensure_empty_zones()
969 * for a block group consist of conventional zones. It is pointed to the