$(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $<
-all: $(progs)
+all: version $(progs)
+
+version:
+ bash version.sh
btrfsctl: $(objects) btrfsctl.o
gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS)
#include "transaction.h"
#include "utils.h"
#include "volumes.h"
+#include "version.h"
static int uuid_search(struct btrfs_fs_devices *fs_devices, char *search)
{
static void print_usage(void)
{
fprintf(stderr, "usage: btrfs-show [search label or device]\n");
+ fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
exit(1);
}
continue;
print_one_uuid(fs_devices);
}
+ printf("%s\n", BTRFS_BUILD_VERSION);
return 0;
}
#include "print-tree.h"
#include "transaction.h"
#include "list.h"
+#include "version.h"
static u64 bytes_used = 0;
static u64 total_csum_bytes = 0;
void print_usage(void) {
fprintf(stderr, "usage: btrfsck dev\n");
+ fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
exit(1);
}
printf("file data blocks allocated: %llu\n referenced %llu\n",
(unsigned long long)data_bytes_allocated,
(unsigned long long)data_bytes_referenced);
+ printf("%s\n", BTRFS_BUILD_VERSION);
return ret;
}
#include "ctree.h"
#include "transaction.h"
#include "utils.h"
+#include "version.h"
#ifdef __CHECKER__
#define BLKGETSIZE64 0
printf("\t-A device scans the device for a Btrfs filesystem\n");
printf("\t-a scans all devices for Btrfs filesystems\n");
printf("\t-c forces a single FS sync\n");
+ printf("%s\n", BTRFS_BUILD_VERSION);
exit(1);
}
perror("ioctl:");
exit(1);
}
- printf("ioctl returns %d\n", ret);
- return 0;
+ if (ret == 0) {
+ printf("operation complete\n");
+ } else {
+ printf("ioctl failed with error %d\n", ret);
+ }
+ printf("%s\n", BTRFS_BUILD_VERSION);
+ if (ret)
+ exit(0);
+ else
+ exit(1);
}
#include "disk-io.h"
#include "print-tree.h"
#include "transaction.h"
+#include "version.h"
static int print_usage(void)
{
fprintf(stderr, "usage: debug-tree [ -e ] device\n");
+ fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
exit(1);
}
uuidbuf[36] = '\0';
uuid_unparse(root->fs_info->super_copy.fsid, uuidbuf);
printf("uuid %s\n", uuidbuf);
+ printf("%s\n", BTRFS_BUILD_VERSION);
return 0;
}
#include "volumes.h"
#include "transaction.h"
#include "utils.h"
+#include "version.h"
static u64 parse_size(char *s)
{
fprintf(stderr, "\t -l --leafsize size of btree leaves\n");
fprintf(stderr, "\t -n --nodesize size of btree leaves\n");
fprintf(stderr, "\t -s --sectorsize min block allocation\n");
+ fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
exit(1);
}
label, first_file, nodesize, leafsize, sectorsize,
pretty_sizes(btrfs_super_total_bytes(&root->fs_info->super_copy)));
+ printf("%s\n", BTRFS_BUILD_VERSION);
btrfs_commit_transaction(trans, root);
ret = close_ctree(root);
BUG_ON(ret);