• Home
  • Raw
  • Download

Lines Matching refs:zi

33 	struct zonefs_inode_info *zi = ZONEFS_I(inode);  in zonefs_zone_mgmt()  local
36 lockdep_assert_held(&zi->i_truncate_mutex); in zonefs_zone_mgmt()
46 if (op == REQ_OP_ZONE_CLOSE && !zi->i_wpoffset) in zonefs_zone_mgmt()
50 ret = blkdev_zone_mgmt(inode->i_sb->s_bdev, op, zi->i_zsector, in zonefs_zone_mgmt()
51 zi->i_zone_size >> SECTOR_SHIFT, GFP_NOFS); in zonefs_zone_mgmt()
55 blk_op_str(op), zi->i_zsector, ret); in zonefs_zone_mgmt()
64 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_i_size_write() local
71 if (isize >= zi->i_max_size) in zonefs_i_size_write()
72 zi->i_flags &= ~ZONEFS_ZONE_OPEN; in zonefs_i_size_write()
79 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_read_iomap_begin() local
87 mutex_lock(&zi->i_truncate_mutex); in zonefs_read_iomap_begin()
97 iomap->addr = (zi->i_zsector << SECTOR_SHIFT) + iomap->offset; in zonefs_read_iomap_begin()
100 mutex_unlock(&zi->i_truncate_mutex); in zonefs_read_iomap_begin()
115 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_write_iomap_begin() local
120 if (WARN_ON_ONCE(offset + length > zi->i_max_size)) in zonefs_write_iomap_begin()
128 if (WARN_ON_ONCE(zi->i_ztype == ZONEFS_ZTYPE_SEQ && in zonefs_write_iomap_begin()
137 mutex_lock(&zi->i_truncate_mutex); in zonefs_write_iomap_begin()
140 iomap->addr = (zi->i_zsector << SECTOR_SHIFT) + iomap->offset; in zonefs_write_iomap_begin()
144 iomap->length = zi->i_max_size - iomap->offset; in zonefs_write_iomap_begin()
149 mutex_unlock(&zi->i_truncate_mutex); in zonefs_write_iomap_begin()
177 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_write_map_blocks() local
179 if (WARN_ON_ONCE(zi->i_ztype != ZONEFS_ZTYPE_CNV)) in zonefs_write_map_blocks()
189 return zonefs_write_iomap_begin(inode, offset, zi->i_max_size - offset, in zonefs_write_map_blocks()
216 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_swap_activate() local
218 if (zi->i_ztype != ZONEFS_ZTYPE_CNV) { in zonefs_swap_activate()
284 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_check_zone_condition() local
322 return zi->i_max_size; in zonefs_check_zone_condition()
324 if (zi->i_ztype == ZONEFS_ZTYPE_CNV) in zonefs_check_zone_condition()
325 return zi->i_max_size; in zonefs_check_zone_condition()
340 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_io_error_cb() local
377 if (zi->i_ztype == ZONEFS_ZTYPE_SEQ && isize != data_size) in zonefs_io_error_cb()
420 zi->i_flags &= ~ZONEFS_ZONE_OPEN; in zonefs_io_error_cb()
437 zi->i_wpoffset = data_size; in zonefs_io_error_cb()
451 struct zonefs_inode_info *zi = ZONEFS_I(inode); in __zonefs_io_error() local
467 if (zi->i_zone_size > bdev_zone_sectors(sb->s_bdev)) in __zonefs_io_error()
468 nr_zones = zi->i_zone_size >> in __zonefs_io_error()
480 ret = blkdev_report_zones(sb->s_bdev, zi->i_zsector, nr_zones, in __zonefs_io_error()
490 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_io_error() local
492 mutex_lock(&zi->i_truncate_mutex); in zonefs_io_error()
494 mutex_unlock(&zi->i_truncate_mutex); in zonefs_io_error()
499 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_file_truncate() local
509 if (zi->i_ztype != ZONEFS_ZTYPE_SEQ) in zonefs_file_truncate()
514 else if (isize == zi->i_max_size) in zonefs_file_truncate()
525 mutex_lock(&zi->i_truncate_mutex); in zonefs_file_truncate()
539 if (zi->i_flags & ZONEFS_ZONE_OPEN) { in zonefs_file_truncate()
551 zi->i_flags &= ~ZONEFS_ZONE_OPEN; in zonefs_file_truncate()
556 zi->i_wpoffset = isize; in zonefs_file_truncate()
559 mutex_unlock(&zi->i_truncate_mutex); in zonefs_file_truncate()
638 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_filemap_page_mkwrite() local
648 if (WARN_ON_ONCE(zi->i_ztype != ZONEFS_ZTYPE_CNV)) in zonefs_filemap_page_mkwrite()
703 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_file_write_dio_end_io() local
710 if (size && zi->i_ztype != ZONEFS_ZTYPE_CNV) { in zonefs_file_write_dio_end_io()
718 mutex_lock(&zi->i_truncate_mutex); in zonefs_file_write_dio_end_io()
723 mutex_unlock(&zi->i_truncate_mutex); in zonefs_file_write_dio_end_io()
736 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_file_dio_append() local
767 bio->bi_iter.bi_sector = zi->i_zsector; in zonefs_file_dio_append()
794 zi->i_zsector + (zi->i_wpoffset >> SECTOR_SHIFT); in zonefs_file_dio_append()
799 bio->bi_iter.bi_sector, zi->i_zsector); in zonefs_file_dio_append()
827 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_write_check_limits() local
829 loff_t max_size = zi->i_max_size; in zonefs_write_check_limits()
852 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_write_checks() local
865 if (zi->i_ztype != ZONEFS_ZTYPE_SEQ) in zonefs_write_checks()
867 mutex_lock(&zi->i_truncate_mutex); in zonefs_write_checks()
868 iocb->ki_pos = zi->i_wpoffset; in zonefs_write_checks()
869 mutex_unlock(&zi->i_truncate_mutex); in zonefs_write_checks()
894 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_file_dio_write() local
905 if (zi->i_ztype == ZONEFS_ZTYPE_SEQ && !sync && in zonefs_file_dio_write()
928 if (zi->i_ztype == ZONEFS_ZTYPE_SEQ) { in zonefs_file_dio_write()
929 mutex_lock(&zi->i_truncate_mutex); in zonefs_file_dio_write()
930 if (iocb->ki_pos != zi->i_wpoffset) { in zonefs_file_dio_write()
931 mutex_unlock(&zi->i_truncate_mutex); in zonefs_file_dio_write()
935 mutex_unlock(&zi->i_truncate_mutex); in zonefs_file_dio_write()
944 if (zi->i_ztype == ZONEFS_ZTYPE_SEQ && in zonefs_file_dio_write()
948 mutex_lock(&zi->i_truncate_mutex); in zonefs_file_dio_write()
949 zi->i_wpoffset += count; in zonefs_file_dio_write()
950 mutex_unlock(&zi->i_truncate_mutex); in zonefs_file_dio_write()
963 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_file_buffered_write() local
970 if (zi->i_ztype != ZONEFS_ZTYPE_CNV) in zonefs_file_buffered_write()
1039 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_file_read_iter() local
1048 if (iocb->ki_pos >= zi->i_max_size) in zonefs_file_read_iter()
1059 mutex_lock(&zi->i_truncate_mutex); in zonefs_file_read_iter()
1062 mutex_unlock(&zi->i_truncate_mutex); in zonefs_file_read_iter()
1067 mutex_unlock(&zi->i_truncate_mutex); in zonefs_file_read_iter()
1093 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_file_use_exp_open() local
1099 if (zi->i_ztype != ZONEFS_ZTYPE_SEQ) in zonefs_file_use_exp_open()
1110 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_open_zone() local
1114 mutex_lock(&zi->i_truncate_mutex); in zonefs_open_zone()
1116 if (!zi->i_wr_refcnt) { in zonefs_open_zone()
1123 if (i_size_read(inode) < zi->i_max_size) { in zonefs_open_zone()
1129 zi->i_flags |= ZONEFS_ZONE_OPEN; in zonefs_open_zone()
1133 zi->i_wr_refcnt++; in zonefs_open_zone()
1136 mutex_unlock(&zi->i_truncate_mutex); in zonefs_open_zone()
1157 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_close_zone() local
1160 mutex_lock(&zi->i_truncate_mutex); in zonefs_close_zone()
1161 zi->i_wr_refcnt--; in zonefs_close_zone()
1162 if (!zi->i_wr_refcnt) { in zonefs_close_zone()
1170 if (!(zi->i_flags & ZONEFS_ZONE_OPEN)) in zonefs_close_zone()
1182 if (zi->i_flags & ZONEFS_ZONE_OPEN && in zonefs_close_zone()
1188 zi->i_flags &= ~ZONEFS_ZONE_OPEN; in zonefs_close_zone()
1192 mutex_unlock(&zi->i_truncate_mutex); in zonefs_close_zone()
1226 struct zonefs_inode_info *zi; in zonefs_alloc_inode() local
1228 zi = kmem_cache_alloc(zonefs_inode_cachep, GFP_KERNEL); in zonefs_alloc_inode()
1229 if (!zi) in zonefs_alloc_inode()
1232 inode_init_once(&zi->i_vnode); in zonefs_alloc_inode()
1233 mutex_init(&zi->i_truncate_mutex); in zonefs_alloc_inode()
1234 zi->i_wr_refcnt = 0; in zonefs_alloc_inode()
1235 zi->i_flags = 0; in zonefs_alloc_inode()
1237 return &zi->i_vnode; in zonefs_alloc_inode()
1392 struct zonefs_inode_info *zi = ZONEFS_I(inode); in zonefs_init_file_inode() local
1398 zi->i_ztype = type; in zonefs_init_file_inode()
1399 zi->i_zsector = zone->start; in zonefs_init_file_inode()
1400 zi->i_zone_size = zone->len << SECTOR_SHIFT; in zonefs_init_file_inode()
1401 if (zi->i_zone_size > bdev_zone_sectors(sb->s_bdev) << SECTOR_SHIFT && in zonefs_init_file_inode()
1405 zi->i_zone_size, in zonefs_init_file_inode()
1410 zi->i_max_size = min_t(loff_t, MAX_LFS_FILESIZE, in zonefs_init_file_inode()
1412 zi->i_wpoffset = zonefs_check_zone_condition(inode, zone, true, true); in zonefs_init_file_inode()
1416 inode->i_size = zi->i_wpoffset; in zonefs_init_file_inode()
1417 inode->i_blocks = zi->i_max_size >> SECTOR_SHIFT; in zonefs_init_file_inode()
1423 sb->s_maxbytes = max(zi->i_max_size, sb->s_maxbytes); in zonefs_init_file_inode()
1424 sbi->s_blocks += zi->i_max_size >> sb->s_blocksize_bits; in zonefs_init_file_inode()
1425 sbi->s_used_blocks += zi->i_wpoffset >> sb->s_blocksize_bits; in zonefs_init_file_inode()
1436 mutex_lock(&zi->i_truncate_mutex); in zonefs_init_file_inode()
1438 mutex_unlock(&zi->i_truncate_mutex); in zonefs_init_file_inode()