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: Paul Lawrence <paullawrence@google.com> Change-Id: I41ee9715904560004e25cc83a5ccc1eb1bdd2b1f
This commit is contained in:
committed by
Alistair Delva
parent
affa585cc0
commit
6fb25c4252
+12
-17
@@ -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,
|
||||
struct kobj_attribute *attr, char *buff)
|
||||
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");
|
||||
}
|
||||
#define _DECLARE_FEATURE_FLAG(name) \
|
||||
static attr_show name##_show = supported; \
|
||||
static struct kobj_attribute name##_attr = __ATTR_RO(name)
|
||||
|
||||
static struct kobj_attribute report_uid_attr = __ATTR_RO(report_uid);
|
||||
#define DECLARE_FEATURE_FLAG(name) _DECLARE_FEATURE_FLAG(name)
|
||||
|
||||
static ssize_t zstd_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buff)
|
||||
{
|
||||
return snprintf(buff, PAGE_SIZE, "supported\n");
|
||||
}
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
|
||||
@@ -136,16 +136,22 @@
|
||||
*/
|
||||
#define INCFS_FEATURE_FLAG_COREFS "corefs"
|
||||
|
||||
/*
|
||||
* report_uid mount option is supported
|
||||
*/
|
||||
#define INCFS_FEATURE_FLAG_REPORT_UID "report_uid"
|
||||
|
||||
/*
|
||||
* zstd compression support
|
||||
*/
|
||||
#define INCFS_FEATURE_FLAG_ZSTD "zstd"
|
||||
|
||||
/*
|
||||
* 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_V2 "v2"
|
||||
|
||||
enum incfs_compression_alg {
|
||||
COMPRESSION_NONE = 0,
|
||||
COMPRESSION_LZ4 = 1,
|
||||
|
||||
Reference in New Issue
Block a user