Lines Matching full:zone

43 			   "Zone management operation %s at %llu failed %d\n",  in zonefs_zone_mgmt()
57 * A full zone is no longer open/active and does not need in zonefs_i_size_write()
87 * zones, all blocks after always mapped below the inode size (zone in zonefs_iomap_begin()
127 * Map blocks for page writeback. This is used only on conventional zone files,
176 "swap file: not a conventional zone file\n"); in zonefs_swap_activate()
231 * Check a zone condition and adjust its file inode access permissions for
233 * amount of readable data in the zone.
236 struct blk_zone *zone, bool warn, in zonefs_check_zone_condition() argument
241 switch (zone->cond) { in zonefs_check_zone_condition()
244 * Dead zone: make the inode immutable, disable all accesses in zonefs_check_zone_condition()
245 * and set the file size to 0 (zone wp set to zone start). in zonefs_check_zone_condition()
248 zonefs_warn(inode->i_sb, "inode %lu: offline zone\n", in zonefs_check_zone_condition()
252 zone->wp = zone->start; in zonefs_check_zone_condition()
257 * zone is found during mount, the file size cannot be retrieved in zonefs_check_zone_condition()
258 * so we treat the zone as offline (mount == true case). in zonefs_check_zone_condition()
261 * always disabled for the zone. in zonefs_check_zone_condition()
264 zonefs_warn(inode->i_sb, "inode %lu: read-only zone\n", in zonefs_check_zone_condition()
268 zone->cond = BLK_ZONE_COND_OFFLINE; in zonefs_check_zone_condition()
270 zone->wp = zone->start; in zonefs_check_zone_condition()
281 return (zone->wp - zone->start) << SECTOR_SHIFT; in zonefs_check_zone_condition()
290 static int zonefs_io_error_cb(struct blk_zone *zone, unsigned int idx, in zonefs_io_error_cb() argument
301 * Check the zone condition: if the zone is not "bad" (offline or in zonefs_io_error_cb()
304 * data writen in the zone (data_size). in zonefs_io_error_cb()
306 data_size = zonefs_check_zone_condition(inode, zone, true, false); in zonefs_io_error_cb()
308 if (zone->cond != BLK_ZONE_COND_OFFLINE && in zonefs_io_error_cb()
309 zone->cond != BLK_ZONE_COND_READONLY && in zonefs_io_error_cb()
314 * At this point, we detected either a bad zone or an inconsistency in zonefs_io_error_cb()
315 * between the inode size and the amount of data written in the zone. in zonefs_io_error_cb()
318 * 1) The inode size is lower than the amount of data in the zone: in zonefs_io_error_cb()
322 * 2) The inode size is larger than the amount of data in the zone: in zonefs_io_error_cb()
326 * e.g. an application reset the zone directly, or (b) the device in zonefs_io_error_cb()
330 * IO error according to the zone condition and to the mount options. in zonefs_io_error_cb()
338 * errors=zone-ro and errors=zone-offline result in changing the in zonefs_io_error_cb()
339 * zone condition to read-only and offline respectively, as if the in zonefs_io_error_cb()
342 if (zone->cond == BLK_ZONE_COND_OFFLINE || in zonefs_io_error_cb()
346 if (zone->cond != BLK_ZONE_COND_OFFLINE) { in zonefs_io_error_cb()
347 zone->cond = BLK_ZONE_COND_OFFLINE; in zonefs_io_error_cb()
348 data_size = zonefs_check_zone_condition(inode, zone, in zonefs_io_error_cb()
351 } else if (zone->cond == BLK_ZONE_COND_READONLY || in zonefs_io_error_cb()
355 if (zone->cond != BLK_ZONE_COND_READONLY) { in zonefs_io_error_cb()
356 zone->cond = BLK_ZONE_COND_READONLY; in zonefs_io_error_cb()
357 data_size = zonefs_check_zone_condition(inode, zone, in zonefs_io_error_cb()
364 * need to clear the ZONEFS_ZONE_OPEN flag if the zone transitioned to in zonefs_io_error_cb()
366 * close of the zone when the inode file is closed. in zonefs_io_error_cb()
369 (zone->cond == BLK_ZONE_COND_OFFLINE || in zonefs_io_error_cb()
370 zone->cond == BLK_ZONE_COND_READONLY)) in zonefs_io_error_cb()
394 * When an file IO error occurs, check the file zone to see if there is a change
395 * in the zone condition (e.g. offline or read-only). For a failed write to a
396 * sequential zone, the zone write pointer position must also be checked to
426 zonefs_err(sb, "Get inode %lu zone information failed %d\n", in __zonefs_io_error()
448 * Only sequential zone files can be truncated and truncation is allowed in zonefs_file_truncate()
449 * only down to a 0 size, which is equivalent to a zone reset, and to in zonefs_file_truncate()
450 * the maximum file size, which is equivalent to a zone finish. in zonefs_file_truncate()
484 * Truncating a zone to EMPTY or FULL is the equivalent of in zonefs_file_truncate()
485 * closing the zone. For a truncation to 0, we need to in zonefs_file_truncate()
486 * re-open the zone to ensure new writes can be processed. in zonefs_file_truncate()
487 * For a truncation to the maximum file size, the zone is in zonefs_file_truncate()
524 * files by zone type. in zonefs_inode_setattr()
565 * flush is needed only for conventional zone files. in zonefs_file_fsync()
588 * Sanity check: only conventional zone files can have shared in zonefs_filemap_page_mkwrite()
616 * shared writable mappings. For sequential zone files, only read in zonefs_file_mmap()
635 * Seeks are limited to below the zone size for conventional zones in zonefs_file_llseek()
636 * and below the zone write pointer for sequential zones. In both in zonefs_file_llseek()
732 * Do not exceed the LFS limits nor the file zone size. If pos is under the
794 * Handle direct writes. For sequential zone files, this is the only possible
813 * For async direct IOs to sequential zone files, refuse IOCB_NOWAIT in zonefs_file_dio_write()
879 * Direct IO writes are mandatory for sequential zone files so that the in zonefs_file_buffered_write()
920 /* Write operations beyond the zone size are not allowed */ in zonefs_file_write_iter()
1079 * If the file zone is full, it is not open anymore and we only in zonefs_close_zone()
1090 * where most zones cannot be written (zone resources in zonefs_close_zone()
1096 zonefs_warn(sb, "closing zone failed, remounting filesystem read-only\n"); in zonefs_close_zone()
1110 * If we explicitly open a zone we must close it again as well, but the in zonefs_file_release()
1111 * zone management operation can fail (either due to an IO error or as in zonefs_file_release()
1112 * the zone has gone offline or read-only). Make sure we don't fail the in zonefs_file_release()
1198 { Opt_errors_zro, "errors=zone-ro"},
1199 { Opt_errors_zol, "errors=zone-offline"},
1256 seq_puts(seq, ",errors=zone-ro"); in zonefs_show_options()
1258 seq_puts(seq, ",errors=zone-offline"); in zonefs_show_options()
1298 static void zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone, in zonefs_init_file_inode() argument
1305 inode->i_ino = zone->start >> sbi->s_zone_sectors_shift; in zonefs_init_file_inode()
1309 zi->i_zsector = zone->start; in zonefs_init_file_inode()
1310 zi->i_zone_size = zone->len << SECTOR_SHIFT; in zonefs_init_file_inode()
1313 zone->capacity << SECTOR_SHIFT); in zonefs_init_file_inode()
1314 zi->i_wpoffset = zonefs_check_zone_condition(inode, zone, true, true); in zonefs_init_file_inode()
1331 const char *name, struct blk_zone *zone, in zonefs_create_inode() argument
1347 if (zone) in zonefs_create_inode()
1348 zonefs_init_file_inode(inode, zone, type); in zonefs_create_inode()
1369 * Create a zone group and populate it with zone files.
1376 struct blk_zone *zone, *next, *end; in zonefs_create_zgroup() local
1403 * The first zone contains the super block: skip it. in zonefs_create_zgroup()
1406 for (zone = &zd->zones[1]; zone < end; zone = next) { in zonefs_create_zgroup()
1408 next = zone + 1; in zonefs_create_zgroup()
1409 if (zonefs_zone_type(zone) != type) in zonefs_create_zgroup()
1415 * length of the first zone of the set of contiguous zones in zonefs_create_zgroup()
1416 * aggregated together. If one offline or read-only zone is in zonefs_create_zgroup()
1425 zone->len += next->len; in zonefs_create_zgroup()
1426 zone->capacity += next->capacity; in zonefs_create_zgroup()
1428 zone->cond != BLK_ZONE_COND_OFFLINE) in zonefs_create_zgroup()
1429 zone->cond = BLK_ZONE_COND_READONLY; in zonefs_create_zgroup()
1431 zone->cond = BLK_ZONE_COND_OFFLINE; in zonefs_create_zgroup()
1433 if (zone->capacity != zone->len) { in zonefs_create_zgroup()
1434 zonefs_err(sb, "Invalid conventional zone capacity\n"); in zonefs_create_zgroup()
1444 if (!zonefs_create_inode(dir, file_name, zone, type)) { in zonefs_create_zgroup()
1452 zonefs_info(sb, "Zone group \"%s\" has %u file%s\n", in zonefs_create_zgroup()
1464 static int zonefs_get_zone_info_cb(struct blk_zone *zone, unsigned int idx, in zonefs_get_zone_info_cb() argument
1470 * Count the number of usable zones: the first zone at index 0 contains in zonefs_get_zone_info_cb()
1473 switch (zone->type) { in zonefs_get_zone_info_cb()
1475 zone->wp = zone->start + zone->len; in zonefs_get_zone_info_cb()
1485 zonefs_err(zd->sb, "Unsupported zone type 0x%x\n", in zonefs_get_zone_info_cb()
1486 zone->type); in zonefs_get_zone_info_cb()
1490 memcpy(&zd->zones[idx], zone, sizeof(struct blk_zone)); in zonefs_get_zone_info_cb()
1509 zonefs_err(zd->sb, "Zone report failed %d\n", ret); in zonefs_get_zone_info()
1514 zonefs_err(zd->sb, "Invalid zone report (%d/%u zones)\n", in zonefs_get_zone_info()
1615 * sub-directories and files according to the device zone configuration and
1633 * when the zone files are created so that the format option in zonefs_fill_super()
1635 * beyond the zone size is taken into account. in zonefs_fill_super()
1649 * The block size is set to the device zone write granularity to ensure in zonefs_fill_super()
1701 /* Create and populate files in zone groups directories */ in zonefs_fill_super()
1788 MODULE_DESCRIPTION("Zone file system for zoned block devices");