Commit 49f34d1f authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Make btrfs_del_dir_entries_in_log take btrfs_inode

Signed-off-by: default avatarNikolay Borisov <n.borisov.lkml@gmail.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9ca5fbfb
...@@ -4060,7 +4060,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, ...@@ -4060,7 +4060,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans,
} }
ret = btrfs_del_dir_entries_in_log(trans, root, name, name_len, ret = btrfs_del_dir_entries_in_log(trans, root, name, name_len,
dir, index); BTRFS_I(dir), index);
if (ret == -ENOENT) if (ret == -ENOENT)
ret = 0; ret = 0;
else if (ret) else if (ret)
......
...@@ -3084,7 +3084,7 @@ int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans, ...@@ -3084,7 +3084,7 @@ int btrfs_free_log_root_tree(struct btrfs_trans_handle *trans,
int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
const char *name, int name_len, const char *name, int name_len,
struct inode *dir, u64 index) struct btrfs_inode *dir, u64 index)
{ {
struct btrfs_root *log; struct btrfs_root *log;
struct btrfs_dir_item *di; struct btrfs_dir_item *di;
...@@ -3092,16 +3092,16 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, ...@@ -3092,16 +3092,16 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
int ret; int ret;
int err = 0; int err = 0;
int bytes_del = 0; int bytes_del = 0;
u64 dir_ino = btrfs_ino(BTRFS_I(dir)); u64 dir_ino = btrfs_ino(dir);
if (BTRFS_I(dir)->logged_trans < trans->transid) if (dir->logged_trans < trans->transid)
return 0; return 0;
ret = join_running_log_trans(root); ret = join_running_log_trans(root);
if (ret) if (ret)
return 0; return 0;
mutex_lock(&BTRFS_I(dir)->log_mutex); mutex_lock(&dir->log_mutex);
log = root->log_root; log = root->log_root;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
...@@ -3176,7 +3176,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, ...@@ -3176,7 +3176,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
fail: fail:
btrfs_free_path(path); btrfs_free_path(path);
out_unlock: out_unlock:
mutex_unlock(&BTRFS_I(dir)->log_mutex); mutex_unlock(&dir->log_mutex);
if (ret == -ENOSPC) { if (ret == -ENOSPC) {
btrfs_set_log_full_commit(root->fs_info, trans); btrfs_set_log_full_commit(root->fs_info, trans);
ret = 0; ret = 0;
......
...@@ -72,7 +72,7 @@ int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans, ...@@ -72,7 +72,7 @@ int btrfs_log_dentry_safe(struct btrfs_trans_handle *trans,
int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
const char *name, int name_len, const char *name, int name_len,
struct inode *dir, u64 index); struct btrfs_inode *dir, u64 index);
int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
const char *name, int name_len, const char *name, int name_len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment