Skip to content

Commit 3e6041a

Browse files
committed
Added a littlefs-fuse specific version number
Previously this was fixed to the underlying littlefs core version, but that state of things doesn't work if you ever want new features in littelfs-fuse outside of littlefs minor releases. This currently matches the underlying core minor version, to tie things together, but will fall out of sync as things are updated.
1 parent ed22353 commit 3e6041a

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

lfs_fuse.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@
2525
#include <errno.h>
2626

2727

28+
// littefs-fuse version
29+
//
30+
// Note this is different from the littlefs core version, and littlefs
31+
// on-disk version
32+
//
33+
// Major (top-nibble), incremented on backwards incompatible changes
34+
// Minor (bottom-nibble), incremented on feature additions
35+
#define LFS_FUSE_VERSION 0x00020006
36+
#define LFS_FUSE_VERSION_MAJOR (0xffff & (LFS_FUSE_VERSION >> 16))
37+
#define LFS_FUSE_VERSION_MINOR (0xffff & (LFS_FUSE_VERSION >> 0))
38+
39+
2840
// config and other state
2941
static struct lfs_config config = {0};
3042
static const char *device = NULL;
@@ -467,10 +479,12 @@ int lfs_fuse_opt_proc(void *data, const char *arg,
467479
exit(1);
468480

469481
case KEY_VERSION:
482+
fprintf(stderr, "littlefs-fuse version: v%d.%d\n",
483+
LFS_FUSE_VERSION_MAJOR, LFS_FUSE_VERSION_MINOR);
470484
fprintf(stderr, "littlefs version: v%d.%d\n",
471-
LFS_VERSION_MAJOR, LFS_VERSION_MINOR);
485+
LFS_VERSION_MAJOR, LFS_VERSION_MINOR);
472486
fprintf(stderr, "littlefs disk version: v%d.%d\n",
473-
LFS_DISK_VERSION_MAJOR, LFS_DISK_VERSION_MINOR);
487+
LFS_DISK_VERSION_MAJOR, LFS_DISK_VERSION_MINOR);
474488
fuse_opt_add_arg(args, "--version");
475489
fuse_main(args->argc, args->argv, &lfs_fuse_ops, NULL);
476490
exit(0);

0 commit comments

Comments
 (0)