aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index fb260bbf59c..f8b803f30ed 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -854,10 +854,10 @@ int btrfs_sync_fs(struct super_block *sb, int wait)
854 854
855 btrfs_wait_ordered_extents(root, 0); 855 btrfs_wait_ordered_extents(root, 0);
856 856
857 trans = btrfs_join_transaction_freeze(root); 857 trans = btrfs_attach_transaction(root);
858 if (IS_ERR(trans)) { 858 if (IS_ERR(trans)) {
859 /* Frozen, don't bother */ 859 /* no transaction, don't bother */
860 if (PTR_ERR(trans) == -EPERM) 860 if (PTR_ERR(trans) == -ENOENT)
861 return 0; 861 return 0;
862 return PTR_ERR(trans); 862 return PTR_ERR(trans);
863 } 863 }
@@ -1511,7 +1511,17 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
1511 1511
1512static int btrfs_freeze(struct super_block *sb) 1512static int btrfs_freeze(struct super_block *sb)
1513{ 1513{
1514 return 0; 1514 struct btrfs_trans_handle *trans;
1515 struct btrfs_root *root = btrfs_sb(sb)->tree_root;
1516
1517 trans = btrfs_attach_transaction(root);
1518 if (IS_ERR(trans)) {
1519 /* no transaction, don't bother */
1520 if (PTR_ERR(trans) == -ENOENT)
1521 return 0;
1522 return PTR_ERR(trans);
1523 }
1524 return btrfs_commit_transaction(trans, root);
1515} 1525}
1516 1526
1517static int btrfs_unfreeze(struct super_block *sb) 1527static int btrfs_unfreeze(struct super_block *sb)