Commit b1dea4e7 authored by Omar Sandoval's avatar Omar Sandoval Committed by David Sterba

btrfs: send: remove unused type parameter to iterate_inode_ref_t

Again, I don't think this was ever used since iterate_dir_item() is only
used for xattrs. No functional change.
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent eab67c06
...@@ -1002,7 +1002,7 @@ static int iterate_inode_ref(struct btrfs_root *root, struct btrfs_path *path, ...@@ -1002,7 +1002,7 @@ static int iterate_inode_ref(struct btrfs_root *root, struct btrfs_path *path,
typedef int (*iterate_dir_item_t)(int num, struct btrfs_key *di_key, typedef int (*iterate_dir_item_t)(int num, struct btrfs_key *di_key,
const char *name, int name_len, const char *name, int name_len,
const char *data, int data_len, const char *data, int data_len,
u8 type, void *ctx); void *ctx);
/* /*
* Helper function to iterate the entries in ONE btrfs_dir_item. * Helper function to iterate the entries in ONE btrfs_dir_item.
...@@ -1027,7 +1027,6 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path, ...@@ -1027,7 +1027,6 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path,
u32 total; u32 total;
int slot; int slot;
int num; int num;
u8 type;
/* /*
* Start with a small buffer (1 page). If later we end up needing more * Start with a small buffer (1 page). If later we end up needing more
...@@ -1053,10 +1052,9 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path, ...@@ -1053,10 +1052,9 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path,
while (cur < total) { while (cur < total) {
name_len = btrfs_dir_name_len(eb, di); name_len = btrfs_dir_name_len(eb, di);
data_len = btrfs_dir_data_len(eb, di); data_len = btrfs_dir_data_len(eb, di);
type = btrfs_dir_type(eb, di);
btrfs_dir_item_key_to_cpu(eb, di, &di_key); btrfs_dir_item_key_to_cpu(eb, di, &di_key);
if (type == BTRFS_FT_XATTR) { if (btrfs_dir_type(eb, di) == BTRFS_FT_XATTR) {
if (name_len > XATTR_NAME_MAX) { if (name_len > XATTR_NAME_MAX) {
ret = -ENAMETOOLONG; ret = -ENAMETOOLONG;
goto out; goto out;
...@@ -1106,7 +1104,7 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path, ...@@ -1106,7 +1104,7 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path,
cur += len; cur += len;
ret = iterate(num, &di_key, buf, name_len, buf + name_len, ret = iterate(num, &di_key, buf, name_len, buf + name_len,
data_len, type, ctx); data_len, ctx);
if (ret < 0) if (ret < 0)
goto out; goto out;
if (ret) { if (ret) {
...@@ -4643,9 +4641,8 @@ static int send_remove_xattr(struct send_ctx *sctx, ...@@ -4643,9 +4641,8 @@ static int send_remove_xattr(struct send_ctx *sctx,
} }
static int __process_new_xattr(int num, struct btrfs_key *di_key, static int __process_new_xattr(int num, struct btrfs_key *di_key,
const char *name, int name_len, const char *name, int name_len, const char *data,
const char *data, int data_len, int data_len, void *ctx)
u8 type, void *ctx)
{ {
int ret; int ret;
struct send_ctx *sctx = ctx; struct send_ctx *sctx = ctx;
...@@ -4689,8 +4686,7 @@ static int __process_new_xattr(int num, struct btrfs_key *di_key, ...@@ -4689,8 +4686,7 @@ static int __process_new_xattr(int num, struct btrfs_key *di_key,
static int __process_deleted_xattr(int num, struct btrfs_key *di_key, static int __process_deleted_xattr(int num, struct btrfs_key *di_key,
const char *name, int name_len, const char *name, int name_len,
const char *data, int data_len, const char *data, int data_len, void *ctx)
u8 type, void *ctx)
{ {
int ret; int ret;
struct send_ctx *sctx = ctx; struct send_ctx *sctx = ctx;
...@@ -4735,10 +4731,8 @@ struct find_xattr_ctx { ...@@ -4735,10 +4731,8 @@ struct find_xattr_ctx {
int found_data_len; int found_data_len;
}; };
static int __find_xattr(int num, struct btrfs_key *di_key, static int __find_xattr(int num, struct btrfs_key *di_key, const char *name,
const char *name, int name_len, int name_len, const char *data, int data_len, void *vctx)
const char *data, int data_len,
u8 type, void *vctx)
{ {
struct find_xattr_ctx *ctx = vctx; struct find_xattr_ctx *ctx = vctx;
...@@ -4788,7 +4782,7 @@ static int find_xattr(struct btrfs_root *root, ...@@ -4788,7 +4782,7 @@ static int find_xattr(struct btrfs_root *root,
static int __process_changed_new_xattr(int num, struct btrfs_key *di_key, static int __process_changed_new_xattr(int num, struct btrfs_key *di_key,
const char *name, int name_len, const char *name, int name_len,
const char *data, int data_len, const char *data, int data_len,
u8 type, void *ctx) void *ctx)
{ {
int ret; int ret;
struct send_ctx *sctx = ctx; struct send_ctx *sctx = ctx;
...@@ -4800,12 +4794,12 @@ static int __process_changed_new_xattr(int num, struct btrfs_key *di_key, ...@@ -4800,12 +4794,12 @@ static int __process_changed_new_xattr(int num, struct btrfs_key *di_key,
&found_data_len); &found_data_len);
if (ret == -ENOENT) { if (ret == -ENOENT) {
ret = __process_new_xattr(num, di_key, name, name_len, data, ret = __process_new_xattr(num, di_key, name, name_len, data,
data_len, type, ctx); data_len, ctx);
} else if (ret >= 0) { } else if (ret >= 0) {
if (data_len != found_data_len || if (data_len != found_data_len ||
memcmp(data, found_data, data_len)) { memcmp(data, found_data, data_len)) {
ret = __process_new_xattr(num, di_key, name, name_len, ret = __process_new_xattr(num, di_key, name, name_len,
data, data_len, type, ctx); data, data_len, ctx);
} else { } else {
ret = 0; ret = 0;
} }
...@@ -4818,7 +4812,7 @@ static int __process_changed_new_xattr(int num, struct btrfs_key *di_key, ...@@ -4818,7 +4812,7 @@ static int __process_changed_new_xattr(int num, struct btrfs_key *di_key,
static int __process_changed_deleted_xattr(int num, struct btrfs_key *di_key, static int __process_changed_deleted_xattr(int num, struct btrfs_key *di_key,
const char *name, int name_len, const char *name, int name_len,
const char *data, int data_len, const char *data, int data_len,
u8 type, void *ctx) void *ctx)
{ {
int ret; int ret;
struct send_ctx *sctx = ctx; struct send_ctx *sctx = ctx;
...@@ -4827,7 +4821,7 @@ static int __process_changed_deleted_xattr(int num, struct btrfs_key *di_key, ...@@ -4827,7 +4821,7 @@ static int __process_changed_deleted_xattr(int num, struct btrfs_key *di_key,
name, name_len, NULL, NULL); name, name_len, NULL, NULL);
if (ret == -ENOENT) if (ret == -ENOENT)
ret = __process_deleted_xattr(num, di_key, name, name_len, data, ret = __process_deleted_xattr(num, di_key, name, name_len, data,
data_len, type, ctx); data_len, ctx);
else if (ret >= 0) else if (ret >= 0)
ret = 0; ret = 0;
......
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