aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2013-12-16 11:34:10 -0500
committerChris Mason <clm@fb.com>2014-01-28 16:20:00 -0500
commit95bc79d50d0ec20c0cdb071629dc3f276a053782 (patch)
tree9dd07d9dd1a9637c5b72a511913e621fda3534af /fs/btrfs
parent3fe81ce206f3805e0eb5d886aabbf91064655144 (diff)
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: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/send.c58
1 files changed, 8 insertions, 50 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 1896e394d59f..8230d11f2cca 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -344,16 +344,6 @@ out:
344 return ret; 344 return ret;
345} 345}
346 346
347#if 0
348static void fs_path_remove(struct fs_path *p)
349{
350 BUG_ON(p->reversed);
351 while (p->start != p->end && *p->end != '/')
352 p->end--;
353 *p->end = 0;
354}
355#endif
356
357static int fs_path_copy(struct fs_path *p, struct fs_path *from) 347static int fs_path_copy(struct fs_path *p, struct fs_path *from)
358{ 348{
359 int ret; 349 int ret;
@@ -444,30 +434,15 @@ static int tlv_put(struct send_ctx *sctx, u16 attr, const void *data, int len)
444 return 0; 434 return 0;
445} 435}
446 436
447#if 0 437#define TLV_PUT_DEFINE_INT(bits) \
448static int tlv_put_u8(struct send_ctx *sctx, u16 attr, u8 value) 438 static int tlv_put_u##bits(struct send_ctx *sctx, \
449{ 439 u##bits attr, u##bits value) \
450 return tlv_put(sctx, attr, &value, sizeof(value)); 440 { \
451} 441 __le##bits __tmp = cpu_to_le##bits(value); \
452 442 return tlv_put(sctx, attr, &__tmp, sizeof(__tmp)); \
453static int tlv_put_u16(struct send_ctx *sctx, u16 attr, u16 value) 443 }
454{
455 __le16 tmp = cpu_to_le16(value);
456 return tlv_put(sctx, attr, &tmp, sizeof(tmp));
457}
458
459static int tlv_put_u32(struct send_ctx *sctx, u16 attr, u32 value)
460{
461 __le32 tmp = cpu_to_le32(value);
462 return tlv_put(sctx, attr, &tmp, sizeof(tmp));
463}
464#endif
465 444
466static int tlv_put_u64(struct send_ctx *sctx, u16 attr, u64 value) 445TLV_PUT_DEFINE_INT(64)
467{
468 __le64 tmp = cpu_to_le64(value);
469 return tlv_put(sctx, attr, &tmp, sizeof(tmp));
470}
471 446
472static int tlv_put_string(struct send_ctx *sctx, u16 attr, 447static int tlv_put_string(struct send_ctx *sctx, u16 attr,
473 const char *str, int len) 448 const char *str, int len)
@@ -483,17 +458,6 @@ static int tlv_put_uuid(struct send_ctx *sctx, u16 attr,
483 return tlv_put(sctx, attr, uuid, BTRFS_UUID_SIZE); 458 return tlv_put(sctx, attr, uuid, BTRFS_UUID_SIZE);
484} 459}
485 460
486#if 0
487static int tlv_put_timespec(struct send_ctx *sctx, u16 attr,
488 struct timespec *ts)
489{
490 struct btrfs_timespec bts;
491 bts.sec = cpu_to_le64(ts->tv_sec);
492 bts.nsec = cpu_to_le32(ts->tv_nsec);
493 return tlv_put(sctx, attr, &bts, sizeof(bts));
494}
495#endif
496
497static int tlv_put_btrfs_timespec(struct send_ctx *sctx, u16 attr, 461static int tlv_put_btrfs_timespec(struct send_ctx *sctx, u16 attr,
498 struct extent_buffer *eb, 462 struct extent_buffer *eb,
499 struct btrfs_timespec *ts) 463 struct btrfs_timespec *ts)
@@ -541,12 +505,6 @@ static int tlv_put_btrfs_timespec(struct send_ctx *sctx, u16 attr,
541 if (ret < 0) \ 505 if (ret < 0) \
542 goto tlv_put_failure; \ 506 goto tlv_put_failure; \
543 } while (0) 507 } while (0)
544#define TLV_PUT_TIMESPEC(sctx, attrtype, ts) \
545 do { \
546 ret = tlv_put_timespec(sctx, attrtype, ts); \
547 if (ret < 0) \
548 goto tlv_put_failure; \
549 } while (0)
550#define TLV_PUT_BTRFS_TIMESPEC(sctx, attrtype, eb, ts) \ 508#define TLV_PUT_BTRFS_TIMESPEC(sctx, attrtype, eb, ts) \
551 do { \ 509 do { \
552 ret = tlv_put_btrfs_timespec(sctx, attrtype, eb, ts); \ 510 ret = tlv_put_btrfs_timespec(sctx, attrtype, eb, ts); \