mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-08 00:00:12 +03:00
bpos_parse(): parse symbolic constants
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ec23efce86
commit
39c00050d2
@ -681,6 +681,15 @@ static int kstrtouint_symbolic(const char *s, unsigned int base, unsigned *res)
|
||||
|
||||
struct bpos bpos_parse(char *buf)
|
||||
{
|
||||
if (!strcmp(buf, "POS_MIN"))
|
||||
return POS_MIN;
|
||||
|
||||
if (!strcmp(buf, "POS_MAX"))
|
||||
return POS_MAX;
|
||||
|
||||
if (!strcmp(buf, "SPOS_MAX"))
|
||||
return SPOS_MAX;
|
||||
|
||||
char *orig = strdup(buf);
|
||||
char *s = buf;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user