Lines Matching full:zone
31 * Get the name of a zone group directory.
47 * Manage the active zone count.
65 * If the zone is active, that is, if it is explicitly open or in zonefs_account_active()
78 /* The zone is not active. If it was, update the active count */ in zonefs_account_active()
86 * Manage the active zone count. Called with zi->i_truncate_mutex held.
96 * Execute a zone management operation.
104 * With ZNS drives, closing an explicitly open zone that has not been in zonefs_zone_mgmt()
105 * written will change the zone state to "closed", that is, the zone in zonefs_zone_mgmt()
107 * open operation on other zones if the drive active zone resources in zonefs_zone_mgmt()
108 * are exceeded, make sure that the zone does not remain active by in zonefs_zone_mgmt()
119 "Zone management operation %s at %llu failed %d\n", in zonefs_zone_mgmt()
141 * A full zone is no longer open/active and does not need in zonefs_i_size_write()
186 * Check a zone condition. Return the amount of written (and still readable)
187 * data in the zone.
191 struct blk_zone *zone) in zonefs_check_zone_condition() argument
193 switch (zone->cond) { in zonefs_check_zone_condition()
195 zonefs_warn(sb, "Zone %llu: offline zone\n", in zonefs_check_zone_condition()
202 * determine the zone wpoffset (inode size). We thus keep the in zonefs_check_zone_condition()
203 * zone wpoffset as is, which leads to an empty file in zonefs_check_zone_condition()
208 zonefs_warn(sb, "Zone %llu: read-only zone\n", in zonefs_check_zone_condition()
220 return (zone->wp - zone->start) << SECTOR_SHIFT; in zonefs_check_zone_condition()
225 * Check a zone condition and adjust its inode access permissions for
249 static int zonefs_io_error_cb(struct blk_zone *zone, unsigned int idx, in zonefs_io_error_cb() argument
254 *z = *zone; in zonefs_io_error_cb()
258 static void zonefs_handle_io_error(struct inode *inode, struct blk_zone *zone, in zonefs_handle_io_error() argument
267 * Check the zone condition: if the zone is not "bad" (offline or in zonefs_handle_io_error()
270 * data writen in the zone (data_size). in zonefs_handle_io_error()
272 data_size = zonefs_check_zone_condition(sb, z, zone); in zonefs_handle_io_error()
279 * At this point, we detected either a bad zone or an inconsistency in zonefs_handle_io_error()
280 * between the inode size and the amount of data written in the zone. in zonefs_handle_io_error()
283 * 1) The inode size is lower than the amount of data in the zone: in zonefs_handle_io_error()
287 * 2) The inode size is larger than the amount of data in the zone: in zonefs_handle_io_error()
291 * e.g. an application reset the zone directly, or (b) the device in zonefs_handle_io_error()
295 * IO error according to the zone condition and to the mount options. in zonefs_handle_io_error()
304 * errors=zone-ro and errors=zone-offline result in changing the in zonefs_handle_io_error()
305 * zone condition to read-only and offline respectively, as if the in zonefs_handle_io_error()
332 * need to clear the ZONEFS_ZONE_OPEN flag if the zone transitioned to in zonefs_handle_io_error()
334 * close of the zone when the inode file is closed. in zonefs_handle_io_error()
360 * When an file IO error occurs, check the file zone to see if there is a change
361 * in the zone condition (e.g. offline or read-only). For a failed write to a
362 * sequential zone, the zone write pointer position must also be checked to
371 struct blk_zone zone; in __zonefs_io_error() local
375 * Conventional zone have no write pointer and cannot become read-only in __zonefs_io_error()
376 * or offline. So simply fake a report for a single or aggregated zone in __zonefs_io_error()
377 * and let zonefs_handle_io_error() correct the zone inode information in __zonefs_io_error()
381 zone.start = z->z_sector; in __zonefs_io_error()
382 zone.len = z->z_size >> SECTOR_SHIFT; in __zonefs_io_error()
383 zone.wp = zone.start + zone.len; in __zonefs_io_error()
384 zone.type = BLK_ZONE_TYPE_CONVENTIONAL; in __zonefs_io_error()
385 zone.cond = BLK_ZONE_COND_NOT_WP; in __zonefs_io_error()
386 zone.capacity = zone.len; in __zonefs_io_error()
400 zonefs_io_error_cb, &zone); in __zonefs_io_error()
404 zonefs_err(sb, "Get inode %lu zone information failed %d\n", in __zonefs_io_error()
412 zonefs_handle_io_error(inode, &zone, write); in __zonefs_io_error()
479 { Opt_errors_zro, "errors=zone-ro"},
480 { Opt_errors_zol, "errors=zone-offline"},
537 seq_puts(seq, ",errors=zone-ro"); in zonefs_show_options()
539 seq_puts(seq, ",errors=zone-offline"); in zonefs_show_options()
569 * files by zone type. in zonefs_inode_setattr()
683 /* Update the inode access rights depending on the zone condition */ in zonefs_get_file_inode()
813 * The size of zone group directories is equal to the number in zonefs_readdir_zgroup()
814 * of zone files in the group and does note include the "." and in zonefs_readdir_zgroup()
869 static int zonefs_get_zone_info_cb(struct blk_zone *zone, unsigned int idx, in zonefs_get_zone_info_cb() argument
877 * We do not care about the first zone: it contains the super block in zonefs_get_zone_info_cb()
889 switch (zone->type) { in zonefs_get_zone_info_cb()
894 zone->start != zd->cnv_zone_start) in zonefs_get_zone_info_cb()
896 zd->cnv_zone_start = zone->start + zone->len; in zonefs_get_zone_info_cb()
898 /* One file per zone */ in zonefs_get_zone_info_cb()
907 zonefs_err(zd->sb, "Unsupported zone type 0x%x\n", in zonefs_get_zone_info_cb()
908 zone->type); in zonefs_get_zone_info_cb()
912 memcpy(&zd->zones[idx], zone, sizeof(struct blk_zone)); in zonefs_get_zone_info_cb()
931 zonefs_err(zd->sb, "Zone report failed %d\n", ret); in zonefs_get_zone_info()
936 zonefs_err(zd->sb, "Invalid zone report (%d/%u zones)\n", in zonefs_get_zone_info()
950 * Create a zone group and populate it with zone files.
958 struct blk_zone *zone, *next, *end; in zonefs_init_zgroup() local
963 /* Allocate the zone group. If it is empty, we have nothing to do. */ in zonefs_init_zgroup()
973 * Initialize the zone groups using the device zone information. in zonefs_init_zgroup()
974 * We always skip the first zone as it contains the super block in zonefs_init_zgroup()
978 for (zone = &zd->zones[1]; zone < end; zone = next) { in zonefs_init_zgroup()
980 next = zone + 1; in zonefs_init_zgroup()
981 if (zonefs_zone_type(zone) != ztype) in zonefs_init_zgroup()
990 * length of the first zone of the set of contiguous zones in zonefs_init_zgroup()
991 * aggregated together. If one offline or read-only zone is in zonefs_init_zgroup()
1000 zone->len += next->len; in zonefs_init_zgroup()
1001 zone->capacity += next->capacity; in zonefs_init_zgroup()
1003 zone->cond != BLK_ZONE_COND_OFFLINE) in zonefs_init_zgroup()
1004 zone->cond = BLK_ZONE_COND_READONLY; in zonefs_init_zgroup()
1006 zone->cond = BLK_ZONE_COND_OFFLINE; in zonefs_init_zgroup()
1013 z->z_sector = zone->start; in zonefs_init_zgroup()
1014 z->z_size = zone->len << SECTOR_SHIFT; in zonefs_init_zgroup()
1018 "Invalid zone size %llu (device zone sectors %llu)\n", in zonefs_init_zgroup()
1025 zone->capacity << SECTOR_SHIFT); in zonefs_init_zgroup()
1026 z->z_wpoffset = zonefs_check_zone_condition(sb, z, zone); in zonefs_init_zgroup()
1044 * For sequential zones, make sure that any open zone is closed in zonefs_init_zgroup()
1046 * in sync with the open zone accounting done when the mount in zonefs_init_zgroup()
1050 (zone->cond == BLK_ZONE_COND_IMP_OPEN || in zonefs_init_zgroup()
1051 zone->cond == BLK_ZONE_COND_EXP_OPEN)) { in zonefs_init_zgroup()
1065 zonefs_info(sb, "Zone group \"%s\" has %u file%s\n", in zonefs_init_zgroup()
1088 * Create a zone group and populate it with zone files.
1096 /* First get the device zone information */ in zonefs_init_zgroups()
1103 /* Allocate and initialize the zone groups */ in zonefs_init_zgroups()
1108 "Zone group \"%s\" initialization failed\n", in zonefs_init_zgroups()
1250 * sub-directories and files according to the device zone configuration and
1267 * when the zone files are created so that the format option in zonefs_fill_super()
1269 * beyond the zone size is taken into account. in zonefs_fill_super()
1283 * The block size is set to the device zone write granularity to ensure in zonefs_fill_super()
1313 "No open and active zone limits. Ignoring explicit_open mount option\n"); in zonefs_fill_super()
1317 /* Initialize the zone groups */ in zonefs_fill_super()
1347 * Take a reference on the zone groups directory inodes in zonefs_fill_super()
1377 /* Release the reference on the zone group directory inodes */ in zonefs_kill_super()
1455 MODULE_DESCRIPTION("Zone file system for zoned block devices");