btrfs-progs/common/device-scan.h
Anand Jain aeb2242b70 btrfs-progs: refactor btrfs_scan_devices() to accept verbose argument
Function btrfs_scan_devices() is being used by commands such as
'btrfs filesystem' and 'btrfs device', by having the verbose argument in
the btrfs_scan_devices() we can control which threads to print the
messages when verbose is enabled by the global option.

Add an option %verbose to btrfs_scan_devices().

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2020-06-12 19:31:58 +02:00

47 lines
1.2 KiB
C

#ifndef __DEVICE_SCAN_H__
#define __DEVICE_SCAN_H__
#include "kerncompat.h"
#include "ioctl.h"
#define BTRFS_SCAN_MOUNTED (1ULL << 0)
#define BTRFS_SCAN_LBLKID (1ULL << 1)
#define BTRFS_UPDATE_KERNEL 1
#define BTRFS_ARG_UNKNOWN 0
#define BTRFS_ARG_MNTPOINT 1
#define BTRFS_ARG_UUID 2
#define BTRFS_ARG_BLKDEV 3
#define BTRFS_ARG_REG 4
#define SEEN_FSID_HASH_SIZE 256
struct btrfs_root;
struct btrfs_trans_handle;
struct seen_fsid;
struct DIR;
struct seen_fsid {
u8 fsid[BTRFS_FSID_SIZE];
struct seen_fsid *next;
DIR *dirstream;
int fd;
};
int btrfs_scan_devices(int verbose);
int btrfs_register_one_device(const char *fname);
int btrfs_register_all_devices(void);
int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
struct btrfs_root *root, int fd, const char *path,
u64 device_total_bytes, u32 io_width, u32 io_align,
u32 sectorsize);
int btrfs_device_already_in_root(struct btrfs_root *root, int fd,
int super_offset);
int is_seen_fsid(u8 *fsid, struct seen_fsid *seen_fsid_hash[]);
int add_seen_fsid(u8 *fsid, struct seen_fsid *seen_fsid_hash[],
int fd, DIR *dirstream);
void free_seen_fsid(struct seen_fsid *seen_fsid_hash[]);
#endif