From: Martin Mares Date: Sun, 6 Oct 2002 15:45:07 +0000 (+0000) Subject: When bopen() is called with buffer size 0, it switches to bopen_mm(). X-Git-Tag: holmes-import~1328 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c7c3c265e4ace960028a35889f23ebc485d5cc13;p=libucw.git When bopen() is called with buffer size 0, it switches to bopen_mm(). The plan is to make use of mmapping configurable by the buffer sizes in cf/sherlock. --- diff --git a/lib/fb-file.c b/lib/fb-file.c index 5e1a6981..cfc586bb 100644 --- a/lib/fb-file.c +++ b/lib/fb-file.c @@ -120,18 +120,11 @@ struct fastbuf * bopen(byte *name, uns mode, uns buffer) { struct fastbuf *b; + int fd; -#if 0 /* FIXME: Dirty hack for testing fb-mmap */ - if (buffer >= 65536 && (mode == O_RDONLY)) - { - log(L_DEBUG, "bopen_mm hack: %s", name); - if (mode & O_WRONLY) - mode = (mode & ~O_WRONLY) | O_RDWR; - return bopen_mm(name, mode); - } -#endif - - int fd = sh_open(name, mode, 0666); + if (!buffer) + return bopen_mm(name, mode); + fd = sh_open(name, mode, 0666); if (fd < 0) die("Unable to %s file %s: %m", (mode & O_CREAT) ? "create" : "open", name);