From 8ad41d36bfc683424133407ff26559654c7ba316 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Wed, 16 Sep 2009 05:43:01 +0000 Subject: io-cache: fix table->max_pri to 1 as the lowest priority patch http://patches.gluster.com/patch/1319/ breaks when no priority is mentioned in the config. the patch makes ioc_get_priority() return 1 as the value when no priority is given, but ioc_get_priority_list() was still returning 0 as the max_pri (maximum priority) which would result in lru list heads not getting initialized Signed-off-by: Anand V. Avati BUG: 261 (support for disabling caching of certain files) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=261 --- xlators/performance/io-cache/src/io-cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/performance/io-cache/src') diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index ab8fa18cd..5e93d164a 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1201,7 +1201,7 @@ ioc_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, int32_t ioc_get_priority_list (const char *opt_str, struct list_head *first) { - int32_t max_pri = 0; + int32_t max_pri = 1; char *tmp_str = NULL; char *tmp_str1 = NULL; char *tmp_str2 = NULL; @@ -1309,6 +1309,7 @@ init (xlator_t *this) } INIT_LIST_HEAD (&table->priority_list); + table->max_pri = 1; if (dict_get (options, "priority")) { char *option_list = data_to_str (dict_get (options, "priority")); -- cgit