Skip to content

Commit

Permalink
dm cache: move config fns
Browse files Browse the repository at this point in the history
Move process_config_option() in dm-cache-target.c to make the
next patch more readable.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Alasdair G Kergon committed May 10, 2013
1 parent ac8c3f3 commit 2c73c47
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions drivers/md/dm-cache-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,23 @@ static int parse_cache_args(struct cache_args *ca, int argc, char **argv,

static struct kmem_cache *migration_cache;

#define NOT_CORE_OPTION 1

static int process_config_option(struct cache *cache, char **argv)
{
unsigned long tmp;

if (!strcasecmp(argv[0], "migration_threshold")) {
if (kstrtoul(argv[1], 10, &tmp))
return -EINVAL;

cache->migration_threshold = tmp;
return 0;
}

return NOT_CORE_OPTION;
}

static int set_config_values(struct dm_cache_policy *p, int argc, const char **argv)
{
int r = 0;
Expand Down Expand Up @@ -2520,23 +2537,6 @@ static void cache_status(struct dm_target *ti, status_type_t type,
DMEMIT("Error");
}

#define NOT_CORE_OPTION 1

static int process_config_option(struct cache *cache, char **argv)
{
unsigned long tmp;

if (!strcasecmp(argv[0], "migration_threshold")) {
if (kstrtoul(argv[1], 10, &tmp))
return -EINVAL;

cache->migration_threshold = tmp;
return 0;
}

return NOT_CORE_OPTION;
}

/*
* Supports <key> <value>.
*
Expand Down

0 comments on commit 2c73c47

Please sign in to comment.