]> mj.ucw.cz Git - libucw.git/commitdiff
Cleaned up the fastbuf interfaces.
authorMartin Mares <mj@ucw.cz>
Tue, 29 May 2007 20:39:31 +0000 (22:39 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 29 May 2007 20:39:31 +0000 (22:39 +0200)
The high-level functions of fb-mmap and fb-direct have been removed.

lib/fastbuf.h
lib/fb-direct.c
lib/fb-mmap.c

index 475f833560def6ea7b4b8ce18e2e0849a6d3b4d6..68b2a9db18db938456fcefc309ccfb24a485ebcf 100644 (file)
@@ -77,7 +77,7 @@ struct fastbuf {
 
 enum fb_type {                         /* Which back-end you want to use */
   FB_STD,                              /* Standard buffered I/O */
-  FB_DIRECT,                           /* Direct I/O bypassing system caches */
+  FB_DIRECT,                           /* Direct I/O bypassing system caches (see fb-direct.c for description) */
   FB_MMAP                              /* Memory mapped files */
 };
 
@@ -111,26 +111,18 @@ void bfilesync(struct fastbuf *b);
 #define TEMP_FILE_NAME_LEN 256
 void temp_file_name(byte *name);
 
-/* FastIO on in-memory streams */
-
-struct fastbuf *fbmem_create(unsigned blocksize);      /* Create stream and return its writing fastbuf */
-struct fastbuf *fbmem_clone_read(struct fastbuf *);    /* Create reading fastbuf */
-
-/* FastIO on memory mapped files */
+/* Internal functions of some file back-ends */
 
 struct fastbuf *bfmmopen_internal(int fd, byte *name, uns mode);
-struct fastbuf *bopen_mm(byte *name, uns mode);
-
-/* FastIO on files opened with O_DIRECT (see fb-direct.c for description) */
 
 extern uns fbdir_cheat;
-
 struct asio_queue;
 struct fastbuf *fbdir_open_fd_internal(int fd, byte *name, struct asio_queue *io_queue, uns buffer_size, uns read_ahead, uns write_back);
-struct fastbuf *fbdir_open(byte *name, uns mode, struct asio_queue *io_queue);
-struct fastbuf *fbdir_open_try(byte *name, uns mode, struct asio_queue *io_queue);
-struct fastbuf *fbdir_open_fd(int fd, struct asio_queue *io_queue);
-struct fastbuf *fbdir_open_tmp(struct asio_queue *io_queue);
+
+/* FastIO on in-memory streams */
+
+struct fastbuf *fbmem_create(unsigned blocksize);      /* Create stream and return its writing fastbuf */
+struct fastbuf *fbmem_clone_read(struct fastbuf *);    /* Create reading fastbuf */
 
 /* FastI on file descriptors with limit */
 
index 31b12e15598a6d8df10913947517c918dc3b85c0..b82faa9157a05aabcdca4c373ba658316df5d629 100644 (file)
@@ -314,30 +314,6 @@ fbdir_open_fd_internal(int fd, byte *name, struct asio_queue *q, uns buffer_size
   return f;
 }
 
-struct fastbuf *
-fbdir_open_try(byte *name, uns mode, struct asio_queue *q)
-{
-  return bopen_file_try(name, mode, &(struct fb_params){ .type = FB_DIRECT, .asio = q });
-}
-
-struct fastbuf *
-fbdir_open(byte *name, uns mode, struct asio_queue *q)
-{
-  return bopen_file(name, mode, &(struct fb_params){ .type = FB_DIRECT, .asio = q });
-}
-
-struct fastbuf *
-fbdir_open_fd(int fd, struct asio_queue *q)
-{
-  return bopen_fd(fd, &(struct fb_params){ .type = FB_DIRECT, .asio = q });
-}
-
-struct fastbuf *
-fbdir_open_tmp(struct asio_queue *q)
-{
-  return bopen_tmp_file(&(struct fb_params){ .type = FB_DIRECT, .asio = q });
-}
-
 #ifdef TEST
 
 #include "lib/getopt.h"
index cb1fd06be073bc042b754dff8542a40345c7d94b..88dfed4d26ed3843362ca97a0bbe7c7b09c65385 100644 (file)
@@ -189,12 +189,6 @@ bfmmopen_internal(int fd, byte *name, uns mode)
   return f;
 }
 
-struct fastbuf *
-bopen_mm(byte *name, uns mode)
-{
-  return bopen_file(name, mode, &(struct fb_params){ .type = FB_MMAP });
-}
-
 #ifdef TEST
 
 int main(int argc, char **argv)