Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82e433b1 authored by Paul Lawrence's avatar Paul Lawrence
Browse files

ANDROID: Incremental fs: Add v2 feature flag



Roll report_uid feature flag into v2 feature flag

Bug: 174478527
Test: Feature flag present on boot
Signed-off-by: default avatarPaul Lawrence <paullawrence@google.com>
Change-Id: I41ee9715904560004e25cc83a5ccc1eb1bdd2b1f
parent ea66b381
Loading
Loading
Loading
Loading
+12 −17
Original line number Diff line number Diff line
@@ -22,34 +22,29 @@ static struct file_system_type incfs_fs_type = {

static struct kobject *sysfs_root, *featurefs_root;

static ssize_t corefs_show(struct kobject *kobj,
static ssize_t supported(struct kobject *kobj,
			 struct kobj_attribute *attr, char *buff)
{
	return snprintf(buff, PAGE_SIZE, "supported\n");
}

static struct kobj_attribute corefs_attr = __ATTR_RO(corefs);
typedef ssize_t (*const attr_show)(struct kobject *kobj,
				   struct kobj_attribute *attr, char *buff);

static ssize_t report_uid_show(struct kobject *kobj,
			       struct kobj_attribute *attr, char *buff)
{
	return snprintf(buff, PAGE_SIZE, "supported\n");
}

static struct kobj_attribute report_uid_attr = __ATTR_RO(report_uid);
#define _DECLARE_FEATURE_FLAG(name)					\
	static attr_show name##_show = supported;			\
	static struct kobj_attribute name##_attr = __ATTR_RO(name)

static ssize_t zstd_show(struct kobject *kobj,
			       struct kobj_attribute *attr, char *buff)
{
	return snprintf(buff, PAGE_SIZE, "supported\n");
}
#define DECLARE_FEATURE_FLAG(name) _DECLARE_FEATURE_FLAG(name)

static struct kobj_attribute zstd_attr = __ATTR_RO(zstd);
DECLARE_FEATURE_FLAG(corefs);
DECLARE_FEATURE_FLAG(zstd);
DECLARE_FEATURE_FLAG(v2);

static struct attribute *attributes[] = {
	&corefs_attr.attr,
	&report_uid_attr.attr,
	&zstd_attr.attr,
	&v2_attr.attr,
	NULL,
};

+10 −4
Original line number Diff line number Diff line
@@ -137,14 +137,20 @@
#define INCFS_FEATURE_FLAG_COREFS "corefs"

/*
 * report_uid mount option is supported
 * zstd compression support
 */
#define INCFS_FEATURE_FLAG_REPORT_UID "report_uid"
#define INCFS_FEATURE_FLAG_ZSTD "zstd"

/*
 * zstd compression support
 * v2 feature set support. Covers:
 *   INCFS_IOC_CREATE_MAPPED_FILE
 *   INCFS_IOC_GET_BLOCK_COUNT
 *   INCFS_IOC_GET_READ_TIMEOUTS/INCFS_IOC_SET_READ_TIMEOUTS
 *   .blocks_written status file
 *   .incomplete folder
 *   report_uid mount option
 */
#define INCFS_FEATURE_FLAG_ZSTD "zstd"
#define INCFS_FEATURE_FLAG_V2 "v2"

enum incfs_compression_alg {
	COMPRESSION_NONE = 0,