Browse Source

[DFS] Fix the romfs compiling issue.

bernard 7 years ago
parent
commit
5bc690336b
2 changed files with 19 additions and 1 deletions
  1. 16 0
      components/dfs/KConfig
  2. 3 1
      components/dfs/filesystems/romfs/dfs_romfs.c

+ 16 - 0
components/dfs/KConfig

@@ -24,7 +24,9 @@ if RT_USING_DFS
         default y
         default y
         help
         help
             FatFs is a generic FAT/exFAT file system module for small embedded systems.
             FatFs is a generic FAT/exFAT file system module for small embedded systems.
+
     if RT_USING_DFS_ELMFAT
     if RT_USING_DFS_ELMFAT
+        menu "elm-chan's FatFs, Generic FAT Filesystem Module"
         config RT_DFS_ELM_CODE_PAGE
         config RT_DFS_ELM_CODE_PAGE
             int "OEM code page"
             int "OEM code page"
             default 437
             default 437
@@ -79,6 +81,7 @@ if RT_USING_DFS
         config RT_DFS_ELM_REENTRANT
         config RT_DFS_ELM_REENTRANT
             bool "Enable the reentrancy (thread safe) of the FatFs module"
             bool "Enable the reentrancy (thread safe) of the FatFs module"
             default y
             default y
+        endmenu
     endif
     endif
 
 
     config RT_USING_DFS_DEVFS
     config RT_USING_DFS_DEVFS
@@ -93,6 +96,19 @@ if RT_USING_DFS
         help
         help
             Let BSD socket operated by file system API, such as read/write and involveed in select/poll POSIX APIs.
             Let BSD socket operated by file system API, such as read/write and involveed in select/poll POSIX APIs.
 
 
+    config RT_USING_DFS_ROMFS
+        bool "Enable ReadOnly file system on flash"
+        default n
+
+    config RT_USING_DFS_RAMFS
+        bool "Enable RAM file system"
+        default n
+
+    config RT_USING_DFS_UFFS
+        bool "Enable UFFS file system: Ultra-low-cost Flash File System"
+        select RT_USING_MTD_NAND
+        default n
+
     config RT_USING_DFS_NFS
     config RT_USING_DFS_NFS
         bool "Using NFS v3 client file system"
         bool "Using NFS v3 client file system"
         depends on RT_USING_LWIP
         depends on RT_USING_LWIP

+ 3 - 1
components/dfs/filesystems/romfs/dfs_romfs.c

@@ -24,6 +24,8 @@
 #include <rtthread.h>
 #include <rtthread.h>
 #include <dfs.h>
 #include <dfs.h>
 #include <dfs_fs.h>
 #include <dfs_fs.h>
+#include <dfs_file.h>
+
 #include "dfs_romfs.h"
 #include "dfs_romfs.h"
 
 
 int dfs_romfs_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *data)
 int dfs_romfs_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *data)
@@ -190,7 +192,7 @@ int dfs_romfs_open(struct dfs_fd *file)
     struct romfs_dirent *dirent;
     struct romfs_dirent *dirent;
     struct romfs_dirent *root_dirent;
     struct romfs_dirent *root_dirent;
 
 
-    root_dirent = (struct romfs_dirent *)file->fs->data;
+    root_dirent = (struct romfs_dirent *)file->data;
 
 
     if (check_dirent(root_dirent) != 0)
     if (check_dirent(root_dirent) != 0)
         return -EIO;
         return -EIO;