summaryrefslogtreecommitdiff
path: root/cmd_debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-03-16 21:37:23 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-03-16 21:46:21 -0400
commitcc92b0f5a2459456d735ed0fb93c0d819df3ccec (patch)
treec63872c9f1977f242cadbf68da4bf5bf008c6be4 /cmd_debug.c
parentaa0ddf3cf900cbcf14d5eb3d42638cc4ebb18cf7 (diff)
New data job command
This adds a new subcommand, bcachefs data job, that gives more direct access to the data job/ioctl functionality, and hooks up the new rewrite old nodes data job.
Diffstat (limited to 'cmd_debug.c')
-rw-r--r--cmd_debug.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/cmd_debug.c b/cmd_debug.c
index c0ba3f2f..3baa6978 100644
--- a/cmd_debug.c
+++ b/cmd_debug.c
@@ -389,25 +389,6 @@ static void list_nodes_keys(struct bch_fs *c, enum btree_id btree_id,
bch2_trans_exit(&trans);
}
-static struct bpos parse_pos(char *buf)
-{
- char *s = buf, *field;
- u64 inode_v = 0, offset_v = 0;
-
- if (!(field = strsep(&s, ":")) ||
- kstrtoull(field, 10, &inode_v))
- die("invalid bpos %s", buf);
-
- if ((field = strsep(&s, ":")) &&
- kstrtoull(field, 10, &offset_v))
- die("invalid bpos %s", buf);
-
- if (s)
- die("invalid bpos %s", buf);
-
- return (struct bpos) { .inode = inode_v, .offset = offset_v };
-}
-
static void list_keys_usage(void)
{
puts("bcachefs list - list filesystem metadata to stdout\n"
@@ -457,10 +438,10 @@ int cmd_list(int argc, char *argv[])
btree_id_end = btree_id_start + 1;
break;
case 's':
- start = parse_pos(optarg);
+ start = bpos_parse(optarg);
break;
case 'e':
- end = parse_pos(optarg);
+ end = bpos_parse(optarg);
break;
case 'i':
if (kstrtoull(optarg, 10, &inum))