blob: c317d15c1de0b62fc58f03cf182e7c5966f90cf0 [file] [log] [blame]
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2024 Oracle. All Rights Reserved.
* Author: Darrick J. Wong <djwong@kernel.org>
*/
#include <string.h>
#include "xfs.h"
#include "libfrog/fsgeom.h"
#include "libfrog/fsproperties.h"
#include "list.h"
/* Return the offset of a string in a string table, or -1 if not found. */
static inline int
__fsprops_lookup(
const char *values[],
unsigned int nr_values,
const char *value)
{
unsigned int i;
for (i = 0; i < nr_values; i++) {
if (values[i] && !strcmp(value, values[i]))
return i;
}
return -1;
}
#define fsprops_lookup(values, value) \
__fsprops_lookup((values), ARRAY_SIZE(values), (value))
/* Return true if a fs property name=value tuple is allowed. */
bool
fsprop_validate(
const char *name,
const char *value)
{
return true;
}