Re: [PATCH] btrfs: convert reflink.c to use btrfs_inode as parameters
Qu Wenruo <[email protected]> Mon, 27 Jul 2026 18:21:21 +0930
| Newsgroups | org.kernel.vger.linux-btrfs |
|---|---|
| Message-ID | <[email protected]> |
在 2026/7/27 18:13, Daniel Vacek 写道: [...] >> @@ -789,7 +790,7 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src, >> * we found the previous extent covering eof and before we >> * attempted to increment its reference count). >> */ >> - ret = btrfs_wait_ordered_range(BTRFS_I(inode), wb_start, >> + ret = btrfs_wait_ordered_range(inode, wb_start, >> destoff - wb_start); > > This could have been a single line. Thanks, pushed with this fixed. Qu > > --nX > >> if (ret) >> return ret; >> @@ -802,9 +803,9 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src, >> * mode. >> */ >> end = destoff + len - 1; >> - btrfs_lock_extent(&BTRFS_I(inode)->io_tree, destoff, end, &cached_state); >> + btrfs_lock_extent(&inode->io_tree, destoff, end, &cached_state); >> ret = btrfs_clone(src, inode, off, olen, len, destoff, false); >> - btrfs_unlock_extent(&BTRFS_I(inode)->io_tree, destoff, end, &cached_state); >> + btrfs_unlock_extent(&inode->io_tree, destoff, end, &cached_state); >> if (ret < 0) >> return ret; >> >> @@ -818,7 +819,7 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src, >> * could come from some range other than the copied inline extent's >> * destination range and we have no way to know that. >> */ >> - ret = btrfs_wait_ordered_range(BTRFS_I(inode), destoff, len); >> + ret = btrfs_wait_ordered_range(inode, destoff, len); >> if (ret < 0) >> return ret; >> >> @@ -826,7 +827,7 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src, >> * Invalidate page cache so that future reads will see the cloned data >> * immediately and not the previous data. >> */ >> - ret = filemap_invalidate_inode(inode, false, destoff, end); >> + ret = filemap_invalidate_inode(&inode->vfs_inode, false, destoff, end); >> if (ret < 0) >> return ret; >> >> @@ -934,7 +935,7 @@ loff_t btrfs_remap_file_range(struct file *src_file, loff_t off, >> bool same_inode = dst_inode == src_inode; >> int ret; >> >> - if (btrfs_is_shutdown(inode_to_fs_info(file_inode(src_file)))) >> + if (btrfs_is_shutdown(src_inode->root->fs_info)) >> return -EIO; >> >> if (remap_flags & ~(REMAP_FILE_DEDUP | REMAP_FILE_ADVISORY)) >> @@ -953,8 +954,7 @@ loff_t btrfs_remap_file_range(struct file *src_file, loff_t off, >> goto out_unlock; >> >> if (remap_flags & REMAP_FILE_DEDUP) >> - ret = btrfs_extent_same(&src_inode->vfs_inode, off, len, >> - &dst_inode->vfs_inode, destoff); >> + ret = btrfs_extent_same(src_inode, off, len, dst_inode, destoff); >> else >> ret = btrfs_clone_files(dst_file, src_file, off, len, destoff); >> >> -- >> 2.54.0 >> >>