Lines Matching defs:inode
169 void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
176 page = find_get_page(inode->i_mapping, index);
234 static noinline void __unlock_for_delalloc(struct inode *inode,
245 __process_pages_contig(inode->i_mapping, locked_page, start, end,
249 static noinline int lock_delalloc_pages(struct inode *inode,
254 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
255 struct address_space *mapping = inode->i_mapping;
301 __unlock_for_delalloc(inode, locked_page, start, processed_end);
321 noinline_for_stack bool find_lock_delalloc_range(struct inode *inode,
325 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
326 struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree;
374 ret = lock_delalloc_pages(inode, locked_page,
402 __unlock_for_delalloc(inode, locked_page,
414 void extent_clear_unlock_delalloc(struct btrfs_inode *inode, u64 start, u64 end,
418 clear_extent_bit(&inode->io_tree, start, end, clear_bits, NULL);
420 __process_pages_contig(inode->vfs_inode.i_mapping, locked_page,
470 struct inode *inode = page->mapping->host;
471 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
502 struct btrfs_inode *inode;
503 /* Start of the range in @inode */
505 /* End of the range in @inode */
516 * Will release processed extent when any of @inode, @uptodate, the range is
519 * Passing @inode == NULL will force processed extent to be released.
522 struct btrfs_inode *inode, u64 start, u64 end,
529 if (!processed->inode)
539 * check if the inode still matches.
543 if (processed->inode == inode && processed->uptodate == uptodate &&
549 tree = &processed->inode->io_tree;
558 processed->inode = inode;
601 struct inode *inode = page->mapping->host;
602 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
635 loff_t i_size = i_size_read(inode);
658 endio_readpage_release_extent(&processed, BTRFS_I(inode),
730 * 1) The pages are belonging to the same inode
743 static void alloc_new_bio(struct btrfs_inode *inode,
747 struct btrfs_fs_info *fs_info = inode->root->fs_info;
753 bbio->inode = inode;
762 ordered = btrfs_lookup_ordered_extent(inode, file_offset);
797 struct btrfs_inode *inode = BTRFS_I(page->mapping->host);
811 alloc_new_bio(inode, bio_ctrl, disk_bytenr,
818 ASSERT(is_data_inode(&inode->vfs_inode));
873 * If the page is mapped to btree inode, we should hold the private
940 __get_extent_map(struct inode *inode, struct page *page, size_t pg_offset,
957 em = btrfs_get_extent(BTRFS_I(inode), page, pg_offset, start, len);
975 struct inode *inode = page->mapping->host;
976 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
981 u64 last_byte = i_size_read(inode);
987 size_t blocksize = inode->i_sb->s_blocksize;
988 struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree;
1020 em = __get_extent_map(inode, page, pg_offset, cur,
1127 struct btrfs_inode *inode = BTRFS_I(page->mapping->host);
1133 btrfs_lock_and_flush_ordered_range(inode, start, end, NULL);
1150 struct btrfs_inode *inode = BTRFS_I(pages[0]->mapping->host);
1153 btrfs_lock_and_flush_ordered_range(inode, start, end, NULL);
1172 static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode,
1184 if (!find_lock_delalloc_range(&inode->vfs_inode, page,
1190 ret = btrfs_run_delalloc_range(inode, page, delalloc_start,
1286 static noinline_for_stack int __extent_writepage_io(struct btrfs_inode *inode,
1292 struct btrfs_fs_info *fs_info = inode->root->fs_info;
1319 btrfs_mark_ordered_io_finished(inode, page, cur, len,
1340 em = btrfs_get_extent(inode, NULL, 0, cur, len);
1368 btrfs_set_range_writeback(inode, cur, cur + iosize - 1);
1370 btrfs_err(inode->root->fs_info,
1414 struct inode *inode = page->mapping->host;
1419 loff_t i_size = i_size_read(inode);
1422 trace___extent_writepage(page, inode, bio_ctrl->wbc);
1441 ret = writepage_delalloc(BTRFS_I(inode), page, bio_ctrl->wbc);
1447 ret = __extent_writepage_io(BTRFS_I(inode), page, bio_ctrl, i_size, &nr);
1460 btrfs_mark_ordered_io_finished(BTRFS_I(inode), page, page_start,
1543 * the btree inode), we might have
1557 * Note: setting AS_EIO/AS_ENOSPC in the btree inode's i_mapping would
1567 * Using the flags below in the btree inode also makes us achieve the
1681 bbio->inode = BTRFS_I(eb->fs_info->btree_inode);
2003 struct inode *inode = mapping->host;
2017 * We have to hold onto the inode so that ordered extents can do their
2020 * to deal with, so instead just hold onto the inode throughout the
2021 * writepages operation. If it fails here we are freeing up the inode
2025 if (!igrab(inode))
2047 * and we are the first one who do the filemap_flush() on this inode.
2054 &BTRFS_I(inode)->runtime_flags))
2147 btrfs_add_delayed_iput(BTRFS_I(inode));
2156 void extent_write_locked_range(struct inode *inode, struct page *locked_page,
2162 struct address_space *mapping = inode->i_mapping;
2163 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
2165 loff_t i_size = i_size_read(inode);
2190 ret = __extent_writepage_io(BTRFS_I(inode), page, &bio_ctrl,
2201 btrfs_mark_ordered_io_finished(BTRFS_I(inode), page,
2219 struct inode *inode = mapping->host;
2230 btrfs_zoned_data_reloc_lock(BTRFS_I(inode));
2233 btrfs_zoned_data_reloc_unlock(BTRFS_I(inode));
2271 /* This function is only called for the btree inode */
2393 * is no need to set the full fsync flag on the inode (it
2450 * When iterating the extents of the inode, at extent_fiemap(), we may
2609 static int fiemap_next_leaf_item(struct btrfs_inode *inode, struct btrfs_path *path)
2620 ret = btrfs_next_leaf(inode->root, path);
2626 * our inode.
2629 if (key.objectid != btrfs_ino(inode) || key.type != BTRFS_EXTENT_DATA_KEY)
2650 static int fiemap_search_slot(struct btrfs_inode *inode, struct btrfs_path *path,
2653 const u64 ino = btrfs_ino(inode);
2654 struct btrfs_root *root = inode->root;
2689 * the file range in the inode's io tree, so we know none of our file
2713 * Process a range which is a hole or a prealloc extent in the inode's subvolume
2717 static int fiemap_process_hole(struct btrfs_inode *inode,
2726 const u64 i_size = i_size_read(&inode->vfs_inode);
2744 delalloc = btrfs_find_delalloc_in_range(inode, cur_offset, end,
2767 ret = btrfs_is_data_extent_shared(inode,
2816 ret = btrfs_is_data_extent_shared(inode,
2835 static int fiemap_find_last_extent_offset(struct btrfs_inode *inode,
2839 const u64 ino = btrfs_ino(inode);
2840 struct btrfs_root *root = inode->root;
2860 * at least it has the inode item for this inode and all the items for
2861 * the root inode 256.
2911 int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
2914 const u64 ino = btrfs_ino(inode);
2934 lockstart = round_down(start, inode->root->fs_info->sectorsize);
2935 lockend = round_up(start + len, inode->root->fs_info->sectorsize);
2938 btrfs_inode_lock(inode, BTRFS_ILOCK_SHARED);
2939 lock_extent(&inode->io_tree, lockstart, lockend, &cached_state);
2941 ret = fiemap_find_last_extent_offset(inode, path, &last_extent_end);
2947 ret = fiemap_search_slot(inode, path, lockstart);
2991 ret = fiemap_process_hole(inode, fieinfo, &cache,
3032 ret = fiemap_process_hole(inode, fieinfo, &cache,
3040 ret = fiemap_process_hole(inode, fieinfo, &cache,
3047 ret = btrfs_is_data_extent_shared(inode,
3077 ret = fiemap_next_leaf_item(inode, path);
3081 /* No more file extent items for this inode. */
3099 ret = fiemap_process_hole(inode, fieinfo, &cache,
3108 const u64 i_size = i_size_read(&inode->vfs_inode);
3115 delalloc = btrfs_find_delalloc_in_range(inode,
3131 unlock_extent(&inode->io_tree, lockstart, lockend, &cached_state);
3132 btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED);
4031 bbio->inode = BTRFS_I(eb->fs_info->btree_inode);