On Thu, Feb 15, 2018 at 11:05:12AM -0800, Omar Sandoval wrote:
> diff --git a/btrfs-list.c b/btrfs-list.c
> index a2fdb3f9..56aa2455 100644
> --- a/btrfs-list.c
> +++ b/btrfs-list.c
> @@ -34,6 +34,12 @@
> #include "btrfs-list.h"
> #include "rbtree-utils.h"
>
> +/*
> + * The deprecated functions in this file depend on each other, so silence the
> + * warnings.
> + */
> +#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
How does this behave under clang?
> +
> /* we store all the roots we find in an rbtree so that we can
> * search for them later.
> */
> diff --git a/btrfs-list.h b/btrfs-list.h
> index 54e1888f..774bcece 100644
> --- a/btrfs-list.h
> +++ b/btrfs-list.h
> @@ -82,10 +82,15 @@ struct root_info {
> };
>
> int btrfs_list_find_updated_files(int fd, u64 root_id, u64 oldest_gen);
> -int btrfs_list_get_default_subvolume(int fd, u64 *default_id);
> -char *btrfs_list_path_for_root(int fd, u64 root);
> -int btrfs_list_get_path_rootid(int fd, u64 *treeid);
> -int btrfs_get_subvol(int fd, struct root_info *the_ri);
> -int btrfs_get_toplevel_subvol(int fd, struct root_info *the_ri);
> +int btrfs_list_get_default_subvolume(int fd, u64 *default_id)
> + __attribute__((deprecated("use btrfs_util_get_default_subvolume_fd()")));
IIRC the parametrized deprecated("...") is not supported on older
compilers, see 1b1fd2c190ddb896a010a4c704ec1c2d46922aaf . We might avoid
using raw __attirbute__ anyway, so a wrapper __deprecated("with string")
could make it ifdef-ed properly. With some configure-time detection.
> +char *btrfs_list_path_for_root(int fd, u64 root)
> + __attribute__((deprecated("use btrfs_util_subvolume_path_fd()")));
> +int btrfs_list_get_path_rootid(int fd, u64 *treeid)
> + __attribute__((deprecated("use btrfs_util_subvolume_id_fd()")));
> +int btrfs_get_subvol(int fd, struct root_info *the_ri)
> + __attribute__((deprecated("use btrfs_util_subvolume_info_fd() and btrfs_util_subvolume_path_fd()")));
> +int btrfs_get_toplevel_subvol(int fd, struct root_info *the_ri)
> + __attribute__((deprecated("use btrfs_util_subvolume_info_fd() and btrfs_util_subvolume_path_fd()")));
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html