]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/sbuck.c
Use a different file access method for small inputs.
[libucw.git] / lib / sorter / sbuck.c
index e506e3189161d905ca4a1408df789f799b4c86bc..1150c9d6733a663df18104b39991625d16b52aad 100644 (file)
@@ -69,12 +69,12 @@ sbuck_swap_in(struct sort_bucket *b)
 {
   if (b->flags & SBF_SWAPPED_OUT)
     {
-      b->fb = bopen_file(b->filename, O_RDWR, &sorter_fb_params);      /* FIXME: Something different for small buckets? */
+      b->fb = bopen_file(b->filename, O_RDWR, b->ctx->fb_params);
       if (b->flags & SBF_OPEN_WRITE)
        bseek(b->fb, 0, SEEK_END);
       bconfig(b->fb, BCONFIG_IS_TEMP_FILE, 1);
       b->flags &= ~SBF_SWAPPED_OUT;
-      SORT_XTRACE(2, "Swapped in %s", b->filename);
+      SORT_XTRACE(3, "Swapped in %s", b->filename);
     }
 }
 
@@ -104,7 +104,7 @@ sbuck_write(struct sort_bucket *b)
   else
     {
       ASSERT(!(b->flags & (SBF_OPEN_READ | SBF_DESTROYED)));
-      b->fb = bopen_tmp_file(&sorter_fb_params);
+      b->fb = bopen_tmp_file(b->ctx->fb_params);
       if (sorter_debug & SORT_DEBUG_KEEP_BUCKETS)
        bconfig(b->fb, BCONFIG_IS_TEMP_FILE, 0);
       b->flags |= SBF_OPEN_WRITE;
@@ -124,7 +124,7 @@ sbuck_swap_out(struct sort_bucket *b)
       bclose(b->fb);
       b->fb = NULL;
       b->flags |= SBF_SWAPPED_OUT;
-      SORT_XTRACE(2, "Swapped out %s", b->filename);
+      SORT_XTRACE(3, "Swapped out %s", b->filename);
     }
 }