Lines Matching refs:map
89 struct ext4_map_blocks *map,
3491 struct ext4_map_blocks *map, in ext4_split_extent() argument
3502 int allocated = map->m_len; in ext4_split_extent()
3510 if (map->m_lblk + map->m_len < ee_block + ee_len) { in ext4_split_extent()
3519 map->m_lblk + map->m_len, split_flag1, flags1); in ext4_split_extent()
3523 allocated = ee_len - (map->m_lblk - ee_block); in ext4_split_extent()
3529 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in ext4_split_extent()
3536 (unsigned long) map->m_lblk); in ext4_split_extent()
3542 if (map->m_lblk >= ee_block) { in ext4_split_extent()
3550 map->m_lblk, split_flag1, flags); in ext4_split_extent()
3582 struct ext4_map_blocks *map, in ext4_ext_convert_to_initialized() argument
3593 unsigned int ee_len, depth, map_len = map->m_len; in ext4_ext_convert_to_initialized()
3600 (unsigned long long)map->m_lblk, map_len); in ext4_ext_convert_to_initialized()
3605 if (eof_block < map->m_lblk + map_len) in ext4_ext_convert_to_initialized()
3606 eof_block = map->m_lblk + map_len; in ext4_ext_convert_to_initialized()
3616 trace_ext4_ext_convert_to_initialized_enter(inode, map, ex); in ext4_ext_convert_to_initialized()
3620 BUG_ON(!in_range(map->m_lblk, ee_block, ee_len)); in ext4_ext_convert_to_initialized()
3637 if ((map->m_lblk == ee_block) && in ext4_ext_convert_to_initialized()
3669 map, ex, abut_ex); in ext4_ext_convert_to_initialized()
3683 } else if (((map->m_lblk + map_len) == (ee_block + ee_len)) && in ext4_ext_convert_to_initialized()
3707 ((map->m_lblk + map_len) == next_lblk) && /*C2*/ in ext4_ext_convert_to_initialized()
3715 map, ex, abut_ex); in ext4_ext_convert_to_initialized()
3738 allocated = ee_len - (map->m_lblk - ee_block); in ext4_ext_convert_to_initialized()
3740 WARN_ON(map->m_lblk < ee_block); in ext4_ext_convert_to_initialized()
3765 split_map.m_lblk = map->m_lblk; in ext4_ext_convert_to_initialized()
3766 split_map.m_len = map->m_len; in ext4_ext_convert_to_initialized()
3800 allocated = map->m_len; in ext4_ext_convert_to_initialized()
3844 struct ext4_map_blocks *map, in ext4_split_convert_extents() argument
3857 (unsigned long long)map->m_lblk, map->m_len); in ext4_split_convert_extents()
3861 if (eof_block < map->m_lblk + map->m_len) in ext4_split_convert_extents()
3862 eof_block = map->m_lblk + map->m_len; in ext4_split_convert_extents()
3882 return ext4_split_extent(handle, inode, ppath, map, split_flag, flags); in ext4_split_convert_extents()
3887 struct ext4_map_blocks *map, in ext4_convert_unwritten_extents_endio() argument
3912 if (ee_block != map->m_lblk || ee_len > map->m_len) { in ext4_convert_unwritten_extents_endio()
3917 (unsigned long long)map->m_lblk, map->m_len); in ext4_convert_unwritten_extents_endio()
3919 err = ext4_split_convert_extents(handle, inode, map, ppath, in ext4_convert_unwritten_extents_endio()
3923 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in ext4_convert_unwritten_extents_endio()
4003 struct ext4_map_blocks *map, in convert_initialized_extent() argument
4018 if (map->m_len > EXT_UNWRITTEN_MAX_LEN) in convert_initialized_extent()
4019 map->m_len = EXT_UNWRITTEN_MAX_LEN / 2; in convert_initialized_extent()
4030 if (ee_block != map->m_lblk || ee_len > map->m_len) { in convert_initialized_extent()
4031 err = ext4_split_convert_extents(handle, inode, map, ppath, in convert_initialized_extent()
4035 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in convert_initialized_extent()
4042 (unsigned long) map->m_lblk); in convert_initialized_extent()
4065 err = check_eofblocks_fl(handle, inode, map->m_lblk, path, map->m_len); in convert_initialized_extent()
4068 map->m_flags |= EXT4_MAP_UNWRITTEN; in convert_initialized_extent()
4069 if (allocated > map->m_len) in convert_initialized_extent()
4070 allocated = map->m_len; in convert_initialized_extent()
4071 map->m_len = allocated; in convert_initialized_extent()
4077 struct ext4_map_blocks *map, in ext4_ext_handle_unwritten_extents() argument
4087 inode->i_ino, (unsigned long long)map->m_lblk, map->m_len, in ext4_ext_handle_unwritten_extents()
4097 trace_ext4_ext_handle_unwritten_extents(inode, map, flags, in ext4_ext_handle_unwritten_extents()
4102 ret = ext4_split_convert_extents(handle, inode, map, ppath, in ext4_ext_handle_unwritten_extents()
4106 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_handle_unwritten_extents()
4112 if (allocated > map->m_len) in ext4_ext_handle_unwritten_extents()
4113 allocated = map->m_len; in ext4_ext_handle_unwritten_extents()
4114 err = ext4_issue_zeroout(inode, map->m_lblk, newblock, in ext4_ext_handle_unwritten_extents()
4119 ret = ext4_convert_unwritten_extents_endio(handle, inode, map, in ext4_ext_handle_unwritten_extents()
4123 err = check_eofblocks_fl(handle, inode, map->m_lblk, in ext4_ext_handle_unwritten_extents()
4124 path, map->m_len); in ext4_ext_handle_unwritten_extents()
4127 map->m_flags |= EXT4_MAP_MAPPED; in ext4_ext_handle_unwritten_extents()
4128 map->m_pblk = newblock; in ext4_ext_handle_unwritten_extents()
4129 if (allocated > map->m_len) in ext4_ext_handle_unwritten_extents()
4130 allocated = map->m_len; in ext4_ext_handle_unwritten_extents()
4131 map->m_len = allocated; in ext4_ext_handle_unwritten_extents()
4140 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_handle_unwritten_extents()
4153 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_handle_unwritten_extents()
4158 ret = ext4_ext_convert_to_initialized(handle, inode, map, ppath, flags); in ext4_ext_handle_unwritten_extents()
4167 map->m_flags |= EXT4_MAP_NEW; in ext4_ext_handle_unwritten_extents()
4168 if (allocated > map->m_len) in ext4_ext_handle_unwritten_extents()
4169 allocated = map->m_len; in ext4_ext_handle_unwritten_extents()
4170 map->m_len = allocated; in ext4_ext_handle_unwritten_extents()
4173 map->m_flags |= EXT4_MAP_MAPPED; in ext4_ext_handle_unwritten_extents()
4175 err = check_eofblocks_fl(handle, inode, map->m_lblk, path, in ext4_ext_handle_unwritten_extents()
4176 map->m_len); in ext4_ext_handle_unwritten_extents()
4181 if (allocated > map->m_len) in ext4_ext_handle_unwritten_extents()
4182 allocated = map->m_len; in ext4_ext_handle_unwritten_extents()
4184 map->m_pblk = newblock; in ext4_ext_handle_unwritten_extents()
4185 map->m_len = allocated; in ext4_ext_handle_unwritten_extents()
4232 struct ext4_map_blocks *map, in get_implied_cluster_alloc() argument
4237 ext4_lblk_t c_offset = EXT4_LBLK_COFF(sbi, map->m_lblk); in get_implied_cluster_alloc()
4249 rr_cluster_start = EXT4_B2C(sbi, map->m_lblk); in get_implied_cluster_alloc()
4255 map->m_pblk = EXT4_PBLK_CMASK(sbi, ee_start) + c_offset; in get_implied_cluster_alloc()
4256 map->m_len = min(map->m_len, in get_implied_cluster_alloc()
4267 if (map->m_lblk < ee_block) in get_implied_cluster_alloc()
4268 map->m_len = min(map->m_len, ee_block - map->m_lblk); in get_implied_cluster_alloc()
4279 if (map->m_lblk > ee_block) { in get_implied_cluster_alloc()
4281 map->m_len = min(map->m_len, next - map->m_lblk); in get_implied_cluster_alloc()
4284 trace_ext4_get_implied_cluster_alloc_exit(sb, map, 1); in get_implied_cluster_alloc()
4288 trace_ext4_get_implied_cluster_alloc_exit(sb, map, 0); in get_implied_cluster_alloc()
4312 struct ext4_map_blocks *map, int flags) in ext4_ext_map_blocks() argument
4326 map->m_lblk, map->m_len, inode->i_ino); in ext4_ext_map_blocks()
4327 trace_ext4_ext_map_blocks_enter(inode, map->m_lblk, map->m_len, flags); in ext4_ext_map_blocks()
4330 path = ext4_find_extent(inode, map->m_lblk, NULL, 0); in ext4_ext_map_blocks()
4347 (unsigned long) map->m_lblk, depth, in ext4_ext_map_blocks()
4369 if (in_range(map->m_lblk, ee_block, ee_len)) { in ext4_ext_map_blocks()
4370 newblock = map->m_lblk - ee_block + ee_start; in ext4_ext_map_blocks()
4372 allocated = ee_len - (map->m_lblk - ee_block); in ext4_ext_map_blocks()
4373 ext_debug("%u fit into %u:%d -> %llu\n", map->m_lblk, in ext4_ext_map_blocks()
4383 handle, inode, map, &path, in ext4_ext_map_blocks()
4390 handle, inode, map, &path, flags, in ext4_ext_map_blocks()
4407 hole_start = map->m_lblk; in ext4_ext_map_blocks()
4416 if (hole_start != map->m_lblk) in ext4_ext_map_blocks()
4417 hole_len -= map->m_lblk - hole_start; in ext4_ext_map_blocks()
4418 map->m_pblk = 0; in ext4_ext_map_blocks()
4419 map->m_len = min_t(unsigned int, map->m_len, hole_len); in ext4_ext_map_blocks()
4427 newex.ee_block = cpu_to_le32(map->m_lblk); in ext4_ext_map_blocks()
4428 cluster_offset = EXT4_LBLK_COFF(sbi, map->m_lblk); in ext4_ext_map_blocks()
4435 get_implied_cluster_alloc(inode->i_sb, map, ex, path)) { in ext4_ext_map_blocks()
4436 ar.len = allocated = map->m_len; in ext4_ext_map_blocks()
4437 newblock = map->m_pblk; in ext4_ext_map_blocks()
4443 ar.lleft = map->m_lblk; in ext4_ext_map_blocks()
4447 ar.lright = map->m_lblk; in ext4_ext_map_blocks()
4456 get_implied_cluster_alloc(inode->i_sb, map, ex2, path)) { in ext4_ext_map_blocks()
4457 ar.len = allocated = map->m_len; in ext4_ext_map_blocks()
4458 newblock = map->m_pblk; in ext4_ext_map_blocks()
4469 if (map->m_len > EXT_INIT_MAX_LEN && in ext4_ext_map_blocks()
4471 map->m_len = EXT_INIT_MAX_LEN; in ext4_ext_map_blocks()
4472 else if (map->m_len > EXT_UNWRITTEN_MAX_LEN && in ext4_ext_map_blocks()
4474 map->m_len = EXT_UNWRITTEN_MAX_LEN; in ext4_ext_map_blocks()
4477 newex.ee_len = cpu_to_le16(map->m_len); in ext4_ext_map_blocks()
4482 allocated = map->m_len; in ext4_ext_map_blocks()
4486 ar.goal = ext4_ext_find_goal(inode, path, map->m_lblk); in ext4_ext_map_blocks()
4487 ar.logical = map->m_lblk; in ext4_ext_map_blocks()
4496 offset = EXT4_LBLK_COFF(sbi, map->m_lblk); in ext4_ext_map_blocks()
4529 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_map_blocks()
4534 err = check_eofblocks_fl(handle, inode, map->m_lblk, in ext4_ext_map_blocks()
4555 if (allocated > map->m_len) in ext4_ext_map_blocks()
4556 allocated = map->m_len; in ext4_ext_map_blocks()
4557 map->m_flags |= EXT4_MAP_NEW; in ext4_ext_map_blocks()
4588 lblk = EXT4_LBLK_CMASK(sbi, map->m_lblk); in ext4_ext_map_blocks()
4605 if (allocated > map->m_len) in ext4_ext_map_blocks()
4606 allocated = map->m_len; in ext4_ext_map_blocks()
4608 map->m_flags |= EXT4_MAP_MAPPED; in ext4_ext_map_blocks()
4609 map->m_pblk = newblock; in ext4_ext_map_blocks()
4610 map->m_len = allocated; in ext4_ext_map_blocks()
4615 trace_ext4_ext_map_blocks_exit(inode, flags, map, in ext4_ext_map_blocks()
4663 struct ext4_map_blocks map; in ext4_alloc_file_blocks() local
4668 map.m_lblk = offset; in ext4_alloc_file_blocks()
4669 map.m_len = len; in ext4_alloc_file_blocks()
4700 ret = ext4_map_blocks(handle, inode, &map, flags); in ext4_alloc_file_blocks()
4704 inode->i_ino, map.m_lblk, in ext4_alloc_file_blocks()
4705 map.m_len, ret); in ext4_alloc_file_blocks()
4710 map.m_lblk += ret; in ext4_alloc_file_blocks()
4711 map.m_len = len = len - ret; in ext4_alloc_file_blocks()
4712 epos = (loff_t)map.m_lblk << inode->i_blkbits; in ext4_alloc_file_blocks()
5017 struct ext4_map_blocks map; in ext4_convert_unwritten_extents() local
5020 map.m_lblk = offset >> blkbits; in ext4_convert_unwritten_extents()
5041 map.m_lblk += ret; in ext4_convert_unwritten_extents()
5042 map.m_len = (max_blocks -= ret); in ext4_convert_unwritten_extents()
5051 ret = ext4_map_blocks(handle, inode, &map, in ext4_convert_unwritten_extents()
5057 inode->i_ino, map.m_lblk, in ext4_convert_unwritten_extents()
5058 map.m_len, ret); in ext4_convert_unwritten_extents()