mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-01-23 00:07:07 +03:00
bcache query-dev fixes, and don't print the sb out for status
Change-Id: I909ac15ca32a9cdecd6c7455e884d14f30ab0188 Signed-off-by: Jacob Malevich <jam@daterainc.com>
This commit is contained in:
parent
3fda6adc19
commit
28271115d7
17
bcache.c
17
bcache.c
@ -864,7 +864,7 @@ void show_super_cache(struct cache_sb *sb, bool force_csum)
|
||||
show_cache_member(sb, sb->nr_this_dev);
|
||||
}
|
||||
|
||||
struct cache_sb *query_dev(char *dev, bool force_csum)
|
||||
struct cache_sb *query_dev(char *dev, bool force_csum, bool print_sb)
|
||||
{
|
||||
struct cache_sb sb_stack, *sb = &sb_stack;
|
||||
size_t bytes = sizeof(*sb);
|
||||
@ -890,15 +890,14 @@ struct cache_sb *query_dev(char *dev, bool force_csum)
|
||||
}
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
if(print_sb) {
|
||||
if (!SB_IS_BDEV(sb))
|
||||
show_super_cache(sb, force_csum);
|
||||
else
|
||||
show_super_backingdev(sb, force_csum);
|
||||
}
|
||||
|
||||
void print_dev_info(struct cache_sb *sb, bool force_csum)
|
||||
{
|
||||
if (!SB_IS_BDEV(sb))
|
||||
show_super_cache(sb, force_csum);
|
||||
else
|
||||
show_super_backingdev(sb, force_csum);
|
||||
return sb;
|
||||
}
|
||||
|
||||
static void list_cacheset_devs(char *cset_dir, char *cset_name) {
|
||||
|
3
bcache.h
3
bcache.h
@ -57,12 +57,11 @@ long strtoul_or_die(const char *, size_t, const char *);
|
||||
void show_super_backingdev(struct cache_sb *, bool);
|
||||
void show_super_cache(struct cache_sb *, bool);
|
||||
|
||||
struct cache_sb *query_dev(char *, bool);
|
||||
struct cache_sb *query_dev(char *, bool, bool);
|
||||
int list_cachesets(char *, bool);
|
||||
char *parse_array_to_list(char *const *);
|
||||
int register_bcache();
|
||||
int probe(char *, int);
|
||||
void print_dev_info(struct cache_sb *, bool);
|
||||
void sb_state(struct cache_sb *, char *);
|
||||
void read_stat_dir(DIR *, char *, char *, bool);
|
||||
|
||||
|
@ -362,11 +362,8 @@ int bcache_query_devs (NihCommand *command, char *const *args)
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; args[i] != NULL; i++) {
|
||||
printf("query-devs on: %s\n", args[i]);
|
||||
struct cache_sb *sb = query_dev(args[i], false);
|
||||
print_dev_info(sb, force_csum);
|
||||
}
|
||||
for (i = 0; args[i] != NULL; i++)
|
||||
query_dev(args[i], force_csum, true);
|
||||
}
|
||||
|
||||
int bcache_status (NihCommand *command, char *const *args)
|
||||
@ -376,7 +373,7 @@ int bcache_status (NihCommand *command, char *const *args)
|
||||
char *dev0 = NULL, *dev1 = NULL;
|
||||
|
||||
for (i = 0; args[i] != NULL; i++) {
|
||||
struct cache_sb *sb = query_dev(args[i], false);
|
||||
struct cache_sb *sb = query_dev(args[i], false, false);
|
||||
struct cache_member *m = ((struct cache_member *) sb->d) +
|
||||
sb->nr_this_dev;
|
||||
long long unsigned cache_tier = CACHE_TIER(m);
|
||||
|
Loading…
Reference in New Issue
Block a user