summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-01-23 14:49:57 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-01-23 12:36:41 -0800
commite553411beab23d71070fd59aad02f2d328c17beb (patch)
tree6ccdc7f840b73904c2f6785826d2e1b9f72cffe6
parent3a822f390e63a6fe847eb5a4ead03c0aaf32cb3e (diff)
write-behind: fix 'option enable-trickling-writes'
fix logic in __wb_mark_winds to properly initialize incomplete_writes and conditionally check based on enable_trickling_writes flag Signed-off-by: Anand V. Avati <avati@amp.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 547 (write-behind enable-trickling-writes working?) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=547
-rw-r--r--xlators/performance/write-behind/src/write-behind.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index a4e1239..faa3239 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1141,9 +1141,8 @@ __wb_mark_winds (list_head_t *list, list_head_t *winds, size_t aggregate_conf,
{
size_t size = 0;
char other_fop_in_queue = 0;
- char incomplete_writes = 1;
+ char incomplete_writes = 0;
char non_contiguous_writes = 0;
- char *trickling_writes = NULL;
wb_request_t *request = NULL;
wb_file_t *file = NULL;
@@ -1155,15 +1154,12 @@ __wb_mark_winds (list_head_t *list, list_head_t *winds, size_t aggregate_conf,
file = request->file;
if (!wind_all && (file->aggregate_current < aggregate_conf)) {
- if (enable_trickling_writes) {
- trickling_writes = &incomplete_writes;
- }
-
__wb_can_wind (list, &other_fop_in_queue,
- &non_contiguous_writes, trickling_writes);
+ &non_contiguous_writes, &incomplete_writes);
}
- if ((!incomplete_writes) || (wind_all) || (non_contiguous_writes)
+ if ((enable_trickling_writes && !incomplete_writes)
+ || (wind_all) || (non_contiguous_writes)
|| (other_fop_in_queue)
|| (file->aggregate_current >= aggregate_conf)) {
size = __wb_mark_wind_all (file, list, winds);