mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-08 00:00:12 +03:00
dev_name.state
Get memebr state when we're getting device names. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
4226cd1854
commit
f968aa040b
@ -910,6 +910,8 @@ dev_names bchu_fs_get_devices(struct bchfs_handle fs)
|
||||
struct dirent *d;
|
||||
dev_names devs;
|
||||
|
||||
struct bch_sb *sb = bchu_read_super(fs, -1);
|
||||
|
||||
darray_init(&devs);
|
||||
|
||||
while ((errno = 0), (d = readdir(dir))) {
|
||||
@ -940,9 +942,13 @@ dev_names bchu_fs_get_devices(struct bchfs_handle fs)
|
||||
n.durability = read_file_u64(fs.sysfs_fd, durability_attr);
|
||||
free(durability_attr);
|
||||
|
||||
struct bch_member m = bch2_sb_member_get(sb, n.idx);
|
||||
n.state = BCH_MEMBER_STATE(&m);
|
||||
|
||||
darray_push(&devs, n);
|
||||
}
|
||||
|
||||
free(sb);
|
||||
closedir(dir);
|
||||
|
||||
return devs;
|
||||
|
||||
@ -313,11 +313,12 @@ static inline void bchu_disk_resize_journal(struct bchfs_handle fs,
|
||||
int bchu_data(struct bchfs_handle, struct bch_ioctl_data);
|
||||
|
||||
struct dev_name {
|
||||
unsigned idx;
|
||||
char *dev;
|
||||
char *label;
|
||||
uuid_t uuid;
|
||||
unsigned durability;
|
||||
unsigned idx;
|
||||
char *dev;
|
||||
char *label;
|
||||
uuid_t uuid;
|
||||
unsigned durability;
|
||||
enum bch_member_state state;
|
||||
};
|
||||
typedef DARRAY(struct dev_name) dev_names;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user