summaryrefslogtreecommitdiffstats
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)
btrfs_wait_ordered_extents(root, 0);
- trans = btrfs_join_transaction_freeze(root);
+ trans = btrfs_attach_transaction(root);
if (IS_ERR(trans)) {
- /* Frozen, don't bother */
- if (PTR_ERR(trans) == -EPERM)
+ /* no transaction, don't bother */
+ if (PTR_ERR(trans) == -ENOENT)
return 0;
return PTR_ERR(trans);
}
@@ -1511,7 +1511,17 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
static int btrfs_freeze(struct super_block *sb)
{
- return 0;
+ struct btrfs_trans_handle *trans;
+ struct btrfs_root *root = btrfs_sb(sb)->tree_root;
+
+ trans = btrfs_attach_transaction(root);
+ if (IS_ERR(trans)) {
+ /* no transaction, don't bother */
+ if (PTR_ERR(trans) == -ENOENT)
+ return 0;
+ return PTR_ERR(trans);
+ }
+ return btrfs_commit_transaction(trans, root);
}
static int btrfs_unfreeze(struct super_block *sb)