Loading fs/btrfs/btrfs_inode.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ struct btrfs_inode { /* for keeping track of orphaned inodes */ struct list_head i_orphan; struct list_head delalloc_inodes; /* * transid of the trans_handle that last modified this inode */ Loading fs/btrfs/ctree.h +4 −0 Original line number Diff line number Diff line Loading @@ -551,6 +551,7 @@ struct btrfs_fs_info { */ spinlock_t ordered_extent_lock; struct list_head ordered_extents; struct list_head delalloc_inodes; /* * there is a pool of worker threads for checksumming during writes Loading Loading @@ -637,6 +638,7 @@ struct btrfs_root { struct kobject root_kobj; struct completion kobj_unregister; struct mutex objectid_mutex; u64 objectid; u64 last_trans; Loading Loading @@ -1651,6 +1653,8 @@ int btrfs_csum_truncate(struct btrfs_trans_handle *trans, #define PageChecked PageFsMisc #endif int btrfs_start_delalloc_inodes(struct btrfs_root *root); int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end); int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc); int btrfs_create_subvol_root(struct btrfs_root *new_root, Loading fs/btrfs/disk-io.c +1 −0 Original line number Diff line number Diff line Loading @@ -1234,6 +1234,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, INIT_LIST_HEAD(&fs_info->trans_list); INIT_LIST_HEAD(&fs_info->dead_roots); INIT_LIST_HEAD(&fs_info->hashers); INIT_LIST_HEAD(&fs_info->delalloc_inodes); spin_lock_init(&fs_info->hash_lock); spin_lock_init(&fs_info->delalloc_lock); spin_lock_init(&fs_info->new_trans_lock); Loading fs/btrfs/extent-tree.c +9 −3 Original line number Diff line number Diff line Loading @@ -1230,7 +1230,6 @@ static int update_space_info(struct btrfs_fs_info *info, u64 flags, found->total_bytes += total_bytes; found->bytes_used += bytes_used; found->full = 0; WARN_ON(found->total_bytes < found->bytes_used); *space_info = found; return 0; } Loading Loading @@ -2841,8 +2840,7 @@ static int noinline relocate_inode_pages(struct inode *inode, u64 start, */ clear_page_dirty_for_io(page); set_extent_delalloc(io_tree, page_start, page_end, GFP_NOFS); btrfs_set_extent_delalloc(inode, page_start, page_end); set_page_dirty(page); unlock_extent(io_tree, page_start, page_end, GFP_NOFS); Loading Loading @@ -3319,6 +3317,13 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start) key.type = 0; cur_byte = key.objectid; mutex_unlock(&root->fs_info->alloc_mutex); btrfs_start_delalloc_inodes(root); btrfs_wait_ordered_extents(tree_root); mutex_lock(&root->fs_info->alloc_mutex); ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); if (ret < 0) goto out; Loading Loading @@ -3401,6 +3406,7 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start) btrfs_clean_old_snapshots(tree_root); btrfs_start_delalloc_inodes(root); btrfs_wait_ordered_extents(tree_root); trans = btrfs_start_transaction(tree_root, 1); Loading fs/btrfs/file.c +1 −2 Original line number Diff line number Diff line Loading @@ -312,8 +312,7 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans, * to reset the delalloc bit on things that already have * extents reserved. */ set_extent_delalloc(io_tree, start_pos, end_of_last_block, GFP_NOFS); btrfs_set_extent_delalloc(inode, start_pos, end_of_last_block); for (i = 0; i < num_pages; i++) { struct page *p = pages[i]; SetPageUptodate(p); Loading Loading
fs/btrfs/btrfs_inode.h +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ struct btrfs_inode { /* for keeping track of orphaned inodes */ struct list_head i_orphan; struct list_head delalloc_inodes; /* * transid of the trans_handle that last modified this inode */ Loading
fs/btrfs/ctree.h +4 −0 Original line number Diff line number Diff line Loading @@ -551,6 +551,7 @@ struct btrfs_fs_info { */ spinlock_t ordered_extent_lock; struct list_head ordered_extents; struct list_head delalloc_inodes; /* * there is a pool of worker threads for checksumming during writes Loading Loading @@ -637,6 +638,7 @@ struct btrfs_root { struct kobject root_kobj; struct completion kobj_unregister; struct mutex objectid_mutex; u64 objectid; u64 last_trans; Loading Loading @@ -1651,6 +1653,8 @@ int btrfs_csum_truncate(struct btrfs_trans_handle *trans, #define PageChecked PageFsMisc #endif int btrfs_start_delalloc_inodes(struct btrfs_root *root); int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end); int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc); int btrfs_create_subvol_root(struct btrfs_root *new_root, Loading
fs/btrfs/disk-io.c +1 −0 Original line number Diff line number Diff line Loading @@ -1234,6 +1234,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, INIT_LIST_HEAD(&fs_info->trans_list); INIT_LIST_HEAD(&fs_info->dead_roots); INIT_LIST_HEAD(&fs_info->hashers); INIT_LIST_HEAD(&fs_info->delalloc_inodes); spin_lock_init(&fs_info->hash_lock); spin_lock_init(&fs_info->delalloc_lock); spin_lock_init(&fs_info->new_trans_lock); Loading
fs/btrfs/extent-tree.c +9 −3 Original line number Diff line number Diff line Loading @@ -1230,7 +1230,6 @@ static int update_space_info(struct btrfs_fs_info *info, u64 flags, found->total_bytes += total_bytes; found->bytes_used += bytes_used; found->full = 0; WARN_ON(found->total_bytes < found->bytes_used); *space_info = found; return 0; } Loading Loading @@ -2841,8 +2840,7 @@ static int noinline relocate_inode_pages(struct inode *inode, u64 start, */ clear_page_dirty_for_io(page); set_extent_delalloc(io_tree, page_start, page_end, GFP_NOFS); btrfs_set_extent_delalloc(inode, page_start, page_end); set_page_dirty(page); unlock_extent(io_tree, page_start, page_end, GFP_NOFS); Loading Loading @@ -3319,6 +3317,13 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start) key.type = 0; cur_byte = key.objectid; mutex_unlock(&root->fs_info->alloc_mutex); btrfs_start_delalloc_inodes(root); btrfs_wait_ordered_extents(tree_root); mutex_lock(&root->fs_info->alloc_mutex); ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); if (ret < 0) goto out; Loading Loading @@ -3401,6 +3406,7 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start) btrfs_clean_old_snapshots(tree_root); btrfs_start_delalloc_inodes(root); btrfs_wait_ordered_extents(tree_root); trans = btrfs_start_transaction(tree_root, 1); Loading
fs/btrfs/file.c +1 −2 Original line number Diff line number Diff line Loading @@ -312,8 +312,7 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans, * to reset the delalloc bit on things that already have * extents reserved. */ set_extent_delalloc(io_tree, start_pos, end_of_last_block, GFP_NOFS); btrfs_set_extent_delalloc(inode, start_pos, end_of_last_block); for (i = 0; i < num_pages; i++) { struct page *p = pages[i]; SetPageUptodate(p); Loading