From: Pavel Charvat Date: Tue, 29 May 2007 12:50:48 +0000 (+0200) Subject: tried parametrized fastbuf for most of indexing I/O X-Git-Tag: holmes-import~506^2~13^2~117 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=434c630cf7aa4b4facc1d2fcfb6e9bc4cf21dff1;p=libucw.git tried parametrized fastbuf for most of indexing I/O ... but there are still bugs, only std I/O passed --- diff --git a/lib/fb-mmap.c b/lib/fb-mmap.c index 13087d6e..cb1fd06b 100644 --- a/lib/fb-mmap.c +++ b/lib/fb-mmap.c @@ -192,8 +192,6 @@ bfmmopen_internal(int fd, byte *name, uns mode) struct fastbuf * bopen_mm(byte *name, uns mode) { - if ((mode & O_ACCMODE) == O_WRONLY) - mode = (mode & ~O_ACCMODE) | O_RDWR; return bopen_file(name, mode, &(struct fb_params){ .type = FB_MMAP }); } diff --git a/lib/fb-param.c b/lib/fb-param.c index e97e2293..38cd5801 100644 --- a/lib/fb-param.c +++ b/lib/fb-param.c @@ -80,6 +80,8 @@ bopen_file_internal(byte *name, int mode, struct fb_params *params, int try) { if (params->type == FB_DIRECT && !fbdir_cheat) mode |= O_DIRECT; + if (params->type == FB_MMAP && (mode & O_ACCMODE) == O_WRONLY) + mode = (mode & ~O_ACCMODE) | O_RDWR; int fd = sh_open(name, mode, 0666); if (fd < 0) if (try)