Skip to content

Commit

Permalink
btrfs: Remove unused arguments in tree-log.c
Browse files Browse the repository at this point in the history
Following arguments are not used in tree-log.c:
 insert_one_name(): path, type
 wait_log_commit(): trans
 wait_for_writer(): trans

This patch remove them.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
Zhaolei authored and Chris Mason committed Aug 19, 2015
1 parent 34eb2a5 commit 60d53eb
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,9 +1540,8 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
*/
static noinline int insert_one_name(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_path *path,
u64 dirid, u64 index,
char *name, int name_len, u8 type,
char *name, int name_len,
struct btrfs_key *location)
{
struct inode *inode;
Expand Down Expand Up @@ -1716,8 +1715,8 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans,
goto out;
}
btrfs_release_path(path);
ret = insert_one_name(trans, root, path, key->objectid, key->offset,
name, name_len, log_type, &log_key);
ret = insert_one_name(trans, root, key->objectid, key->offset,
name, name_len, &log_key);
if (ret && ret != -ENOENT && ret != -EEXIST)
goto out;
if (!ret)
Expand Down Expand Up @@ -2582,8 +2581,7 @@ static int update_log_root(struct btrfs_trans_handle *trans,
return ret;
}

static void wait_log_commit(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int transid)
static void wait_log_commit(struct btrfs_root *root, int transid)
{
DEFINE_WAIT(wait);
int index = transid % 2;
Expand All @@ -2608,8 +2606,7 @@ static void wait_log_commit(struct btrfs_trans_handle *trans,
atomic_read(&root->log_commit[index]));
}

static void wait_for_writer(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
static void wait_for_writer(struct btrfs_root *root)
{
DEFINE_WAIT(wait);

Expand Down Expand Up @@ -2689,7 +2686,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,

index1 = log_transid % 2;
if (atomic_read(&root->log_commit[index1])) {
wait_log_commit(trans, root, log_transid);
wait_log_commit(root, log_transid);
mutex_unlock(&root->log_mutex);
return ctx->log_ret;
}
Expand All @@ -2698,7 +2695,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,

/* wait for previous tree log sync to complete */
if (atomic_read(&root->log_commit[(index1 + 1) % 2]))
wait_log_commit(trans, root, log_transid - 1);
wait_log_commit(root, log_transid - 1);

while (1) {
int batch = atomic_read(&root->log_batch);
Expand All @@ -2709,7 +2706,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
schedule_timeout_uninterruptible(1);
mutex_lock(&root->log_mutex);
}
wait_for_writer(trans, root);
wait_for_writer(root);
if (batch == atomic_read(&root->log_batch))
break;
}
Expand Down Expand Up @@ -2806,7 +2803,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
ret = btrfs_wait_marked_extents(log, &log->dirty_log_pages,
mark);
btrfs_wait_logged_extents(trans, log, log_transid);
wait_log_commit(trans, log_root_tree,
wait_log_commit(log_root_tree,
root_log_ctx.log_transid);
mutex_unlock(&log_root_tree->log_mutex);
if (!ret)
Expand All @@ -2817,11 +2814,11 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
atomic_set(&log_root_tree->log_commit[index2], 1);

if (atomic_read(&log_root_tree->log_commit[(index2 + 1) % 2])) {
wait_log_commit(trans, log_root_tree,
wait_log_commit(log_root_tree,
root_log_ctx.log_transid - 1);
}

wait_for_writer(trans, log_root_tree);
wait_for_writer(log_root_tree);

/*
* now that we've moved on to the tree of log tree roots,
Expand Down

0 comments on commit 60d53eb

Please sign in to comment.