]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/sbuck.c
The write_merged() hook is no longer required in simple cases.
[libucw.git] / lib / sorter / sbuck.c
index 515115e282533e9ed00454b23e771ae13c76a4e9..4d9bb91b64cf55493ed0273dad15987683a73e3e 100644 (file)
@@ -137,10 +137,10 @@ sbuck_swap_out(struct sort_bucket *b)
 void
 sorter_prepare_buf(struct sort_context *ctx)
 {
 void
 sorter_prepare_buf(struct sort_context *ctx)
 {
-  u64 bs = MAX(sorter_bufsize/2, 1);
+  u64 bs = sorter_bufsize;
   bs = ALIGN_TO(bs, (u64)CPU_PAGE_SIZE);
   bs = ALIGN_TO(bs, (u64)CPU_PAGE_SIZE);
-  ctx->big_buf_size = 2*bs;
-  ctx->big_buf_half_size = bs;
+  bs = MAX(bs, 2*(u64)CPU_PAGE_SIZE);
+  ctx->big_buf_size = bs;
 }
 
 void
 }
 
 void
@@ -149,8 +149,7 @@ sorter_alloc_buf(struct sort_context *ctx)
   if (ctx->big_buf)
     return;
   ctx->big_buf = big_alloc(ctx->big_buf_size);
   if (ctx->big_buf)
     return;
   ctx->big_buf = big_alloc(ctx->big_buf_size);
-  ctx->big_buf_half = ((byte*) ctx->big_buf) + ctx->big_buf_half_size;
-  SORT_XTRACE(2, "Allocated sorting buffer (2*%s)", stk_fsize(ctx->big_buf_half_size));
+  SORT_XTRACE(2, "Allocated sorting buffer (%s)", stk_fsize(ctx->big_buf_size));
 }
 
 void
 }
 
 void