]> mj.ucw.cz Git - libucw.git/commitdiff
Added switch CONFIG_DIRECT
authorMichal Vaner <vorner@ucw.cz>
Sun, 30 Nov 2008 11:30:08 +0000 (12:30 +0100)
committerMichal Vaner <vorner@ucw.cz>
Sun, 30 Nov 2008 11:30:08 +0000 (12:30 +0100)
Turns on and off if fb-direct is compiled.

ucw/Makefile
ucw/default.cfg
ucw/fb-param.c

index 41ca1c3f9bbcbfe0b7474faaac606128293f41d2..954cfec3bf7e37328978f848d22d3bcdd8889230 100644 (file)
@@ -60,10 +60,14 @@ LIBUCW_MAIN_INCLUDES= \
 
 ifdef CONFIG_UCW_THREADS
 # Some modules require threading
-LIBUCW_MODS+=threads-conf workqueue asio fb-direct
+LIBUCW_MODS+=threads-conf workqueue asio
 LIBUCW_MAIN_INCLUDES+=workqueue.h semaphore.h asio.h
 endif
 
+ifdef CONFIG_DIRECT
+LIBUCW_MODS+=fb-direct
+endif
+
 ifdef CONFIG_OWN_GETOPT
 include $(s)/ucw/getopt/Makefile
 endif
index f042800fa6bd0e285e15a62013f79c0ec1387e92..58b145921a0f5de599d9b55b9c84f9268e326a0e 100644 (file)
@@ -50,5 +50,8 @@ UnSet("ENV_VAR_CONFIG");
 # Use obsolete URL escaping rules (if you need behavior identical to the older versions of libucw)
 UnSet("CONFIG_URL_ESCAPE_COMPAT");
 
+# Allow use of direct IO on files
+Set("CONFIG_DIRECT");
+
 # Return success
 1;
index dafd23edde9f05c026621f8dfe18d7fa5400da11..514f987bb719729046a5fc16e1f1ba38a228233e 100644 (file)
@@ -28,6 +28,10 @@ fbpar_cf_commit(struct fb_params *p UNUSED)
 #ifndef CONFIG_UCW_THREADS
   if (p->type == FB_DIRECT)
     return "Direct I/O is supported only with CONFIG_UCW_THREADS";
+#endif
+#ifndef CONFIG_DIRECT
+  if (p->type == FB_DIRECT)
+    return "Direct I/O is disabled";
 #endif
   return NULL;
 }
@@ -72,7 +76,7 @@ bopen_fd_internal(int fd, struct fb_params *params, uns mode, const char *name)
   struct fastbuf *fb;
   switch (params->type)
     {
-#ifdef CONFIG_UCW_THREADS
+#ifdef CONFIG_DIRECT
       case FB_DIRECT:
        fb = fbdir_open_fd_internal(fd, name, params->asio,
            params->buffer_size ? : fbpar_def.buffer_size,
@@ -102,7 +106,7 @@ bopen_file_internal(const char *name, int mode, struct fb_params *params, int tr
 {
   if (!params)
     params = &fbpar_def;
-#ifdef CONFIG_UCW_THREADS
+#ifdef CONFIG_DIRECT
   if (params->type == FB_DIRECT && !fbdir_cheat)
     mode |= O_DIRECT;
 #endif