Commit 7573df55 authored by Omar Sandoval's avatar Omar Sandoval Committed by David Sterba

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: default avatarOmar Sandoval <osandov@fb.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c9a949af
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "ctree.h" #include "ctree.h"
#include "discard.h" #include "discard.h"
#include "disk-io.h" #include "disk-io.h"
#include "send.h"
#include "transaction.h" #include "transaction.h"
#include "sysfs.h" #include "sysfs.h"
#include "volumes.h" #include "volumes.h"
...@@ -321,9 +322,17 @@ static ssize_t supported_checksums_show(struct kobject *kobj, ...@@ -321,9 +322,17 @@ static ssize_t supported_checksums_show(struct kobject *kobj,
} }
BTRFS_ATTR(static_feature, supported_checksums, supported_checksums_show); BTRFS_ATTR(static_feature, supported_checksums, supported_checksums_show);
static ssize_t send_stream_version_show(struct kobject *kobj,
struct kobj_attribute *ka, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", BTRFS_SEND_STREAM_VERSION);
}
BTRFS_ATTR(static_feature, send_stream_version, send_stream_version_show);
static struct attribute *btrfs_supported_static_feature_attrs[] = { static struct attribute *btrfs_supported_static_feature_attrs[] = {
BTRFS_ATTR_PTR(static_feature, rmdir_subvol), BTRFS_ATTR_PTR(static_feature, rmdir_subvol),
BTRFS_ATTR_PTR(static_feature, supported_checksums), BTRFS_ATTR_PTR(static_feature, supported_checksums),
BTRFS_ATTR_PTR(static_feature, send_stream_version),
NULL NULL
}; };
......
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