diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/Kconfig | 3 | ||||
-rw-r--r-- | fs/btrfs/export.c | 4 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 25 | ||||
-rw-r--r-- | fs/btrfs/file.c | 8 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 4 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 52 | ||||
-rw-r--r-- | fs/btrfs/relocation.c | 4 | ||||
-rw-r--r-- | fs/btrfs/send.c | 2 | ||||
-rw-r--r-- | fs/btrfs/transaction.c | 1 |
9 files changed, 42 insertions, 61 deletions
diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig index 5f583c8a36d0..9a8622a5b867 100644 --- a/fs/btrfs/Kconfig +++ b/fs/btrfs/Kconfig | |||
@@ -1,6 +1,5 @@ | |||
1 | config BTRFS_FS | 1 | config BTRFS_FS |
2 | tristate "Btrfs filesystem (EXPERIMENTAL) Unstable disk format" | 2 | tristate "Btrfs filesystem Unstable disk format" |
3 | depends on EXPERIMENTAL | ||
4 | select LIBCRC32C | 3 | select LIBCRC32C |
5 | select ZLIB_INFLATE | 4 | select ZLIB_INFLATE |
6 | select ZLIB_DEFLATE | 5 | select ZLIB_DEFLATE |
diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c index 614f34a899c2..81ee29eeb7ca 100644 --- a/fs/btrfs/export.c +++ b/fs/btrfs/export.c | |||
@@ -22,10 +22,10 @@ static int btrfs_encode_fh(struct inode *inode, u32 *fh, int *max_len, | |||
22 | 22 | ||
23 | if (parent && (len < BTRFS_FID_SIZE_CONNECTABLE)) { | 23 | if (parent && (len < BTRFS_FID_SIZE_CONNECTABLE)) { |
24 | *max_len = BTRFS_FID_SIZE_CONNECTABLE; | 24 | *max_len = BTRFS_FID_SIZE_CONNECTABLE; |
25 | return 255; | 25 | return FILEID_INVALID; |
26 | } else if (len < BTRFS_FID_SIZE_NON_CONNECTABLE) { | 26 | } else if (len < BTRFS_FID_SIZE_NON_CONNECTABLE) { |
27 | *max_len = BTRFS_FID_SIZE_NON_CONNECTABLE; | 27 | *max_len = BTRFS_FID_SIZE_NON_CONNECTABLE; |
28 | return 255; | 28 | return FILEID_INVALID; |
29 | } | 29 | } |
30 | 30 | ||
31 | len = BTRFS_FID_SIZE_NON_CONNECTABLE; | 31 | len = BTRFS_FID_SIZE_NON_CONNECTABLE; |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index aaee2b7fee78..3e074dab2d57 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3800,23 +3800,6 @@ static int can_overcommit(struct btrfs_root *root, | |||
3800 | return 0; | 3800 | return 0; |
3801 | } | 3801 | } |
3802 | 3802 | ||
3803 | static inline int writeback_inodes_sb_nr_if_idle_safe(struct super_block *sb, | ||
3804 | unsigned long nr_pages, | ||
3805 | enum wb_reason reason) | ||
3806 | { | ||
3807 | /* the flusher is dealing with the dirty inodes now. */ | ||
3808 | if (writeback_in_progress(sb->s_bdi)) | ||
3809 | return 1; | ||
3810 | |||
3811 | if (down_read_trylock(&sb->s_umount)) { | ||
3812 | writeback_inodes_sb_nr(sb, nr_pages, reason); | ||
3813 | up_read(&sb->s_umount); | ||
3814 | return 1; | ||
3815 | } | ||
3816 | |||
3817 | return 0; | ||
3818 | } | ||
3819 | |||
3820 | void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root, | 3803 | void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root, |
3821 | unsigned long nr_pages) | 3804 | unsigned long nr_pages) |
3822 | { | 3805 | { |
@@ -3824,7 +3807,7 @@ void btrfs_writeback_inodes_sb_nr(struct btrfs_root *root, | |||
3824 | int started; | 3807 | int started; |
3825 | 3808 | ||
3826 | /* If we can not start writeback, just sync all the delalloc file. */ | 3809 | /* If we can not start writeback, just sync all the delalloc file. */ |
3827 | started = writeback_inodes_sb_nr_if_idle_safe(sb, nr_pages, | 3810 | started = try_to_writeback_inodes_sb_nr(sb, nr_pages, |
3828 | WB_REASON_FS_FREE_SPACE); | 3811 | WB_REASON_FS_FREE_SPACE); |
3829 | if (!started) { | 3812 | if (!started) { |
3830 | /* | 3813 | /* |
@@ -6716,7 +6699,7 @@ reada: | |||
6716 | } | 6699 | } |
6717 | 6700 | ||
6718 | /* | 6701 | /* |
6719 | * hepler to process tree block while walking down the tree. | 6702 | * helper to process tree block while walking down the tree. |
6720 | * | 6703 | * |
6721 | * when wc->stage == UPDATE_BACKREF, this function updates | 6704 | * when wc->stage == UPDATE_BACKREF, this function updates |
6722 | * back refs for pointers in the block. | 6705 | * back refs for pointers in the block. |
@@ -6791,7 +6774,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans, | |||
6791 | } | 6774 | } |
6792 | 6775 | ||
6793 | /* | 6776 | /* |
6794 | * hepler to process tree block pointer. | 6777 | * helper to process tree block pointer. |
6795 | * | 6778 | * |
6796 | * when wc->stage == DROP_REFERENCE, this function checks | 6779 | * when wc->stage == DROP_REFERENCE, this function checks |
6797 | * reference count of the block pointed to. if the block | 6780 | * reference count of the block pointed to. if the block |
@@ -6929,7 +6912,7 @@ skip: | |||
6929 | } | 6912 | } |
6930 | 6913 | ||
6931 | /* | 6914 | /* |
6932 | * hepler to process tree block while walking up the tree. | 6915 | * helper to process tree block while walking up the tree. |
6933 | * | 6916 | * |
6934 | * when wc->stage == DROP_REFERENCE, this function drops | 6917 | * when wc->stage == DROP_REFERENCE, this function drops |
6935 | * reference count on the block. | 6918 | * reference count on the block. |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 83c790d84038..af1d0605a5c1 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1229,7 +1229,7 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file, | |||
1229 | struct extent_state *cached_state = NULL; | 1229 | struct extent_state *cached_state = NULL; |
1230 | int i; | 1230 | int i; |
1231 | unsigned long index = pos >> PAGE_CACHE_SHIFT; | 1231 | unsigned long index = pos >> PAGE_CACHE_SHIFT; |
1232 | struct inode *inode = fdentry(file)->d_inode; | 1232 | struct inode *inode = file_inode(file); |
1233 | gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping); | 1233 | gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping); |
1234 | int err = 0; | 1234 | int err = 0; |
1235 | int faili = 0; | 1235 | int faili = 0; |
@@ -1316,7 +1316,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, | |||
1316 | struct iov_iter *i, | 1316 | struct iov_iter *i, |
1317 | loff_t pos) | 1317 | loff_t pos) |
1318 | { | 1318 | { |
1319 | struct inode *inode = fdentry(file)->d_inode; | 1319 | struct inode *inode = file_inode(file); |
1320 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1320 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1321 | struct page **pages = NULL; | 1321 | struct page **pages = NULL; |
1322 | unsigned long first_index; | 1322 | unsigned long first_index; |
@@ -1504,7 +1504,7 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
1504 | unsigned long nr_segs, loff_t pos) | 1504 | unsigned long nr_segs, loff_t pos) |
1505 | { | 1505 | { |
1506 | struct file *file = iocb->ki_filp; | 1506 | struct file *file = iocb->ki_filp; |
1507 | struct inode *inode = fdentry(file)->d_inode; | 1507 | struct inode *inode = file_inode(file); |
1508 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1508 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1509 | loff_t *ppos = &iocb->ki_pos; | 1509 | loff_t *ppos = &iocb->ki_pos; |
1510 | u64 start_pos; | 1510 | u64 start_pos; |
@@ -2139,7 +2139,7 @@ out: | |||
2139 | static long btrfs_fallocate(struct file *file, int mode, | 2139 | static long btrfs_fallocate(struct file *file, int mode, |
2140 | loff_t offset, loff_t len) | 2140 | loff_t offset, loff_t len) |
2141 | { | 2141 | { |
2142 | struct inode *inode = file->f_path.dentry->d_inode; | 2142 | struct inode *inode = file_inode(file); |
2143 | struct extent_state *cached_state = NULL; | 2143 | struct extent_state *cached_state = NULL; |
2144 | u64 cur_offset; | 2144 | u64 cur_offset; |
2145 | u64 last_byte; | 2145 | u64 last_byte; |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 13ab4de0a400..d1470adca8f8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5107,7 +5107,7 @@ unsigned char btrfs_filetype_table[] = { | |||
5107 | static int btrfs_real_readdir(struct file *filp, void *dirent, | 5107 | static int btrfs_real_readdir(struct file *filp, void *dirent, |
5108 | filldir_t filldir) | 5108 | filldir_t filldir) |
5109 | { | 5109 | { |
5110 | struct inode *inode = filp->f_dentry->d_inode; | 5110 | struct inode *inode = file_inode(filp); |
5111 | struct btrfs_root *root = BTRFS_I(inode)->root; | 5111 | struct btrfs_root *root = BTRFS_I(inode)->root; |
5112 | struct btrfs_item *item; | 5112 | struct btrfs_item *item; |
5113 | struct btrfs_dir_item *di; | 5113 | struct btrfs_dir_item *di; |
@@ -7529,7 +7529,7 @@ static void btrfs_invalidatepage(struct page *page, unsigned long offset) | |||
7529 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 7529 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) |
7530 | { | 7530 | { |
7531 | struct page *page = vmf->page; | 7531 | struct page *page = vmf->page; |
7532 | struct inode *inode = fdentry(vma->vm_file)->d_inode; | 7532 | struct inode *inode = file_inode(vma->vm_file); |
7533 | struct btrfs_root *root = BTRFS_I(inode)->root; | 7533 | struct btrfs_root *root = BTRFS_I(inode)->root; |
7534 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; | 7534 | struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; |
7535 | struct btrfs_ordered_extent *ordered; | 7535 | struct btrfs_ordered_extent *ordered; |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 898c5729e7e5..2c02310ff2d9 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -152,7 +152,7 @@ void btrfs_inherit_iflags(struct inode *inode, struct inode *dir) | |||
152 | 152 | ||
153 | static int btrfs_ioctl_getflags(struct file *file, void __user *arg) | 153 | static int btrfs_ioctl_getflags(struct file *file, void __user *arg) |
154 | { | 154 | { |
155 | struct btrfs_inode *ip = BTRFS_I(file->f_path.dentry->d_inode); | 155 | struct btrfs_inode *ip = BTRFS_I(file_inode(file)); |
156 | unsigned int flags = btrfs_flags_to_ioctl(ip->flags); | 156 | unsigned int flags = btrfs_flags_to_ioctl(ip->flags); |
157 | 157 | ||
158 | if (copy_to_user(arg, &flags, sizeof(flags))) | 158 | if (copy_to_user(arg, &flags, sizeof(flags))) |
@@ -177,7 +177,7 @@ static int check_flags(unsigned int flags) | |||
177 | 177 | ||
178 | static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | 178 | static int btrfs_ioctl_setflags(struct file *file, void __user *arg) |
179 | { | 179 | { |
180 | struct inode *inode = file->f_path.dentry->d_inode; | 180 | struct inode *inode = file_inode(file); |
181 | struct btrfs_inode *ip = BTRFS_I(inode); | 181 | struct btrfs_inode *ip = BTRFS_I(inode); |
182 | struct btrfs_root *root = ip->root; | 182 | struct btrfs_root *root = ip->root; |
183 | struct btrfs_trans_handle *trans; | 183 | struct btrfs_trans_handle *trans; |
@@ -310,7 +310,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | |||
310 | 310 | ||
311 | static int btrfs_ioctl_getversion(struct file *file, int __user *arg) | 311 | static int btrfs_ioctl_getversion(struct file *file, int __user *arg) |
312 | { | 312 | { |
313 | struct inode *inode = file->f_path.dentry->d_inode; | 313 | struct inode *inode = file_inode(file); |
314 | 314 | ||
315 | return put_user(inode->i_generation, arg); | 315 | return put_user(inode->i_generation, arg); |
316 | } | 316 | } |
@@ -1348,7 +1348,7 @@ static noinline int btrfs_ioctl_resize(struct file *file, | |||
1348 | u64 new_size; | 1348 | u64 new_size; |
1349 | u64 old_size; | 1349 | u64 old_size; |
1350 | u64 devid = 1; | 1350 | u64 devid = 1; |
1351 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 1351 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
1352 | struct btrfs_ioctl_vol_args *vol_args; | 1352 | struct btrfs_ioctl_vol_args *vol_args; |
1353 | struct btrfs_trans_handle *trans; | 1353 | struct btrfs_trans_handle *trans; |
1354 | struct btrfs_device *device = NULL; | 1354 | struct btrfs_device *device = NULL; |
@@ -1518,8 +1518,8 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file, | |||
1518 | goto out_drop_write; | 1518 | goto out_drop_write; |
1519 | } | 1519 | } |
1520 | 1520 | ||
1521 | src_inode = src.file->f_path.dentry->d_inode; | 1521 | src_inode = file_inode(src.file); |
1522 | if (src_inode->i_sb != file->f_path.dentry->d_inode->i_sb) { | 1522 | if (src_inode->i_sb != file_inode(file)->i_sb) { |
1523 | printk(KERN_INFO "btrfs: Snapshot src from " | 1523 | printk(KERN_INFO "btrfs: Snapshot src from " |
1524 | "another FS\n"); | 1524 | "another FS\n"); |
1525 | ret = -EINVAL; | 1525 | ret = -EINVAL; |
@@ -1611,7 +1611,7 @@ out: | |||
1611 | static noinline int btrfs_ioctl_subvol_getflags(struct file *file, | 1611 | static noinline int btrfs_ioctl_subvol_getflags(struct file *file, |
1612 | void __user *arg) | 1612 | void __user *arg) |
1613 | { | 1613 | { |
1614 | struct inode *inode = fdentry(file)->d_inode; | 1614 | struct inode *inode = file_inode(file); |
1615 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1615 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1616 | int ret = 0; | 1616 | int ret = 0; |
1617 | u64 flags = 0; | 1617 | u64 flags = 0; |
@@ -1633,7 +1633,7 @@ static noinline int btrfs_ioctl_subvol_getflags(struct file *file, | |||
1633 | static noinline int btrfs_ioctl_subvol_setflags(struct file *file, | 1633 | static noinline int btrfs_ioctl_subvol_setflags(struct file *file, |
1634 | void __user *arg) | 1634 | void __user *arg) |
1635 | { | 1635 | { |
1636 | struct inode *inode = fdentry(file)->d_inode; | 1636 | struct inode *inode = file_inode(file); |
1637 | struct btrfs_root *root = BTRFS_I(inode)->root; | 1637 | struct btrfs_root *root = BTRFS_I(inode)->root; |
1638 | struct btrfs_trans_handle *trans; | 1638 | struct btrfs_trans_handle *trans; |
1639 | u64 root_flags; | 1639 | u64 root_flags; |
@@ -1927,7 +1927,7 @@ static noinline int btrfs_ioctl_tree_search(struct file *file, | |||
1927 | if (IS_ERR(args)) | 1927 | if (IS_ERR(args)) |
1928 | return PTR_ERR(args); | 1928 | return PTR_ERR(args); |
1929 | 1929 | ||
1930 | inode = fdentry(file)->d_inode; | 1930 | inode = file_inode(file); |
1931 | ret = search_ioctl(inode, args); | 1931 | ret = search_ioctl(inode, args); |
1932 | if (ret == 0 && copy_to_user(argp, args, sizeof(*args))) | 1932 | if (ret == 0 && copy_to_user(argp, args, sizeof(*args))) |
1933 | ret = -EFAULT; | 1933 | ret = -EFAULT; |
@@ -2037,7 +2037,7 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file, | |||
2037 | if (IS_ERR(args)) | 2037 | if (IS_ERR(args)) |
2038 | return PTR_ERR(args); | 2038 | return PTR_ERR(args); |
2039 | 2039 | ||
2040 | inode = fdentry(file)->d_inode; | 2040 | inode = file_inode(file); |
2041 | 2041 | ||
2042 | if (args->treeid == 0) | 2042 | if (args->treeid == 0) |
2043 | args->treeid = BTRFS_I(inode)->root->root_key.objectid; | 2043 | args->treeid = BTRFS_I(inode)->root->root_key.objectid; |
@@ -2236,7 +2236,7 @@ out: | |||
2236 | 2236 | ||
2237 | static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | 2237 | static int btrfs_ioctl_defrag(struct file *file, void __user *argp) |
2238 | { | 2238 | { |
2239 | struct inode *inode = fdentry(file)->d_inode; | 2239 | struct inode *inode = file_inode(file); |
2240 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2240 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2241 | struct btrfs_ioctl_defrag_range_args *range; | 2241 | struct btrfs_ioctl_defrag_range_args *range; |
2242 | int ret; | 2242 | int ret; |
@@ -2289,7 +2289,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | |||
2289 | /* the rest are all set to zero by kzalloc */ | 2289 | /* the rest are all set to zero by kzalloc */ |
2290 | range->len = (u64)-1; | 2290 | range->len = (u64)-1; |
2291 | } | 2291 | } |
2292 | ret = btrfs_defrag_file(fdentry(file)->d_inode, file, | 2292 | ret = btrfs_defrag_file(file_inode(file), file, |
2293 | range, 0, 0); | 2293 | range, 0, 0); |
2294 | if (ret > 0) | 2294 | if (ret > 0) |
2295 | ret = 0; | 2295 | ret = 0; |
@@ -2336,7 +2336,7 @@ out: | |||
2336 | 2336 | ||
2337 | static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) | 2337 | static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) |
2338 | { | 2338 | { |
2339 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 2339 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
2340 | struct btrfs_ioctl_vol_args *vol_args; | 2340 | struct btrfs_ioctl_vol_args *vol_args; |
2341 | int ret; | 2341 | int ret; |
2342 | 2342 | ||
@@ -2459,7 +2459,7 @@ out: | |||
2459 | static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | 2459 | static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, |
2460 | u64 off, u64 olen, u64 destoff) | 2460 | u64 off, u64 olen, u64 destoff) |
2461 | { | 2461 | { |
2462 | struct inode *inode = fdentry(file)->d_inode; | 2462 | struct inode *inode = file_inode(file); |
2463 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2463 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2464 | struct fd src_file; | 2464 | struct fd src_file; |
2465 | struct inode *src; | 2465 | struct inode *src; |
@@ -2505,7 +2505,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
2505 | if (src_file.file->f_path.mnt != file->f_path.mnt) | 2505 | if (src_file.file->f_path.mnt != file->f_path.mnt) |
2506 | goto out_fput; | 2506 | goto out_fput; |
2507 | 2507 | ||
2508 | src = src_file.file->f_dentry->d_inode; | 2508 | src = file_inode(src_file.file); |
2509 | 2509 | ||
2510 | ret = -EINVAL; | 2510 | ret = -EINVAL; |
2511 | if (src == inode) | 2511 | if (src == inode) |
@@ -2867,7 +2867,7 @@ static long btrfs_ioctl_clone_range(struct file *file, void __user *argp) | |||
2867 | */ | 2867 | */ |
2868 | static long btrfs_ioctl_trans_start(struct file *file) | 2868 | static long btrfs_ioctl_trans_start(struct file *file) |
2869 | { | 2869 | { |
2870 | struct inode *inode = fdentry(file)->d_inode; | 2870 | struct inode *inode = file_inode(file); |
2871 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2871 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2872 | struct btrfs_trans_handle *trans; | 2872 | struct btrfs_trans_handle *trans; |
2873 | int ret; | 2873 | int ret; |
@@ -2907,7 +2907,7 @@ out: | |||
2907 | 2907 | ||
2908 | static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) | 2908 | static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) |
2909 | { | 2909 | { |
2910 | struct inode *inode = fdentry(file)->d_inode; | 2910 | struct inode *inode = file_inode(file); |
2911 | struct btrfs_root *root = BTRFS_I(inode)->root; | 2911 | struct btrfs_root *root = BTRFS_I(inode)->root; |
2912 | struct btrfs_root *new_root; | 2912 | struct btrfs_root *new_root; |
2913 | struct btrfs_dir_item *di; | 2913 | struct btrfs_dir_item *di; |
@@ -3131,7 +3131,7 @@ out: | |||
3131 | */ | 3131 | */ |
3132 | long btrfs_ioctl_trans_end(struct file *file) | 3132 | long btrfs_ioctl_trans_end(struct file *file) |
3133 | { | 3133 | { |
3134 | struct inode *inode = fdentry(file)->d_inode; | 3134 | struct inode *inode = file_inode(file); |
3135 | struct btrfs_root *root = BTRFS_I(inode)->root; | 3135 | struct btrfs_root *root = BTRFS_I(inode)->root; |
3136 | struct btrfs_trans_handle *trans; | 3136 | struct btrfs_trans_handle *trans; |
3137 | 3137 | ||
@@ -3193,7 +3193,7 @@ static noinline long btrfs_ioctl_wait_sync(struct btrfs_root *root, | |||
3193 | 3193 | ||
3194 | static long btrfs_ioctl_scrub(struct file *file, void __user *arg) | 3194 | static long btrfs_ioctl_scrub(struct file *file, void __user *arg) |
3195 | { | 3195 | { |
3196 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3196 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3197 | struct btrfs_ioctl_scrub_args *sa; | 3197 | struct btrfs_ioctl_scrub_args *sa; |
3198 | int ret; | 3198 | int ret; |
3199 | 3199 | ||
@@ -3484,7 +3484,7 @@ void update_ioctl_balance_args(struct btrfs_fs_info *fs_info, int lock, | |||
3484 | 3484 | ||
3485 | static long btrfs_ioctl_balance(struct file *file, void __user *arg) | 3485 | static long btrfs_ioctl_balance(struct file *file, void __user *arg) |
3486 | { | 3486 | { |
3487 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3487 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3488 | struct btrfs_fs_info *fs_info = root->fs_info; | 3488 | struct btrfs_fs_info *fs_info = root->fs_info; |
3489 | struct btrfs_ioctl_balance_args *bargs; | 3489 | struct btrfs_ioctl_balance_args *bargs; |
3490 | struct btrfs_balance_control *bctl; | 3490 | struct btrfs_balance_control *bctl; |
@@ -3674,7 +3674,7 @@ out: | |||
3674 | 3674 | ||
3675 | static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) | 3675 | static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) |
3676 | { | 3676 | { |
3677 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3677 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3678 | struct btrfs_ioctl_quota_ctl_args *sa; | 3678 | struct btrfs_ioctl_quota_ctl_args *sa; |
3679 | struct btrfs_trans_handle *trans = NULL; | 3679 | struct btrfs_trans_handle *trans = NULL; |
3680 | int ret; | 3680 | int ret; |
@@ -3733,7 +3733,7 @@ drop_write: | |||
3733 | 3733 | ||
3734 | static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) | 3734 | static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) |
3735 | { | 3735 | { |
3736 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3736 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3737 | struct btrfs_ioctl_qgroup_assign_args *sa; | 3737 | struct btrfs_ioctl_qgroup_assign_args *sa; |
3738 | struct btrfs_trans_handle *trans; | 3738 | struct btrfs_trans_handle *trans; |
3739 | int ret; | 3739 | int ret; |
@@ -3780,7 +3780,7 @@ drop_write: | |||
3780 | 3780 | ||
3781 | static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) | 3781 | static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) |
3782 | { | 3782 | { |
3783 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3783 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3784 | struct btrfs_ioctl_qgroup_create_args *sa; | 3784 | struct btrfs_ioctl_qgroup_create_args *sa; |
3785 | struct btrfs_trans_handle *trans; | 3785 | struct btrfs_trans_handle *trans; |
3786 | int ret; | 3786 | int ret; |
@@ -3831,7 +3831,7 @@ drop_write: | |||
3831 | 3831 | ||
3832 | static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) | 3832 | static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) |
3833 | { | 3833 | { |
3834 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 3834 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
3835 | struct btrfs_ioctl_qgroup_limit_args *sa; | 3835 | struct btrfs_ioctl_qgroup_limit_args *sa; |
3836 | struct btrfs_trans_handle *trans; | 3836 | struct btrfs_trans_handle *trans; |
3837 | int ret; | 3837 | int ret; |
@@ -3881,7 +3881,7 @@ static long btrfs_ioctl_set_received_subvol(struct file *file, | |||
3881 | void __user *arg) | 3881 | void __user *arg) |
3882 | { | 3882 | { |
3883 | struct btrfs_ioctl_received_subvol_args *sa = NULL; | 3883 | struct btrfs_ioctl_received_subvol_args *sa = NULL; |
3884 | struct inode *inode = fdentry(file)->d_inode; | 3884 | struct inode *inode = file_inode(file); |
3885 | struct btrfs_root *root = BTRFS_I(inode)->root; | 3885 | struct btrfs_root *root = BTRFS_I(inode)->root; |
3886 | struct btrfs_root_item *root_item = &root->root_item; | 3886 | struct btrfs_root_item *root_item = &root->root_item; |
3887 | struct btrfs_trans_handle *trans; | 3887 | struct btrfs_trans_handle *trans; |
@@ -4020,7 +4020,7 @@ out_unlock: | |||
4020 | long btrfs_ioctl(struct file *file, unsigned int | 4020 | long btrfs_ioctl(struct file *file, unsigned int |
4021 | cmd, unsigned long arg) | 4021 | cmd, unsigned long arg) |
4022 | { | 4022 | { |
4023 | struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; | 4023 | struct btrfs_root *root = BTRFS_I(file_inode(file))->root; |
4024 | void __user *argp = (void __user *)arg; | 4024 | void __user *argp = (void __user *)arg; |
4025 | 4025 | ||
4026 | switch (cmd) { | 4026 | switch (cmd) { |
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 3ebe87977aae..b67171e6d688 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c | |||
@@ -3505,7 +3505,7 @@ out: | |||
3505 | } | 3505 | } |
3506 | 3506 | ||
3507 | /* | 3507 | /* |
3508 | * hepler to find all tree blocks that reference a given data extent | 3508 | * helper to find all tree blocks that reference a given data extent |
3509 | */ | 3509 | */ |
3510 | static noinline_for_stack | 3510 | static noinline_for_stack |
3511 | int add_data_references(struct reloc_control *rc, | 3511 | int add_data_references(struct reloc_control *rc, |
@@ -3599,7 +3599,7 @@ int add_data_references(struct reloc_control *rc, | |||
3599 | } | 3599 | } |
3600 | 3600 | ||
3601 | /* | 3601 | /* |
3602 | * hepler to find next unprocessed extent | 3602 | * helper to find next unprocessed extent |
3603 | */ | 3603 | */ |
3604 | static noinline_for_stack | 3604 | static noinline_for_stack |
3605 | int find_next_extent(struct btrfs_trans_handle *trans, | 3605 | int find_next_extent(struct btrfs_trans_handle *trans, |
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 68da757615ae..f7a8b861058b 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -4578,7 +4578,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) | |||
4578 | if (!capable(CAP_SYS_ADMIN)) | 4578 | if (!capable(CAP_SYS_ADMIN)) |
4579 | return -EPERM; | 4579 | return -EPERM; |
4580 | 4580 | ||
4581 | send_root = BTRFS_I(fdentry(mnt_file)->d_inode)->root; | 4581 | send_root = BTRFS_I(file_inode(mnt_file))->root; |
4582 | fs_info = send_root->fs_info; | 4582 | fs_info = send_root->fs_info; |
4583 | 4583 | ||
4584 | arg = memdup_user(arg_, sizeof(*arg)); | 4584 | arg = memdup_user(arg_, sizeof(*arg)); |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index fedede1fe178..9250b9c4f01e 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -123,7 +123,6 @@ loop: | |||
123 | * to redo the trans_no_join checks above | 123 | * to redo the trans_no_join checks above |
124 | */ | 124 | */ |
125 | kmem_cache_free(btrfs_transaction_cachep, cur_trans); | 125 | kmem_cache_free(btrfs_transaction_cachep, cur_trans); |
126 | cur_trans = fs_info->running_transaction; | ||
127 | goto loop; | 126 | goto loop; |
128 | } else if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) { | 127 | } else if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) { |
129 | spin_unlock(&fs_info->trans_lock); | 128 | spin_unlock(&fs_info->trans_lock); |