Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions components/dfs/dfs_v1/include/dfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ int dfs_init(void);
char *dfs_normalize_path(const char *directory, const char *filename);
const char *dfs_subdir(const char *directory, const char *filename);

int fd_is_open(const char *pathname);
struct dfs_fdtable *dfs_fdtable_get(void);

void dfs_lock(void);
void dfs_unlock(void);

Expand All @@ -93,6 +90,8 @@ void dfs_file_unlock(void);
void dfs_fm_lock(void);
void dfs_fm_unlock(void);

void fd_init(struct dfs_file *fd);

#ifdef DFS_USING_POSIX

/* FD APIs */
Expand All @@ -104,7 +103,7 @@ int fd_new(void);
struct dfs_file *fd_get(int fd);
void fd_release(int fd);

void fd_init(struct dfs_file *fd);
int fd_is_open(const char *pathname);
int fd_associate(struct dfs_fdtable *fdt, int fd, struct dfs_file *file);
int fd_get_fd_index(struct dfs_file *file);

Expand Down
7 changes: 4 additions & 3 deletions components/dfs/dfs_v1/src/dfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ char working_directory[DFS_PATH_MAX] = {"/"};
#endif

static struct dfs_fdtable _fdtab;
#ifdef DFS_USING_POSIX
static int fd_alloc(struct dfs_fdtable *fdt, int startfd);
#endif /* DFS_USING_POSIX */

/**
* @addtogroup group_device_virtual_file_system
Expand Down Expand Up @@ -477,8 +479,6 @@ rt_err_t sys_dup(int oldfd)
return newfd;
}

#endif /* DFS_USING_POSIX */

/**
* @ingroup group_fs_file_descriptor
*
Expand Down Expand Up @@ -696,6 +696,7 @@ int fd_associate(struct dfs_fdtable *fdt, int fd, struct dfs_file *file)
dfs_file_unlock();
return retfd;
}
#endif /* DFS_USING_POSIX */

/**
* @brief initialize a dfs file object.
Expand Down Expand Up @@ -1082,6 +1083,6 @@ int lsof(int argc, char *argv[])
MSH_CMD_EXPORT(lsof, list open files);
#endif /* RT_USING_SMART */

#endif
#endif /* RT_USING_FINSH */
/**@}*/