Lines Matching full:zone
32 * Get the name of a zone group directory.
48 * Manage the active zone count.
66 * If the zone is active, that is, if it is explicitly open or in zonefs_account_active()
79 /* The zone is not active. If it was, update the active count */ in zonefs_account_active()
87 * Manage the active zone count. Called with zi->i_truncate_mutex held.
97 * Execute a zone management operation.
105 * With ZNS drives, closing an explicitly open zone that has not been in zonefs_zone_mgmt()
106 * written will change the zone state to "closed", that is, the zone in zonefs_zone_mgmt()
108 * open operation on other zones if the drive active zone resources in zonefs_zone_mgmt()
109 * are exceeded, make sure that the zone does not remain active by in zonefs_zone_mgmt()
120 "Zone management operation %s at %llu failed %d\n", in zonefs_zone_mgmt()
142 * A full zone is no longer open/active and does not need in zonefs_i_size_write()
187 * Check a zone condition. Return the amount of written (and still readable)
188 * data in the zone.
192 struct blk_zone *zone) in zonefs_check_zone_condition() argument
194 switch (zone->cond) { in zonefs_check_zone_condition()
196 zonefs_warn(sb, "Zone %llu: offline zone\n", in zonefs_check_zone_condition()
203 * determine the zone wpoffset (inode size). We thus keep the in zonefs_check_zone_condition()
204 * zone wpoffset as is, which leads to an empty file in zonefs_check_zone_condition()
209 zonefs_warn(sb, "Zone %llu: read-only zone\n", in zonefs_check_zone_condition()
221 return (zone->wp - zone->start) << SECTOR_SHIFT; in zonefs_check_zone_condition()
226 * Check a zone condition and adjust its inode access permissions for
250 static int zonefs_io_error_cb(struct blk_zone *zone, unsigned int idx, in zonefs_io_error_cb() argument
255 *z = *zone; in zonefs_io_error_cb()
259 static void zonefs_handle_io_error(struct inode *inode, struct blk_zone *zone, in zonefs_handle_io_error() argument
268 * Check the zone condition: if the zone is not "bad" (offline or in zonefs_handle_io_error()
271 * data writen in the zone (data_size). in zonefs_handle_io_error()
273 data_size = zonefs_check_zone_condition(sb, z, zone); in zonefs_handle_io_error()
280 * At this point, we detected either a bad zone or an inconsistency in zonefs_handle_io_error()
281 * between the inode size and the amount of data written in the zone. in zonefs_handle_io_error()
284 * 1) The inode size is lower than the amount of data in the zone: in zonefs_handle_io_error()
288 * 2) The inode size is larger than the amount of data in the zone: in zonefs_handle_io_error()
292 * e.g. an application reset the zone directly, or (b) the device in zonefs_handle_io_error()
296 * IO error according to the zone condition and to the mount options. in zonefs_handle_io_error()
305 * errors=zone-ro and errors=zone-offline result in changing the in zonefs_handle_io_error()
306 * zone condition to read-only and offline respectively, as if the in zonefs_handle_io_error()
333 * need to clear the ZONEFS_ZONE_OPEN flag if the zone transitioned to in zonefs_handle_io_error()
335 * close of the zone when the inode file is closed. in zonefs_handle_io_error()
361 * When an file IO error occurs, check the file zone to see if there is a change
362 * in the zone condition (e.g. offline or read-only). For a failed write to a
363 * sequential zone, the zone write pointer position must also be checked to
372 struct blk_zone zone; in __zonefs_io_error() local
376 * Conventional zone have no write pointer and cannot become read-only in __zonefs_io_error()
377 * or offline. So simply fake a report for a single or aggregated zone in __zonefs_io_error()
378 * and let zonefs_handle_io_error() correct the zone inode information in __zonefs_io_error()
382 zone.start = z->z_sector; in __zonefs_io_error()
383 zone.len = z->z_size >> SECTOR_SHIFT; in __zonefs_io_error()
384 zone.wp = zone.start + zone.len; in __zonefs_io_error()
385 zone.type = BLK_ZONE_TYPE_CONVENTIONAL; in __zonefs_io_error()
386 zone.cond = BLK_ZONE_COND_NOT_WP; in __zonefs_io_error()
387 zone.capacity = zone.len; in __zonefs_io_error()
401 zonefs_io_error_cb, &zone); in __zonefs_io_error()
405 zonefs_err(sb, "Get inode %lu zone information failed %d\n", in __zonefs_io_error()
413 zonefs_handle_io_error(inode, &zone, write); in __zonefs_io_error()
483 {"zone-ro", ZONEFS_MNTOPT_ERRORS_ZRO},
484 {"zone-offline", ZONEFS_MNTOPT_ERRORS_ZOL},
527 seq_puts(seq, ",errors=zone-ro"); in zonefs_show_options()
529 seq_puts(seq, ",errors=zone-offline"); in zonefs_show_options()
552 * files by zone type. in zonefs_inode_setattr()
667 /* Update the inode access rights depending on the zone condition */ in zonefs_get_file_inode()
797 * The size of zone group directories is equal to the number in zonefs_readdir_zgroup()
798 * of zone files in the group and does note include the "." and in zonefs_readdir_zgroup()
853 static int zonefs_get_zone_info_cb(struct blk_zone *zone, unsigned int idx, in zonefs_get_zone_info_cb() argument
861 * We do not care about the first zone: it contains the super block in zonefs_get_zone_info_cb()
873 switch (zone->type) { in zonefs_get_zone_info_cb()
878 zone->start != zd->cnv_zone_start) in zonefs_get_zone_info_cb()
880 zd->cnv_zone_start = zone->start + zone->len; in zonefs_get_zone_info_cb()
882 /* One file per zone */ in zonefs_get_zone_info_cb()
891 zonefs_err(zd->sb, "Unsupported zone type 0x%x\n", in zonefs_get_zone_info_cb()
892 zone->type); in zonefs_get_zone_info_cb()
896 memcpy(&zd->zones[idx], zone, sizeof(struct blk_zone)); in zonefs_get_zone_info_cb()
915 zonefs_err(zd->sb, "Zone report failed %d\n", ret); in zonefs_get_zone_info()
920 zonefs_err(zd->sb, "Invalid zone report (%d/%u zones)\n", in zonefs_get_zone_info()
934 * Create a zone group and populate it with zone files.
942 struct blk_zone *zone, *next, *end; in zonefs_init_zgroup() local
947 /* Allocate the zone group. If it is empty, we have nothing to do. */ in zonefs_init_zgroup()
957 * Initialize the zone groups using the device zone information. in zonefs_init_zgroup()
958 * We always skip the first zone as it contains the super block in zonefs_init_zgroup()
962 for (zone = &zd->zones[1]; zone < end; zone = next) { in zonefs_init_zgroup()
964 next = zone + 1; in zonefs_init_zgroup()
965 if (zonefs_zone_type(zone) != ztype) in zonefs_init_zgroup()
974 * length of the first zone of the set of contiguous zones in zonefs_init_zgroup()
975 * aggregated together. If one offline or read-only zone is in zonefs_init_zgroup()
984 zone->len += next->len; in zonefs_init_zgroup()
985 zone->capacity += next->capacity; in zonefs_init_zgroup()
987 zone->cond != BLK_ZONE_COND_OFFLINE) in zonefs_init_zgroup()
988 zone->cond = BLK_ZONE_COND_READONLY; in zonefs_init_zgroup()
990 zone->cond = BLK_ZONE_COND_OFFLINE; in zonefs_init_zgroup()
997 z->z_sector = zone->start; in zonefs_init_zgroup()
998 z->z_size = zone->len << SECTOR_SHIFT; in zonefs_init_zgroup()
1002 "Invalid zone size %llu (device zone sectors %llu)\n", in zonefs_init_zgroup()
1009 zone->capacity << SECTOR_SHIFT); in zonefs_init_zgroup()
1010 z->z_wpoffset = zonefs_check_zone_condition(sb, z, zone); in zonefs_init_zgroup()
1028 * For sequential zones, make sure that any open zone is closed in zonefs_init_zgroup()
1030 * in sync with the open zone accounting done when the mount in zonefs_init_zgroup()
1034 (zone->cond == BLK_ZONE_COND_IMP_OPEN || in zonefs_init_zgroup()
1035 zone->cond == BLK_ZONE_COND_EXP_OPEN)) { in zonefs_init_zgroup()
1049 zonefs_info(sb, "Zone group \"%s\" has %u file%s\n", in zonefs_init_zgroup()
1072 * Create a zone group and populate it with zone files.
1080 /* First get the device zone information */ in zonefs_init_zgroups()
1087 /* Allocate and initialize the zone groups */ in zonefs_init_zgroups()
1092 "Zone group \"%s\" initialization failed\n", in zonefs_init_zgroups()
1233 * sub-directories and files according to the device zone configuration and
1251 * when the zone files are created so that the format option in zonefs_fill_super()
1253 * beyond the zone size is taken into account. in zonefs_fill_super()
1267 * The block size is set to the device zone write granularity to ensure in zonefs_fill_super()
1293 "No open and active zone limits. Ignoring explicit_open mount option\n"); in zonefs_fill_super()
1297 /* Initialize the zone groups */ in zonefs_fill_super()
1327 * Take a reference on the zone groups directory inodes in zonefs_fill_super()
1351 /* Release the reference on the zone group directory inodes */ in zonefs_kill_super()
1479 MODULE_DESCRIPTION("Zone file system for zoned block devices");