btrfs-progs: add warning helper for experimental build

We should warn that there's an experimental feature used. Add a helper
with optional description. Should be used only if such feature is used
and not always.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-10-20 16:29:13 +02:00
parent 720819745c
commit e0cc76a9ce
2 changed files with 9 additions and 0 deletions

View File

@ -1152,6 +1152,14 @@ int btrfs_warn_multiple_profiles(int fd)
return 1;
}
void btrfs_warn_experimental(const char *str)
{
#if EXPERIMENTAL
warning("Experimental build with unstable or unfinished features");
warning_on(str != NULL, "%s\n", str);
#endif
}
/*
* Open a file in fsid directory in sysfs and return the file descriptor or
* error

View File

@ -110,6 +110,7 @@ void init_rand_seed(u64 seed);
char *btrfs_test_for_multiple_profiles(int fd);
int btrfs_warn_multiple_profiles(int fd);
void btrfs_warn_experimental(const char *str);
int sysfs_open_file(const char *name);
int sysfs_open_fsid_file(int fd, const char *filename);