Lines Matching refs:z

50 				  struct zonefs_zone *z)  in zonefs_account_active()  argument
54 if (zonefs_zone_is_cnv(z)) in zonefs_account_active()
61 if (z->z_flags & (ZONEFS_ZONE_OFFLINE | ZONEFS_ZONE_READONLY)) in zonefs_account_active()
68 if ((z->z_flags & ZONEFS_ZONE_OPEN) || in zonefs_account_active()
69 (z->z_wpoffset > 0 && z->z_wpoffset < z->z_capacity)) { in zonefs_account_active()
70 if (!(z->z_flags & ZONEFS_ZONE_ACTIVE)) { in zonefs_account_active()
71 z->z_flags |= ZONEFS_ZONE_ACTIVE; in zonefs_account_active()
79 if (z->z_flags & ZONEFS_ZONE_ACTIVE) { in zonefs_account_active()
80 z->z_flags &= ~ZONEFS_ZONE_ACTIVE; in zonefs_account_active()
99 struct zonefs_zone *z, enum req_op op) in zonefs_zone_mgmt() argument
111 if (op == REQ_OP_ZONE_CLOSE && !z->z_wpoffset) in zonefs_zone_mgmt()
114 trace_zonefs_zone_mgmt(sb, z, op); in zonefs_zone_mgmt()
115 ret = blkdev_zone_mgmt(sb->s_bdev, op, z->z_sector, in zonefs_zone_mgmt()
116 z->z_size >> SECTOR_SHIFT, GFP_NOFS); in zonefs_zone_mgmt()
120 blk_op_str(op), z->z_sector, ret); in zonefs_zone_mgmt()
136 struct zonefs_zone *z = zonefs_inode_zone(inode); in zonefs_i_size_write() local
144 if (isize >= z->z_capacity) { in zonefs_i_size_write()
147 if (z->z_flags & ZONEFS_ZONE_ACTIVE) in zonefs_i_size_write()
149 z->z_flags &= ~(ZONEFS_ZONE_OPEN | ZONEFS_ZONE_ACTIVE); in zonefs_i_size_write()
190 struct zonefs_zone *z, in zonefs_check_zone_condition() argument
196 z->z_sector); in zonefs_check_zone_condition()
197 z->z_flags |= ZONEFS_ZONE_OFFLINE; in zonefs_check_zone_condition()
209 z->z_sector); in zonefs_check_zone_condition()
210 z->z_flags |= ZONEFS_ZONE_READONLY; in zonefs_check_zone_condition()
211 if (zonefs_zone_is_cnv(z)) in zonefs_check_zone_condition()
212 return z->z_capacity; in zonefs_check_zone_condition()
213 return z->z_wpoffset; in zonefs_check_zone_condition()
216 return z->z_capacity; in zonefs_check_zone_condition()
218 if (zonefs_zone_is_cnv(z)) in zonefs_check_zone_condition()
219 return z->z_capacity; in zonefs_check_zone_condition()
230 struct zonefs_zone *z = zonefs_inode_zone(inode); in zonefs_inode_update_mode() local
232 if (z->z_flags & ZONEFS_ZONE_OFFLINE) { in zonefs_inode_update_mode()
236 } else if (z->z_flags & ZONEFS_ZONE_READONLY) { in zonefs_inode_update_mode()
239 if (z->z_flags & ZONEFS_ZONE_INIT_MODE) in zonefs_inode_update_mode()
245 z->z_flags &= ~ZONEFS_ZONE_INIT_MODE; in zonefs_inode_update_mode()
246 z->z_mode = inode->i_mode; in zonefs_inode_update_mode()
252 struct blk_zone *z = data; in zonefs_io_error_cb() local
254 *z = *zone; in zonefs_io_error_cb()
261 struct zonefs_zone *z = zonefs_inode_zone(inode); in zonefs_handle_io_error() local
272 data_size = zonefs_check_zone_condition(sb, z, zone); in zonefs_handle_io_error()
274 if (!(z->z_flags & (ZONEFS_ZONE_READONLY | ZONEFS_ZONE_OFFLINE)) && in zonefs_handle_io_error()
308 if ((z->z_flags & ZONEFS_ZONE_OFFLINE) || in zonefs_handle_io_error()
312 if (!(z->z_flags & ZONEFS_ZONE_OFFLINE)) in zonefs_handle_io_error()
313 z->z_flags |= ZONEFS_ZONE_OFFLINE; in zonefs_handle_io_error()
316 } else if ((z->z_flags & ZONEFS_ZONE_READONLY) || in zonefs_handle_io_error()
320 if (!(z->z_flags & ZONEFS_ZONE_READONLY)) in zonefs_handle_io_error()
321 z->z_flags |= ZONEFS_ZONE_READONLY; in zonefs_handle_io_error()
337 (z->z_flags & (ZONEFS_ZONE_READONLY | ZONEFS_ZONE_OFFLINE))) in zonefs_handle_io_error()
338 z->z_flags &= ~ZONEFS_ZONE_OPEN; in zonefs_handle_io_error()
355 z->z_wpoffset = data_size; in zonefs_handle_io_error()
368 struct zonefs_zone *z = zonefs_inode_zone(inode); in __zonefs_io_error() local
380 if (!zonefs_zone_is_seq(z)) { 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()
399 ret = blkdev_report_zones(sb->s_bdev, z->z_sector, 1, in __zonefs_io_error()
593 struct zonefs_zone *z = zonefs_inode_zone(inode); in zonefs_inode_setattr() local
595 z->z_mode = inode->i_mode; in zonefs_inode_setattr()
596 z->z_uid = inode->i_uid; in zonefs_inode_setattr()
597 z->z_gid = inode->i_gid; in zonefs_inode_setattr()
646 struct zonefs_zone *z; in zonefs_get_file_inode() local
659 z = &zgroup->g_zones[fno]; in zonefs_get_file_inode()
660 ino = z->z_sector >> sbi->s_zone_sectors_shift; in zonefs_get_file_inode()
665 WARN_ON_ONCE(inode->i_private != z); in zonefs_get_file_inode()
670 inode->i_mode = z->z_mode; in zonefs_get_file_inode()
673 inode->i_uid = z->z_uid; in zonefs_get_file_inode()
674 inode->i_gid = z->z_gid; in zonefs_get_file_inode()
675 inode->i_size = z->z_wpoffset; in zonefs_get_file_inode()
676 inode->i_blocks = z->z_capacity >> SECTOR_SHIFT; in zonefs_get_file_inode()
677 inode->i_private = z; in zonefs_get_file_inode()
808 struct zonefs_zone *z; in zonefs_readdir_zgroup() local
830 z = &zgroup->g_zones[f]; in zonefs_readdir_zgroup()
831 ino = z->z_sector >> sbi->s_zone_sectors_shift; in zonefs_readdir_zgroup()
961 struct zonefs_zone *z; in zonefs_init_zgroup() local
1012 z = &zgroup->g_zones[n]; in zonefs_init_zgroup()
1014 z->z_flags |= ZONEFS_ZONE_CNV; in zonefs_init_zgroup()
1015 z->z_sector = zone->start; in zonefs_init_zgroup()
1016 z->z_size = zone->len << SECTOR_SHIFT; in zonefs_init_zgroup()
1017 if (z->z_size > bdev_zone_sectors(sb->s_bdev) << SECTOR_SHIFT && in zonefs_init_zgroup()
1021 z->z_size, in zonefs_init_zgroup()
1026 z->z_capacity = min_t(loff_t, MAX_LFS_FILESIZE, in zonefs_init_zgroup()
1028 z->z_wpoffset = zonefs_check_zone_condition(sb, z, zone); in zonefs_init_zgroup()
1030 z->z_mode = S_IFREG | sbi->s_perm; in zonefs_init_zgroup()
1031 z->z_uid = sbi->s_uid; in zonefs_init_zgroup()
1032 z->z_gid = sbi->s_gid; in zonefs_init_zgroup()
1039 z->z_flags |= ZONEFS_ZONE_INIT_MODE; in zonefs_init_zgroup()
1041 sb->s_maxbytes = max(z->z_capacity, sb->s_maxbytes); in zonefs_init_zgroup()
1042 sbi->s_blocks += z->z_capacity >> sb->s_blocksize_bits; in zonefs_init_zgroup()
1043 sbi->s_used_blocks += z->z_wpoffset >> sb->s_blocksize_bits; in zonefs_init_zgroup()
1054 ret = zonefs_zone_mgmt(sb, z, REQ_OP_ZONE_CLOSE); in zonefs_init_zgroup()
1059 zonefs_account_active(sb, z); in zonefs_init_zgroup()