Skip to content

Commit 7573df5

Browse files
osandovkdave
authored andcommitted
btrfs: sysfs: export supported send stream version
This reports the latest send stream version supported by the kernel as the feature in /sys/fs/btrfs/features/send_stream_version . Signed-off-by: Omar Sandoval <osandov@fb.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent c9a949a commit 7573df5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎fs/btrfs/sysfs.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "ctree.h"
1515
#include "discard.h"
1616
#include "disk-io.h"
17+
#include "send.h"
1718
#include "transaction.h"
1819
#include "sysfs.h"
1920
#include "volumes.h"
@@ -321,9 +322,17 @@ static ssize_t supported_checksums_show(struct kobject *kobj,
321322
}
322323
BTRFS_ATTR(static_feature, supported_checksums, supported_checksums_show);
323324

325+
static ssize_t send_stream_version_show(struct kobject *kobj,
326+
struct kobj_attribute *ka, char *buf)
327+
{
328+
return snprintf(buf, PAGE_SIZE, "%d\n", BTRFS_SEND_STREAM_VERSION);
329+
}
330+
BTRFS_ATTR(static_feature, send_stream_version, send_stream_version_show);
331+
324332
static struct attribute *btrfs_supported_static_feature_attrs[] = {
325333
BTRFS_ATTR_PTR(static_feature, rmdir_subvol),
326334
BTRFS_ATTR_PTR(static_feature, supported_checksums),
335+
BTRFS_ATTR_PTR(static_feature, send_stream_version),
327336
NULL
328337
};
329338

0 commit comments

Comments
 (0)