static char *
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";
+ {
+#ifndef CONFIG_UCW_THREADS
+ return "Direct I/O is supported only with CONFIG_UCW_THREADS";
+#endif
+#ifdef CONFIG_DARWIN
+ return "Direct I/O is not supported on darwin";
#endif
+#ifndef CONFIG_DIRECT_IO
+ return "Direct I/O disabled by configure switch -CONFIG_DIRECT_IO";
+#endif
+#ifndef CONFIG_UCW_FB_DIRECT
+ return "Direct I/O disabled by configure switch -CONFIG_UCW_FB_DIRECT";
+#endif
+ }
return NULL;
}
struct fastbuf *fb;
switch (params->type)
{
-#ifdef CONFIG_UCW_THREADS
+#ifdef CONFIG_UCW_FB_DIRECT
case FB_DIRECT:
fb = fbdir_open_fd_internal(fd, name, params->asio,
params->buffer_size ? : fbpar_def.buffer_size,
{
if (!params)
params = &fbpar_def;
-#ifdef CONFIG_UCW_THREADS
+#ifdef CONFIG_UCW_FB_DIRECT
if (params->type == FB_DIRECT && !fbdir_cheat)
mode |= O_DIRECT;
#endif
if (params->type == FB_MMAP && (mode & O_ACCMODE) == O_WRONLY)
mode = (mode & ~O_ACCMODE) | O_RDWR;
- int fd = sh_open(name, mode, 0666);
+ int fd = ucw_open(name, mode, 0666);
if (fd < 0)
if (try)
return NULL;
}
struct fastbuf *
-bopen_fd(int fd, struct fb_params *params)
+bopen_fd_name(int fd, struct fb_params *params, const char *name)
{
- return bopen_fd_internal(fd, params ? : &fbpar_def, ~0U, NULL);
+ return bopen_fd_internal(fd, params ? : &fbpar_def, ~0U, name);
}
/* Function for use by individual file back-ends */