Commit 95bc79d5 authored by David Sterba's avatar David Sterba Committed by Chris Mason

btrfs: send: clean up dead code

Remove ifdefed code:

- tlv_put for 8, 16 and 32, add a generic tempalte if needed in future
- tlv_put_timespec - the btrfs_timespec fields are used
- fs_path_remove obsoleted long ago
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 3fe81ce2
...@@ -344,16 +344,6 @@ static int fs_path_add_from_extent_buffer(struct fs_path *p, ...@@ -344,16 +344,6 @@ static int fs_path_add_from_extent_buffer(struct fs_path *p,
return ret; return ret;
} }
#if 0
static void fs_path_remove(struct fs_path *p)
{
BUG_ON(p->reversed);
while (p->start != p->end && *p->end != '/')
p->end--;
*p->end = 0;
}
#endif
static int fs_path_copy(struct fs_path *p, struct fs_path *from) static int fs_path_copy(struct fs_path *p, struct fs_path *from)
{ {
int ret; int ret;
...@@ -444,30 +434,15 @@ static int tlv_put(struct send_ctx *sctx, u16 attr, const void *data, int len) ...@@ -444,30 +434,15 @@ static int tlv_put(struct send_ctx *sctx, u16 attr, const void *data, int len)
return 0; return 0;
} }
#if 0 #define TLV_PUT_DEFINE_INT(bits) \
static int tlv_put_u8(struct send_ctx *sctx, u16 attr, u8 value) static int tlv_put_u##bits(struct send_ctx *sctx, \
{ u##bits attr, u##bits value) \
return tlv_put(sctx, attr, &value, sizeof(value)); { \
} __le##bits __tmp = cpu_to_le##bits(value); \
return tlv_put(sctx, attr, &__tmp, sizeof(__tmp)); \
static int tlv_put_u16(struct send_ctx *sctx, u16 attr, u16 value) }
{
__le16 tmp = cpu_to_le16(value);
return tlv_put(sctx, attr, &tmp, sizeof(tmp));
}
static int tlv_put_u32(struct send_ctx *sctx, u16 attr, u32 value)
{
__le32 tmp = cpu_to_le32(value);
return tlv_put(sctx, attr, &tmp, sizeof(tmp));
}
#endif
static int tlv_put_u64(struct send_ctx *sctx, u16 attr, u64 value) TLV_PUT_DEFINE_INT(64)
{
__le64 tmp = cpu_to_le64(value);
return tlv_put(sctx, attr, &tmp, sizeof(tmp));
}
static int tlv_put_string(struct send_ctx *sctx, u16 attr, static int tlv_put_string(struct send_ctx *sctx, u16 attr,
const char *str, int len) const char *str, int len)
...@@ -483,17 +458,6 @@ static int tlv_put_uuid(struct send_ctx *sctx, u16 attr, ...@@ -483,17 +458,6 @@ static int tlv_put_uuid(struct send_ctx *sctx, u16 attr,
return tlv_put(sctx, attr, uuid, BTRFS_UUID_SIZE); return tlv_put(sctx, attr, uuid, BTRFS_UUID_SIZE);
} }
#if 0
static int tlv_put_timespec(struct send_ctx *sctx, u16 attr,
struct timespec *ts)
{
struct btrfs_timespec bts;
bts.sec = cpu_to_le64(ts->tv_sec);
bts.nsec = cpu_to_le32(ts->tv_nsec);
return tlv_put(sctx, attr, &bts, sizeof(bts));
}
#endif
static int tlv_put_btrfs_timespec(struct send_ctx *sctx, u16 attr, static int tlv_put_btrfs_timespec(struct send_ctx *sctx, u16 attr,
struct extent_buffer *eb, struct extent_buffer *eb,
struct btrfs_timespec *ts) struct btrfs_timespec *ts)
...@@ -541,12 +505,6 @@ static int tlv_put_btrfs_timespec(struct send_ctx *sctx, u16 attr, ...@@ -541,12 +505,6 @@ static int tlv_put_btrfs_timespec(struct send_ctx *sctx, u16 attr,
if (ret < 0) \ if (ret < 0) \
goto tlv_put_failure; \ goto tlv_put_failure; \
} while (0) } while (0)
#define TLV_PUT_TIMESPEC(sctx, attrtype, ts) \
do { \
ret = tlv_put_timespec(sctx, attrtype, ts); \
if (ret < 0) \
goto tlv_put_failure; \
} while (0)
#define TLV_PUT_BTRFS_TIMESPEC(sctx, attrtype, eb, ts) \ #define TLV_PUT_BTRFS_TIMESPEC(sctx, attrtype, eb, ts) \
do { \ do { \
ret = tlv_put_btrfs_timespec(sctx, attrtype, eb, ts); \ ret = tlv_put_btrfs_timespec(sctx, attrtype, eb, ts); \
......
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