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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index c260fcad17b3..9fd87f5edbc9 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -49,6 +49,7 @@ static void btrfs_read_locked_inode(struct inode *inode)
49 ret = btrfs_lookup_inode(NULL, root, path, inode->i_ino, 0); 49 ret = btrfs_lookup_inode(NULL, root, path, inode->i_ino, 0);
50 if (ret) { 50 if (ret) {
51 btrfs_release_path(root, path); 51 btrfs_release_path(root, path);
52 btrfs_free_path(path);
52 mutex_unlock(&root->fs_info->fs_mutex); 53 mutex_unlock(&root->fs_info->fs_mutex);
53 make_bad_inode(inode); 54 make_bad_inode(inode);
54 return; 55 return;
@@ -215,7 +216,6 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
215 goto out; 216 goto out;
216 } 217 }
217 btrfs_release_path(root, path); 218 btrfs_release_path(root, path);
218 btrfs_free_path(path);
219 219
220 /* now the directory is empty */ 220 /* now the directory is empty */
221 err = btrfs_unlink_trans(trans, root, dir, dentry); 221 err = btrfs_unlink_trans(trans, root, dir, dentry);
@@ -223,6 +223,8 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
223 inode->i_size = 0; 223 inode->i_size = 0;
224 } 224 }
225out: 225out:
226 btrfs_release_path(root, path);
227 btrfs_free_path(path);
226 mutex_unlock(&root->fs_info->fs_mutex); 228 mutex_unlock(&root->fs_info->fs_mutex);
227 ret = btrfs_end_transaction(trans, root); 229 ret = btrfs_end_transaction(trans, root);
228 if (ret && !err) 230 if (ret && !err)
@@ -800,11 +802,10 @@ static int btrfs_sync_fs(struct super_block *sb, int wait)
800 802
801 sb->s_dirt = 0; 803 sb->s_dirt = 0;
802 if (!wait) { 804 if (!wait) {
803 // filemap_flush(root->fs_info->btree_inode->i_mapping); 805 filemap_flush(root->fs_info->btree_inode->i_mapping);
804 filemap_flush(root->fs_info->sb->s_bdev->bd_inode->i_mapping);
805 return 0; 806 return 0;
806 } 807 }
807 filemap_write_and_wait(root->fs_info->sb->s_bdev->bd_inode->i_mapping); 808 filemap_write_and_wait(root->fs_info->btree_inode->i_mapping);
808 mutex_lock(&root->fs_info->fs_mutex); 809 mutex_lock(&root->fs_info->fs_mutex);
809 trans = btrfs_start_transaction(root, 1); 810 trans = btrfs_start_transaction(root, 1);
810 ret = btrfs_commit_transaction(trans, root); 811 ret = btrfs_commit_transaction(trans, root);