• Home
  • Raw
  • Download

Lines Matching refs:map

1434 	struct f2fs_map_blocks map;  in f2fs_preallocate_blocks()  local
1439 map.m_lblk = F2FS_BLK_ALIGN(iocb->ki_pos); in f2fs_preallocate_blocks()
1440 map.m_len = F2FS_BYTES_TO_BLK(iocb->ki_pos + iov_iter_count(from)); in f2fs_preallocate_blocks()
1441 if (map.m_len > map.m_lblk) in f2fs_preallocate_blocks()
1442 map.m_len -= map.m_lblk; in f2fs_preallocate_blocks()
1444 map.m_len = 0; in f2fs_preallocate_blocks()
1446 map.m_next_pgofs = NULL; in f2fs_preallocate_blocks()
1447 map.m_next_extent = NULL; in f2fs_preallocate_blocks()
1448 map.m_seg_type = NO_CHECK_TYPE; in f2fs_preallocate_blocks()
1449 map.m_may_create = true; in f2fs_preallocate_blocks()
1452 map.m_seg_type = f2fs_rw_hint_to_seg_type(iocb->ki_hint); in f2fs_preallocate_blocks()
1469 err = f2fs_map_blocks(inode, &map, 1, flag); in f2fs_preallocate_blocks()
1470 if (map.m_len > 0 && err == -ENOSPC) { in f2fs_preallocate_blocks()
1498 int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, in f2fs_map_blocks() argument
1501 unsigned int maxblocks = map->m_len; in f2fs_map_blocks()
1504 int mode = map->m_may_create ? ALLOC_NODE : LOOKUP_NODE; in f2fs_map_blocks()
1516 map->m_len = 0; in f2fs_map_blocks()
1517 map->m_flags = 0; in f2fs_map_blocks()
1520 pgofs = (pgoff_t)map->m_lblk; in f2fs_map_blocks()
1525 map->m_may_create) in f2fs_map_blocks()
1528 map->m_pblk = ei.blk + pgofs - ei.fofs; in f2fs_map_blocks()
1529 map->m_len = min((pgoff_t)maxblocks, ei.fofs + ei.len - pgofs); in f2fs_map_blocks()
1530 map->m_flags = F2FS_MAP_MAPPED; in f2fs_map_blocks()
1531 if (map->m_next_extent) in f2fs_map_blocks()
1532 *map->m_next_extent = pgofs + map->m_len; in f2fs_map_blocks()
1537 map->m_pblk, map->m_len); in f2fs_map_blocks()
1542 if (map->m_may_create) in f2fs_map_blocks()
1550 map->m_pblk = 0; in f2fs_map_blocks()
1559 if (map->m_may_create && in f2fs_map_blocks()
1567 if (map->m_next_pgofs) in f2fs_map_blocks()
1568 *map->m_next_pgofs = in f2fs_map_blocks()
1570 if (map->m_next_extent) in f2fs_map_blocks()
1571 *map->m_next_extent = in f2fs_map_blocks()
1594 map->m_may_create) { in f2fs_map_blocks()
1595 err = __allocate_data_block(&dn, map->m_seg_type); in f2fs_map_blocks()
1616 map->m_seg_type); in f2fs_map_blocks()
1622 map->m_flags |= F2FS_MAP_NEW; in f2fs_map_blocks()
1626 map->m_pblk = 0; in f2fs_map_blocks()
1633 if (map->m_next_pgofs) in f2fs_map_blocks()
1634 *map->m_next_pgofs = pgofs + 1; in f2fs_map_blocks()
1639 if (map->m_next_pgofs) in f2fs_map_blocks()
1640 *map->m_next_pgofs = pgofs + 1; in f2fs_map_blocks()
1649 if (map->m_len == 0) { in f2fs_map_blocks()
1652 map->m_flags |= F2FS_MAP_UNWRITTEN; in f2fs_map_blocks()
1653 map->m_flags |= F2FS_MAP_MAPPED; in f2fs_map_blocks()
1655 map->m_pblk = blkaddr; in f2fs_map_blocks()
1656 map->m_len = 1; in f2fs_map_blocks()
1657 } else if ((map->m_pblk != NEW_ADDR && in f2fs_map_blocks()
1658 blkaddr == (map->m_pblk + ofs)) || in f2fs_map_blocks()
1659 (map->m_pblk == NEW_ADDR && blkaddr == NEW_ADDR) || in f2fs_map_blocks()
1662 map->m_len++; in f2fs_map_blocks()
1680 map->m_len += dn.ofs_in_node - ofs_in_node; in f2fs_map_blocks()
1694 if (map->m_flags & F2FS_MAP_MAPPED) { in f2fs_map_blocks()
1695 unsigned int ofs = start_pgofs - map->m_lblk; in f2fs_map_blocks()
1698 start_pgofs, map->m_pblk + ofs, in f2fs_map_blocks()
1699 map->m_len - ofs); in f2fs_map_blocks()
1705 if (map->m_may_create) { in f2fs_map_blocks()
1714 if (flag == F2FS_GET_BLOCK_DIO && map->m_flags & F2FS_MAP_MAPPED) in f2fs_map_blocks()
1716 map->m_pblk, map->m_len); in f2fs_map_blocks()
1719 if (map->m_flags & F2FS_MAP_MAPPED) { in f2fs_map_blocks()
1720 unsigned int ofs = start_pgofs - map->m_lblk; in f2fs_map_blocks()
1723 start_pgofs, map->m_pblk + ofs, in f2fs_map_blocks()
1724 map->m_len - ofs); in f2fs_map_blocks()
1726 if (map->m_next_extent) in f2fs_map_blocks()
1727 *map->m_next_extent = pgofs + 1; in f2fs_map_blocks()
1731 if (map->m_may_create) { in f2fs_map_blocks()
1736 trace_f2fs_map_blocks(inode, map, err); in f2fs_map_blocks()
1742 struct f2fs_map_blocks map; in f2fs_overwrite_io() local
1749 map.m_lblk = F2FS_BYTES_TO_BLK(pos); in f2fs_overwrite_io()
1750 map.m_next_pgofs = NULL; in f2fs_overwrite_io()
1751 map.m_next_extent = NULL; in f2fs_overwrite_io()
1752 map.m_seg_type = NO_CHECK_TYPE; in f2fs_overwrite_io()
1753 map.m_may_create = false; in f2fs_overwrite_io()
1756 while (map.m_lblk < last_lblk) { in f2fs_overwrite_io()
1757 map.m_len = last_lblk - map.m_lblk; in f2fs_overwrite_io()
1758 err = f2fs_map_blocks(inode, &map, 0, F2FS_GET_BLOCK_DEFAULT); in f2fs_overwrite_io()
1759 if (err || map.m_len == 0) in f2fs_overwrite_io()
1761 map.m_lblk += map.m_len; in f2fs_overwrite_io()
1770 struct f2fs_map_blocks map; in __get_data_block() local
1773 map.m_lblk = iblock; in __get_data_block()
1774 map.m_len = bh->b_size >> inode->i_blkbits; in __get_data_block()
1775 map.m_next_pgofs = next_pgofs; in __get_data_block()
1776 map.m_next_extent = NULL; in __get_data_block()
1777 map.m_seg_type = seg_type; in __get_data_block()
1778 map.m_may_create = may_write; in __get_data_block()
1780 err = f2fs_map_blocks(inode, &map, create, flag); in __get_data_block()
1782 map_bh(bh, inode->i_sb, map.m_pblk); in __get_data_block()
1783 bh->b_state = (bh->b_state & ~F2FS_MAP_FLAGS) | map.m_flags; in __get_data_block()
1784 bh->b_size = (u64)map.m_len << inode->i_blkbits; in __get_data_block()
2063 struct f2fs_map_blocks *map, in f2fs_read_single_page() argument
2090 if ((map->m_flags & F2FS_MAP_MAPPED) && in f2fs_read_single_page()
2091 block_in_file > map->m_lblk && in f2fs_read_single_page()
2092 block_in_file < (map->m_lblk + map->m_len)) in f2fs_read_single_page()
2099 map->m_lblk = block_in_file; in f2fs_read_single_page()
2100 map->m_len = last_block - block_in_file; in f2fs_read_single_page()
2102 ret = f2fs_map_blocks(inode, map, 0, F2FS_GET_BLOCK_DEFAULT); in f2fs_read_single_page()
2106 if ((map->m_flags & F2FS_MAP_MAPPED)) { in f2fs_read_single_page()
2107 block_nr = map->m_pblk + block_in_file - map->m_lblk; in f2fs_read_single_page()
2346 struct f2fs_map_blocks map; in f2fs_mpage_readpages() local
2366 map.m_pblk = 0; in f2fs_mpage_readpages()
2367 map.m_lblk = 0; in f2fs_mpage_readpages()
2368 map.m_len = 0; in f2fs_mpage_readpages()
2369 map.m_flags = 0; in f2fs_mpage_readpages()
2370 map.m_next_pgofs = NULL; in f2fs_mpage_readpages()
2371 map.m_next_extent = NULL; in f2fs_mpage_readpages()
2372 map.m_seg_type = NO_CHECK_TYPE; in f2fs_mpage_readpages()
2373 map.m_may_create = false; in f2fs_mpage_readpages()
2416 ret = f2fs_read_single_page(inode, page, max_nr_pages, &map, in f2fs_mpage_readpages()