Lines Matching refs:map
100 struct ext4_map_blocks *map,
3290 struct ext4_map_blocks *map, in ext4_split_extent() argument
3301 int allocated = map->m_len; in ext4_split_extent()
3309 if (map->m_lblk + map->m_len < ee_block + ee_len) { in ext4_split_extent()
3318 map->m_lblk + map->m_len, split_flag1, flags1); in ext4_split_extent()
3322 allocated = ee_len - (map->m_lblk - ee_block); in ext4_split_extent()
3328 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in ext4_split_extent()
3335 (unsigned long) map->m_lblk); in ext4_split_extent()
3341 if (map->m_lblk >= ee_block) { in ext4_split_extent()
3349 map->m_lblk, split_flag1, flags); in ext4_split_extent()
3381 struct ext4_map_blocks *map, in ext4_ext_convert_to_initialized() argument
3392 unsigned int ee_len, depth, map_len = map->m_len; in ext4_ext_convert_to_initialized()
3399 (unsigned long long)map->m_lblk, map_len); in ext4_ext_convert_to_initialized()
3404 if (eof_block < map->m_lblk + map_len) in ext4_ext_convert_to_initialized()
3405 eof_block = map->m_lblk + map_len; in ext4_ext_convert_to_initialized()
3414 trace_ext4_ext_convert_to_initialized_enter(inode, map, ex); in ext4_ext_convert_to_initialized()
3418 BUG_ON(!in_range(map->m_lblk, ee_block, ee_len)); in ext4_ext_convert_to_initialized()
3435 if ((map->m_lblk == ee_block) && in ext4_ext_convert_to_initialized()
3467 map, ex, abut_ex); in ext4_ext_convert_to_initialized()
3481 } else if (((map->m_lblk + map_len) == (ee_block + ee_len)) && in ext4_ext_convert_to_initialized()
3505 ((map->m_lblk + map_len) == next_lblk) && /*C2*/ in ext4_ext_convert_to_initialized()
3513 map, ex, abut_ex); in ext4_ext_convert_to_initialized()
3536 allocated = ee_len - (map->m_lblk - ee_block); in ext4_ext_convert_to_initialized()
3538 WARN_ON(map->m_lblk < ee_block); in ext4_ext_convert_to_initialized()
3574 split_map.m_lblk = map->m_lblk; in ext4_ext_convert_to_initialized()
3575 split_map.m_len = map->m_len; in ext4_ext_convert_to_initialized()
3577 if (max_zeroout && (allocated > map->m_len)) { in ext4_ext_convert_to_initialized()
3581 cpu_to_le32(map->m_lblk); in ext4_ext_convert_to_initialized()
3584 ext4_ext_pblock(ex) + map->m_lblk - ee_block); in ext4_ext_convert_to_initialized()
3588 split_map.m_lblk = map->m_lblk; in ext4_ext_convert_to_initialized()
3590 } else if (map->m_lblk - ee_block + map->m_len < max_zeroout) { in ext4_ext_convert_to_initialized()
3592 if (map->m_lblk != ee_block) { in ext4_ext_convert_to_initialized()
3594 zero_ex.ee_len = cpu_to_le16(map->m_lblk - in ext4_ext_convert_to_initialized()
3604 split_map.m_len = map->m_lblk - ee_block + map->m_len; in ext4_ext_convert_to_initialized()
3605 allocated = map->m_len; in ext4_ext_convert_to_initialized()
3646 struct ext4_map_blocks *map, in ext4_split_convert_extents() argument
3659 (unsigned long long)map->m_lblk, map->m_len); in ext4_split_convert_extents()
3663 if (eof_block < map->m_lblk + map->m_len) in ext4_split_convert_extents()
3664 eof_block = map->m_lblk + map->m_len; in ext4_split_convert_extents()
3684 return ext4_split_extent(handle, inode, ppath, map, split_flag, flags); in ext4_split_convert_extents()
3689 struct ext4_map_blocks *map, in ext4_convert_unwritten_extents_endio() argument
3714 if (ee_block != map->m_lblk || ee_len > map->m_len) { in ext4_convert_unwritten_extents_endio()
3719 (unsigned long long)map->m_lblk, map->m_len); in ext4_convert_unwritten_extents_endio()
3721 err = ext4_split_convert_extents(handle, inode, map, ppath, in ext4_convert_unwritten_extents_endio()
3725 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in ext4_convert_unwritten_extents_endio()
3921 struct ext4_map_blocks *map, in convert_initialized_extent() argument
3936 if (map->m_len > EXT_UNWRITTEN_MAX_LEN) in convert_initialized_extent()
3937 map->m_len = EXT_UNWRITTEN_MAX_LEN / 2; in convert_initialized_extent()
3948 if (ee_block != map->m_lblk || ee_len > map->m_len) { in convert_initialized_extent()
3949 err = ext4_split_convert_extents(handle, inode, map, ppath, in convert_initialized_extent()
3953 path = ext4_find_extent(inode, map->m_lblk, ppath, 0); in convert_initialized_extent()
3960 (unsigned long) map->m_lblk); in convert_initialized_extent()
3983 err = check_eofblocks_fl(handle, inode, map->m_lblk, path, map->m_len); in convert_initialized_extent()
3986 map->m_flags |= EXT4_MAP_UNWRITTEN; in convert_initialized_extent()
3987 if (allocated > map->m_len) in convert_initialized_extent()
3988 allocated = map->m_len; in convert_initialized_extent()
3989 map->m_len = allocated; in convert_initialized_extent()
3995 struct ext4_map_blocks *map, in ext4_ext_handle_unwritten_extents() argument
4006 inode->i_ino, (unsigned long long)map->m_lblk, map->m_len, in ext4_ext_handle_unwritten_extents()
4016 trace_ext4_ext_handle_unwritten_extents(inode, map, flags, in ext4_ext_handle_unwritten_extents()
4021 ret = ext4_split_convert_extents(handle, inode, map, ppath, in ext4_ext_handle_unwritten_extents()
4034 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_handle_unwritten_extents()
4039 ret = ext4_convert_unwritten_extents_endio(handle, inode, map, in ext4_ext_handle_unwritten_extents()
4043 err = check_eofblocks_fl(handle, inode, map->m_lblk, in ext4_ext_handle_unwritten_extents()
4044 path, map->m_len); in ext4_ext_handle_unwritten_extents()
4047 map->m_flags |= EXT4_MAP_MAPPED; in ext4_ext_handle_unwritten_extents()
4048 map->m_pblk = newblock; in ext4_ext_handle_unwritten_extents()
4049 if (allocated > map->m_len) in ext4_ext_handle_unwritten_extents()
4050 allocated = map->m_len; in ext4_ext_handle_unwritten_extents()
4051 map->m_len = allocated; in ext4_ext_handle_unwritten_extents()
4060 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_handle_unwritten_extents()
4073 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_handle_unwritten_extents()
4078 ret = ext4_ext_convert_to_initialized(handle, inode, map, ppath, flags); in ext4_ext_handle_unwritten_extents()
4087 map->m_flags |= EXT4_MAP_NEW; in ext4_ext_handle_unwritten_extents()
4095 if (allocated > map->m_len) { in ext4_ext_handle_unwritten_extents()
4097 newblock + map->m_len, in ext4_ext_handle_unwritten_extents()
4098 allocated - map->m_len); in ext4_ext_handle_unwritten_extents()
4099 allocated = map->m_len; in ext4_ext_handle_unwritten_extents()
4101 map->m_len = allocated; in ext4_ext_handle_unwritten_extents()
4113 map->m_lblk, map->m_len); in ext4_ext_handle_unwritten_extents()
4121 map->m_flags |= EXT4_MAP_MAPPED; in ext4_ext_handle_unwritten_extents()
4123 err = check_eofblocks_fl(handle, inode, map->m_lblk, path, in ext4_ext_handle_unwritten_extents()
4124 map->m_len); 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()
4132 map->m_pblk = newblock; in ext4_ext_handle_unwritten_extents()
4133 map->m_len = allocated; in ext4_ext_handle_unwritten_extents()
4180 struct ext4_map_blocks *map, in get_implied_cluster_alloc() argument
4185 ext4_lblk_t c_offset = EXT4_LBLK_COFF(sbi, map->m_lblk); in get_implied_cluster_alloc()
4197 rr_cluster_start = EXT4_B2C(sbi, map->m_lblk); in get_implied_cluster_alloc()
4203 map->m_pblk = EXT4_PBLK_CMASK(sbi, ee_start) + c_offset; in get_implied_cluster_alloc()
4204 map->m_len = min(map->m_len, in get_implied_cluster_alloc()
4215 if (map->m_lblk < ee_block) in get_implied_cluster_alloc()
4216 map->m_len = min(map->m_len, ee_block - map->m_lblk); in get_implied_cluster_alloc()
4227 if (map->m_lblk > ee_block) { in get_implied_cluster_alloc()
4229 map->m_len = min(map->m_len, next - map->m_lblk); in get_implied_cluster_alloc()
4232 trace_ext4_get_implied_cluster_alloc_exit(sb, map, 1); in get_implied_cluster_alloc()
4236 trace_ext4_get_implied_cluster_alloc_exit(sb, map, 0); in get_implied_cluster_alloc()
4260 struct ext4_map_blocks *map, int flags) in ext4_ext_map_blocks() argument
4275 map->m_lblk, map->m_len, inode->i_ino); in ext4_ext_map_blocks()
4276 trace_ext4_ext_map_blocks_enter(inode, map->m_lblk, map->m_len, flags); in ext4_ext_map_blocks()
4279 path = ext4_find_extent(inode, map->m_lblk, NULL, 0); in ext4_ext_map_blocks()
4296 (unsigned long) map->m_lblk, depth, in ext4_ext_map_blocks()
4318 if (in_range(map->m_lblk, ee_block, ee_len)) { in ext4_ext_map_blocks()
4319 newblock = map->m_lblk - ee_block + ee_start; in ext4_ext_map_blocks()
4321 allocated = ee_len - (map->m_lblk - ee_block); in ext4_ext_map_blocks()
4322 ext_debug("%u fit into %u:%d -> %llu\n", map->m_lblk, in ext4_ext_map_blocks()
4332 handle, inode, map, &path, in ext4_ext_map_blocks()
4339 handle, inode, map, &path, flags, in ext4_ext_map_blocks()
4350 ext4_find_delalloc_cluster(inode, map->m_lblk)) in ext4_ext_map_blocks()
4351 map->m_flags |= EXT4_MAP_FROM_CLUSTER; in ext4_ext_map_blocks()
4363 ext4_ext_put_gap_in_cache(inode, path, map->m_lblk); in ext4_ext_map_blocks()
4370 map->m_flags &= ~EXT4_MAP_FROM_CLUSTER; in ext4_ext_map_blocks()
4371 newex.ee_block = cpu_to_le32(map->m_lblk); in ext4_ext_map_blocks()
4372 cluster_offset = EXT4_LBLK_COFF(sbi, map->m_lblk); in ext4_ext_map_blocks()
4379 get_implied_cluster_alloc(inode->i_sb, map, ex, path)) { in ext4_ext_map_blocks()
4380 ar.len = allocated = map->m_len; in ext4_ext_map_blocks()
4381 newblock = map->m_pblk; in ext4_ext_map_blocks()
4382 map->m_flags |= EXT4_MAP_FROM_CLUSTER; in ext4_ext_map_blocks()
4387 ar.lleft = map->m_lblk; in ext4_ext_map_blocks()
4391 ar.lright = map->m_lblk; in ext4_ext_map_blocks()
4400 get_implied_cluster_alloc(inode->i_sb, map, ex2, path)) { in ext4_ext_map_blocks()
4401 ar.len = allocated = map->m_len; in ext4_ext_map_blocks()
4402 newblock = map->m_pblk; in ext4_ext_map_blocks()
4403 map->m_flags |= EXT4_MAP_FROM_CLUSTER; in ext4_ext_map_blocks()
4413 if (map->m_len > EXT_INIT_MAX_LEN && in ext4_ext_map_blocks()
4415 map->m_len = EXT_INIT_MAX_LEN; in ext4_ext_map_blocks()
4416 else if (map->m_len > EXT_UNWRITTEN_MAX_LEN && in ext4_ext_map_blocks()
4418 map->m_len = EXT_UNWRITTEN_MAX_LEN; in ext4_ext_map_blocks()
4421 newex.ee_len = cpu_to_le16(map->m_len); in ext4_ext_map_blocks()
4426 allocated = map->m_len; in ext4_ext_map_blocks()
4430 ar.goal = ext4_ext_find_goal(inode, path, map->m_lblk); in ext4_ext_map_blocks()
4431 ar.logical = map->m_lblk; in ext4_ext_map_blocks()
4440 offset = EXT4_LBLK_COFF(sbi, map->m_lblk); in ext4_ext_map_blocks()
4471 map->m_flags |= EXT4_MAP_UNWRITTEN; in ext4_ext_map_blocks()
4485 err = check_eofblocks_fl(handle, inode, map->m_lblk, in ext4_ext_map_blocks()
4514 if (allocated > map->m_len) in ext4_ext_map_blocks()
4515 allocated = map->m_len; in ext4_ext_map_blocks()
4516 map->m_flags |= EXT4_MAP_NEW; in ext4_ext_map_blocks()
4528 map->m_lblk, allocated); in ext4_ext_map_blocks()
4529 if (map->m_flags & EXT4_MAP_FROM_CLUSTER) { in ext4_ext_map_blocks()
4614 if (allocated > map->m_len) in ext4_ext_map_blocks()
4615 allocated = map->m_len; in ext4_ext_map_blocks()
4617 map->m_flags |= EXT4_MAP_MAPPED; in ext4_ext_map_blocks()
4618 map->m_pblk = newblock; in ext4_ext_map_blocks()
4619 map->m_len = allocated; in ext4_ext_map_blocks()
4624 trace_ext4_ext_map_blocks_exit(inode, flags, map, in ext4_ext_map_blocks()
4673 struct ext4_map_blocks map; in ext4_alloc_file_blocks() local
4677 map.m_lblk = offset; in ext4_alloc_file_blocks()
4678 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()
5010 struct ext4_map_blocks map; in ext4_convert_unwritten_extents() local
5013 map.m_lblk = offset >> blkbits; in ext4_convert_unwritten_extents()
5019 map.m_lblk); in ext4_convert_unwritten_extents()
5038 map.m_lblk += ret; in ext4_convert_unwritten_extents()
5039 map.m_len = (max_blocks -= ret); in ext4_convert_unwritten_extents()
5048 ret = ext4_map_blocks(handle, inode, &map, in ext4_convert_unwritten_extents()
5054 inode->i_ino, map.m_lblk, in ext4_convert_unwritten_extents()
5055 map.m_len, ret); in ext4_convert_unwritten_extents()