mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-28 15:55:28 +08:00
remove dfs_config.h file and fix filesystem lookup issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1332 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
c8cb831c93
commit
24dfbe437d
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
+------------------------------------------------------------------------------
|
|
||||||
| Project : Device Filesystem
|
|
||||||
+------------------------------------------------------------------------------
|
|
||||||
| Copyright 2004, 2005 www.fayfayspace.org.
|
|
||||||
| All rights reserved.
|
|
||||||
|------------------------------------------------------------------------------
|
|
||||||
| File : dfs_opts.h, the option definitions of Device FileSystem
|
|
||||||
|------------------------------------------------------------------------------
|
|
||||||
| Chang Logs:
|
|
||||||
| Date Author Notes
|
|
||||||
| 2005-01-22 ffxz The first version.
|
|
||||||
+------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __DFS_CONFIG_H__
|
|
||||||
#define __DFS_CONFIG_H__
|
|
||||||
|
|
||||||
/* the max type of filesystem */
|
|
||||||
#define DFS_FILESYSTEM_TYPES_MAX 4
|
|
||||||
|
|
||||||
/* the max length of path name */
|
|
||||||
#define DFS_PATH_MAX 256
|
|
||||||
|
|
||||||
/* the size of sector */
|
|
||||||
#define SECTOR_SIZE 512
|
|
||||||
|
|
||||||
#define DFS_DEBUG_INFO 0x01
|
|
||||||
#define DFS_DEBUG_WARNING 0x02
|
|
||||||
#define DFS_DEBUG_ERROR 0x04
|
|
||||||
#define DFS_DEBUG_LEVEL (DFS_DEBUG_INFO | DFS_DEBUG_WARNING | DFS_DEBUG_ERROR)
|
|
||||||
|
|
||||||
/* #define DFS_DEBUG */
|
|
||||||
#ifdef DFS_DEBUG
|
|
||||||
#define dfs_log(level, x) do { if (level & DFS_DEBUG_LEVEL) \
|
|
||||||
{rt_kprintf("DFS %s, %d:", __FUNCTION__, __LINE__); rt_kprintf x; \
|
|
||||||
rt_kprintf ("\n");}}while (0)
|
|
||||||
#else
|
|
||||||
#define dfs_log(level, x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
|||||||
#define __DFS_DEF_H__
|
#define __DFS_DEF_H__
|
||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include <dfs_config.h>
|
|
||||||
|
|
||||||
#ifndef __D_FS__
|
#ifndef __D_FS__
|
||||||
#define __D_FS__
|
#define __D_FS__
|
||||||
@ -34,6 +33,32 @@
|
|||||||
#define DFS_F_EOF 0x04000000
|
#define DFS_F_EOF 0x04000000
|
||||||
#define DFS_F_ERR 0x08000000
|
#define DFS_F_ERR 0x08000000
|
||||||
|
|
||||||
|
#ifndef DFS_PATH_MAX
|
||||||
|
#define DFS_PATH_MAX 256
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SECTOR_SIZE
|
||||||
|
#define SECTOR_SIZE 512
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef DFS_FILESYSTEM_TYPES_MAX
|
||||||
|
#define DFS_FILESYSTEM_TYPES_MAX 4
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DFS_DEBUG_INFO 0x01
|
||||||
|
#define DFS_DEBUG_WARNING 0x02
|
||||||
|
#define DFS_DEBUG_ERROR 0x04
|
||||||
|
#define DFS_DEBUG_LEVEL (DFS_DEBUG_INFO | DFS_DEBUG_WARNING | DFS_DEBUG_ERROR)
|
||||||
|
|
||||||
|
/* #define DFS_DEBUG */
|
||||||
|
#ifdef DFS_DEBUG
|
||||||
|
#define dfs_log(level, x) do { if (level & DFS_DEBUG_LEVEL) \
|
||||||
|
{rt_kprintf("DFS %s, %d:", __FUNCTION__, __LINE__); rt_kprintf x; \
|
||||||
|
rt_kprintf ("\n");}}while (0)
|
||||||
|
#else
|
||||||
|
#define dfs_log(level, x)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(RT_USING_NEWLIB)
|
#if defined(RT_USING_NEWLIB)
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/stat.h> /* used for struct stat */
|
#include <sys/stat.h> /* used for struct stat */
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
#define __DFS_FS_H__
|
#define __DFS_FS_H__
|
||||||
|
|
||||||
#include <dfs_def.h>
|
#include <dfs_def.h>
|
||||||
#include <dfs_config.h>
|
|
||||||
|
|
||||||
/* Pre-declaration */
|
/* Pre-declaration */
|
||||||
struct dfs_filesystem;
|
struct dfs_filesystem;
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
#include <dfs.h>
|
#include <dfs.h>
|
||||||
#include <dfs_fs.h>
|
#include <dfs_fs.h>
|
||||||
#include <dfs_config.h>
|
|
||||||
#include <dfs_file.h>
|
#include <dfs_file.h>
|
||||||
|
|
||||||
#define NO_WORKING_DIR "system does not support working dir\n"
|
#define NO_WORKING_DIR "system does not support working dir\n"
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
* Date Author Notes
|
* Date Author Notes
|
||||||
* 2005-02-22 Bernard The first version.
|
* 2005-02-22 Bernard The first version.
|
||||||
* 2010-06-30 Bernard Optimize for RT-Thread RTOS
|
* 2010-06-30 Bernard Optimize for RT-Thread RTOS
|
||||||
|
* 2011-03-12 Bernard fix the filesystem lookup issue.
|
||||||
*/
|
*/
|
||||||
#include <dfs_fs.h>
|
#include <dfs_fs.h>
|
||||||
#include <dfs_file.h>
|
#include <dfs_file.h>
|
||||||
@ -86,7 +87,7 @@ struct dfs_filesystem* dfs_filesystem_lookup(const char *path)
|
|||||||
dfs_lock();
|
dfs_lock();
|
||||||
|
|
||||||
/* lookup it in the filesystem table */
|
/* lookup it in the filesystem table */
|
||||||
for (index = 0; index < DFS_FILESYSTEMS_MAX + 1; index++)
|
for (index = 0; index < DFS_FILESYSTEMS_MAX; index++)
|
||||||
{
|
{
|
||||||
if (filesystem_table[index].path == RT_NULL) continue;
|
if (filesystem_table[index].path == RT_NULL) continue;
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user