]> mj.ucw.cz Git - libucw.git/blobdiff - lib/sorter/sbuck.c
Fixed a typo.
[libucw.git] / lib / sorter / sbuck.c
index 4d9bb91b64cf55493ed0273dad15987683a73e3e..e506e3189161d905ca4a1408df789f799b4c86bc 100644 (file)
@@ -69,10 +69,7 @@ sbuck_swap_in(struct sort_bucket *b)
 {
   if (b->flags & SBF_SWAPPED_OUT)
     {
-      if (sorter_stream_bufsize)       /* FIXME: Needs better configuration, probably semi-automatic one */
-       b->fb = bopen(b->filename, O_RDWR, sorter_stream_bufsize);
-      else
-       b->fb = fbdir_open(b->filename, O_RDWR, NULL);
+      b->fb = bopen_file(b->filename, O_RDWR, &sorter_fb_params);      /* FIXME: Something different for small buckets? */
       if (b->flags & SBF_OPEN_WRITE)
        bseek(b->fb, 0, SEEK_END);
       bconfig(b->fb, BCONFIG_IS_TEMP_FILE, 1);
@@ -107,10 +104,7 @@ sbuck_write(struct sort_bucket *b)
   else
     {
       ASSERT(!(b->flags & (SBF_OPEN_READ | SBF_DESTROYED)));
-      if (sorter_stream_bufsize)
-       b->fb = bopen_tmp(sorter_stream_bufsize);
-      else
-       b->fb = fbdir_open_tmp(NULL);
+      b->fb = bopen_tmp_file(&sorter_fb_params);
       if (sorter_debug & SORT_DEBUG_KEEP_BUCKETS)
        bconfig(b->fb, BCONFIG_IS_TEMP_FILE, 0);
       b->flags |= SBF_OPEN_WRITE;