Lines Matching refs:iomap
584 struct metapath *mp, struct iomap *iomap) in gfs2_hole_size() argument
599 iomap->length = hole_size << inode->i_blkbits; in gfs2_hole_size()
661 static int gfs2_iomap_alloc(struct inode *inode, struct iomap *iomap, in gfs2_iomap_alloc() argument
669 size_t dblks = iomap->length >> inode->i_blkbits; in gfs2_iomap_alloc()
765 iomap->addr = bn << inode->i_blkbits; in gfs2_iomap_alloc()
766 iomap->flags |= IOMAP_F_MERGED | IOMAP_F_NEW; in gfs2_iomap_alloc()
771 } while (iomap->addr == IOMAP_NULL_ADDR); in gfs2_iomap_alloc()
773 iomap->type = IOMAP_MAPPED; in gfs2_iomap_alloc()
774 iomap->length = (u64)dblks << inode->i_blkbits; in gfs2_iomap_alloc()
841 unsigned flags, struct iomap *iomap, in gfs2_iomap_get() argument
872 iomap->length = max_size; in gfs2_iomap_get()
880 iomap->offset = pos; in gfs2_iomap_get()
881 iomap->length = length; in gfs2_iomap_get()
885 iomap->length = size; in gfs2_iomap_get()
887 iomap->addr = (ip->i_no_addr << inode->i_blkbits) + in gfs2_iomap_get()
889 iomap->type = IOMAP_INLINE; in gfs2_iomap_get()
890 iomap->inline_data = dibh->b_data + sizeof(struct gfs2_dinode); in gfs2_iomap_get()
896 iomap->offset = lblock << inode->i_blkbits; in gfs2_iomap_get()
899 iomap->length = len << inode->i_blkbits; in gfs2_iomap_get()
922 iomap->addr = be64_to_cpu(*ptr) << inode->i_blkbits; in gfs2_iomap_get()
923 iomap->length = len << inode->i_blkbits; in gfs2_iomap_get()
924 iomap->type = IOMAP_MAPPED; in gfs2_iomap_get()
925 iomap->flags |= IOMAP_F_MERGED; in gfs2_iomap_get()
927 iomap->flags |= IOMAP_F_GFS2_BOUNDARY; in gfs2_iomap_get()
930 iomap->bdev = inode->i_sb->s_bdev; in gfs2_iomap_get()
936 iomap->addr = IOMAP_NULL_ADDR; in gfs2_iomap_get()
937 iomap->type = IOMAP_HOLE; in gfs2_iomap_get()
942 ret = gfs2_hole_size(inode, lblock, len, mp, iomap); in gfs2_iomap_get()
944 iomap->length = size - pos; in gfs2_iomap_get()
953 if (alloc_size < iomap->length) in gfs2_iomap_get()
954 iomap->length = alloc_size; in gfs2_iomap_get()
957 ret = gfs2_hole_size(inode, lblock, len, mp, iomap); in gfs2_iomap_get()
975 struct iomap iomap = { }; in gfs2_lblk_to_dblk() local
980 ret = gfs2_iomap_get(inode, pos, i_blocksize(inode), 0, &iomap, &mp); in gfs2_lblk_to_dblk()
983 *dblock = iomap.addr >> inode->i_blkbits; in gfs2_lblk_to_dblk()
1029 unsigned len, struct iomap *iomap) in gfs2_iomap_page_prepare() argument
1041 struct iomap *iomap) in gfs2_iomap_page_done() argument
1063 struct iomap *iomap, in gfs2_iomap_begin_write() argument
1074 if (unstuff || iomap->type == IOMAP_HOLE) { in gfs2_iomap_begin_write()
1080 gfs2_write_calc_reserv(ip, iomap->length, &data_blocks, in gfs2_iomap_begin_write()
1101 iomap->length >> inode->i_blkbits); in gfs2_iomap_begin_write()
1110 ret = gfs2_iomap_get(inode, iomap->offset, in gfs2_iomap_begin_write()
1111 iomap->length, flags, iomap, mp); in gfs2_iomap_begin_write()
1116 if (iomap->type == IOMAP_HOLE) { in gfs2_iomap_begin_write()
1117 ret = gfs2_iomap_alloc(inode, iomap, mp); in gfs2_iomap_begin_write()
1121 punch_hole(ip, iomap->offset, iomap->length); in gfs2_iomap_begin_write()
1134 iomap->page_ops = &gfs2_iomap_page_ops; in gfs2_iomap_begin_write()
1152 unsigned flags, struct iomap *iomap) in gfs2_iomap_begin() argument
1158 iomap->flags |= IOMAP_F_BUFFER_HEAD; in gfs2_iomap_begin()
1167 ret = gfs2_iomap_get(inode, pos, length, flags, iomap, &mp); in gfs2_iomap_begin()
1178 if (iomap->type != IOMAP_MAPPED) in gfs2_iomap_begin()
1184 if (iomap->type == IOMAP_HOLE) in gfs2_iomap_begin()
1191 ret = gfs2_iomap_begin_write(inode, pos, length, flags, iomap, &mp); in gfs2_iomap_begin()
1198 trace_gfs2_iomap_end(ip, iomap, ret); in gfs2_iomap_begin()
1203 ssize_t written, unsigned flags, struct iomap *iomap) in gfs2_iomap_end() argument
1214 if (iomap->type == IOMAP_HOLE) in gfs2_iomap_end()
1229 if (length != written && (iomap->flags & IOMAP_F_NEW)) { in gfs2_iomap_end()
1247 if (iomap->flags & IOMAP_F_SIZE_CHANGED) in gfs2_iomap_end()
1290 struct iomap iomap = { }; in gfs2_block_map() local
1299 ret = gfs2_iomap_get(inode, pos, length, IOMAP_WRITE, &iomap, &mp); in gfs2_block_map()
1300 if (!ret && iomap.type == IOMAP_HOLE) in gfs2_block_map()
1301 ret = gfs2_iomap_alloc(inode, &iomap, &mp); in gfs2_block_map()
1304 ret = gfs2_iomap_get(inode, pos, length, 0, &iomap, &mp); in gfs2_block_map()
1310 if (iomap.length > bh_map->b_size) { in gfs2_block_map()
1311 iomap.length = bh_map->b_size; in gfs2_block_map()
1312 iomap.flags &= ~IOMAP_F_GFS2_BOUNDARY; in gfs2_block_map()
1314 if (iomap.addr != IOMAP_NULL_ADDR) in gfs2_block_map()
1315 map_bh(bh_map, inode->i_sb, iomap.addr >> inode->i_blkbits); in gfs2_block_map()
1316 bh_map->b_size = iomap.length; in gfs2_block_map()
1317 if (iomap.flags & IOMAP_F_GFS2_BOUNDARY) in gfs2_block_map()
1319 if (iomap.flags & IOMAP_F_NEW) in gfs2_block_map()
1458 struct iomap *iomap) in gfs2_iomap_get_alloc() argument
1463 ret = gfs2_iomap_get(inode, pos, length, IOMAP_WRITE, iomap, &mp); in gfs2_iomap_get_alloc()
1464 if (!ret && iomap->type == IOMAP_HOLE) in gfs2_iomap_get_alloc()
1465 ret = gfs2_iomap_alloc(inode, iomap, &mp); in gfs2_iomap_get_alloc()