btrfs-progs: fix -Wmissing-prototypes warnings

The fixes involve the following changes:

- Unexport functions which are not utilized out of the file
  * print_path_column()
  * parse_reflink_range()
  * btrfs_list_setup_print_column()
  * device_get_partition_size_sysfs()
  * max_zone_append_size()

- Include related headers before implementing the function
  * change-uuid.c
  * convert-bgt.c
  * seed.h

- Add missing headers caused by the above header changes
  * include <uuid/uuid.h> for tune/tune.h.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2023-05-03 14:03:42 +08:00 committed by David Sterba
parent 8b826e1cb7
commit b3327119ec
12 changed files with 13 additions and 7 deletions

View File

@ -289,7 +289,7 @@ static void print_qgroup_column_add_blank(enum btrfs_qgroup_column_enum column,
printf(" ");
}
void print_path_column(struct btrfs_qgroup *qgroup)
static void print_path_column(struct btrfs_qgroup *qgroup)
{
struct btrfs_qgroup_list *list = NULL;

View File

@ -58,7 +58,7 @@ struct reflink_range {
bool same_file;
};
void parse_reflink_range(const char *str, u64 *from, u64 *length, u64 *to)
static void parse_reflink_range(const char *str, u64 *from, u64 *length, u64 *to)
{
char tmp[512];
int i;

View File

@ -280,7 +280,7 @@ static struct {
static btrfs_list_filter_func all_filter_funcs[];
static btrfs_list_comp_func all_comp_funcs[];
void btrfs_list_setup_print_column(enum btrfs_list_column_enum column)
static void btrfs_list_setup_print_column(enum btrfs_list_column_enum column)
{
int i;

View File

@ -332,7 +332,7 @@ u64 device_get_partition_size_fd(int fd)
return result;
}
u64 device_get_partition_size_sysfs(const char *dev)
static u64 device_get_partition_size_sysfs(const char *dev)
{
int ret;
char path[PATH_MAX] = {};

View File

@ -498,7 +498,7 @@ static bool valid_escape(const char *str)
* - line is advanced to the final separator or nul character
* - returned path is a valid string terminated by zero or whitespace separator
*/
char *read_path(char **line)
static char *read_path(char **line)
{
char *ret = *line;
char *out = *line;

View File

@ -73,7 +73,7 @@ void ulist_init(struct ulist *ulist)
* This is useful in cases where the base 'struct ulist' has been statically
* allocated.
*/
void ulist_release(struct ulist *ulist)
static void ulist_release(struct ulist *ulist)
{
struct ulist_node *node;
struct ulist_node *next;

View File

@ -92,7 +92,7 @@ u64 zone_size(const char *file)
return strtoull((const char *)chunk, NULL, 10) << SECTOR_SHIFT;
}
u64 max_zone_append_size(const char *file)
static u64 max_zone_append_size(const char *file)
{
char chunk[32];
int ret;

View File

@ -24,6 +24,7 @@
#include "kernel-shared/transaction.h"
#include "common/messages.h"
#include "common/internal.h"
#include "tune/tune.h"
static int change_tree_csum(struct btrfs_trans_handle *trans, struct btrfs_root *root,
int csum_type)

View File

@ -26,6 +26,7 @@
#include "kernel-shared/volumes.h"
#include "common/defs.h"
#include "common/messages.h"
#include "tune/tune.h"
static int change_fsid_prepare(struct btrfs_fs_info *fs_info, uuid_t new_fsid)
{

View File

@ -22,6 +22,7 @@
#include "kernel-shared/transaction.h"
#include "common/messages.h"
#include "common/extent-cache.h"
#include "tune/tune.h"
/* After this many block groups we need to commit transaction. */
#define BLOCK_GROUP_BATCH 64

View File

@ -18,6 +18,7 @@
#include "kernel-shared/ctree.h"
#include "kernel-shared/transaction.h"
#include "common/messages.h"
#include "tune/tune.h"
int update_seeding_flag(struct btrfs_root *root, const char *device, int set_flag, int force)
{

View File

@ -17,6 +17,8 @@
#ifndef __BTRFS_TUNE_H__
#define __BTRFS_TUNE_H__
#include <uuid/uuid.h>
struct btrfs_root;
struct btrfs_fs_info;