diff options
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b0134892dc70..a6d8efa46bfe 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -3537,20 +3537,6 @@ out: | |||
3537 | return ret; | 3537 | return ret; |
3538 | } | 3538 | } |
3539 | 3539 | ||
3540 | static long btrfs_ioctl_global_rsv(struct btrfs_root *root, void __user *arg) | ||
3541 | { | ||
3542 | struct btrfs_block_rsv *block_rsv = &root->fs_info->global_block_rsv; | ||
3543 | u64 reserved; | ||
3544 | |||
3545 | spin_lock(&block_rsv->lock); | ||
3546 | reserved = block_rsv->reserved; | ||
3547 | spin_unlock(&block_rsv->lock); | ||
3548 | |||
3549 | if (arg && copy_to_user(arg, &reserved, sizeof(reserved))) | ||
3550 | return -EFAULT; | ||
3551 | return 0; | ||
3552 | } | ||
3553 | |||
3554 | /* | 3540 | /* |
3555 | * there are many ways the trans_start and trans_end ioctls can lead | 3541 | * there are many ways the trans_start and trans_end ioctls can lead |
3556 | * to deadlocks. They should only be used by applications that | 3542 | * to deadlocks. They should only be used by applications that |
@@ -4525,7 +4511,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg) | |||
4525 | spin_lock(&root->fs_info->super_lock); | 4511 | spin_lock(&root->fs_info->super_lock); |
4526 | strcpy(super_block->label, label); | 4512 | strcpy(super_block->label, label); |
4527 | spin_unlock(&root->fs_info->super_lock); | 4513 | spin_unlock(&root->fs_info->super_lock); |
4528 | ret = btrfs_end_transaction(trans, root); | 4514 | ret = btrfs_commit_transaction(trans, root); |
4529 | 4515 | ||
4530 | out_unlock: | 4516 | out_unlock: |
4531 | mnt_drop_write_file(file); | 4517 | mnt_drop_write_file(file); |
@@ -4668,7 +4654,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg) | |||
4668 | if (ret) | 4654 | if (ret) |
4669 | return ret; | 4655 | return ret; |
4670 | 4656 | ||
4671 | trans = btrfs_start_transaction(root, 1); | 4657 | trans = btrfs_start_transaction(root, 0); |
4672 | if (IS_ERR(trans)) | 4658 | if (IS_ERR(trans)) |
4673 | return PTR_ERR(trans); | 4659 | return PTR_ERR(trans); |
4674 | 4660 | ||
@@ -4689,7 +4675,7 @@ static int btrfs_ioctl_set_features(struct file *file, void __user *arg) | |||
4689 | btrfs_set_super_incompat_flags(super_block, newflags); | 4675 | btrfs_set_super_incompat_flags(super_block, newflags); |
4690 | spin_unlock(&root->fs_info->super_lock); | 4676 | spin_unlock(&root->fs_info->super_lock); |
4691 | 4677 | ||
4692 | return btrfs_end_transaction(trans, root); | 4678 | return btrfs_commit_transaction(trans, root); |
4693 | } | 4679 | } |
4694 | 4680 | ||
4695 | long btrfs_ioctl(struct file *file, unsigned int | 4681 | long btrfs_ioctl(struct file *file, unsigned int |
@@ -4757,8 +4743,6 @@ long btrfs_ioctl(struct file *file, unsigned int | |||
4757 | return btrfs_ioctl_logical_to_ino(root, argp); | 4743 | return btrfs_ioctl_logical_to_ino(root, argp); |
4758 | case BTRFS_IOC_SPACE_INFO: | 4744 | case BTRFS_IOC_SPACE_INFO: |
4759 | return btrfs_ioctl_space_info(root, argp); | 4745 | return btrfs_ioctl_space_info(root, argp); |
4760 | case BTRFS_IOC_GLOBAL_RSV: | ||
4761 | return btrfs_ioctl_global_rsv(root, argp); | ||
4762 | case BTRFS_IOC_SYNC: { | 4746 | case BTRFS_IOC_SYNC: { |
4763 | int ret; | 4747 | int ret; |
4764 | 4748 | ||