Implementation stubs for the new VFS API.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15400 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
1e2ebee781
commit
ecf1ede710
|
@ -124,7 +124,11 @@ static const struct vfs_fatfs_driver_vmt driver_vmt = {
|
||||||
.set_cwd = drv_set_cwd,
|
.set_cwd = drv_set_cwd,
|
||||||
.get_cwd = drv_get_cwd,
|
.get_cwd = drv_get_cwd,
|
||||||
.open_dir = drv_open_dir,
|
.open_dir = drv_open_dir,
|
||||||
.open_file = drv_open_file
|
.open_file = drv_open_file,
|
||||||
|
.unlink = drv_unlink_unimpl,
|
||||||
|
.rename = drv_rename_unimpl,
|
||||||
|
.mkdir = drv_mkdir_unimpl,
|
||||||
|
.rmdir = drv_rmdir_unimpl
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *node_dir_addref(void *instance);
|
static void *node_dir_addref(void *instance);
|
||||||
|
|
|
@ -56,10 +56,14 @@ static msg_t drv_open_file(void *instance,
|
||||||
vfs_file_node_c **vfnpp);
|
vfs_file_node_c **vfnpp);
|
||||||
|
|
||||||
static const struct vfs_overlay_driver_vmt driver_vmt = {
|
static const struct vfs_overlay_driver_vmt driver_vmt = {
|
||||||
.set_cwd = drv_set_cwd,
|
.set_cwd = drv_set_cwd,
|
||||||
.get_cwd = drv_get_cwd,
|
.get_cwd = drv_get_cwd,
|
||||||
.open_dir = drv_open_dir,
|
.open_dir = drv_open_dir,
|
||||||
.open_file = drv_open_file
|
.open_file = drv_open_file,
|
||||||
|
.unlink = drv_unlink_unimpl,
|
||||||
|
.rename = drv_rename_unimpl,
|
||||||
|
.mkdir = drv_mkdir_unimpl,
|
||||||
|
.rmdir = drv_rmdir_unimpl
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *node_dir_addref(void *instance);
|
static void *node_dir_addref(void *instance);
|
||||||
|
@ -68,10 +72,10 @@ static msg_t node_dir_first(void *instance, vfs_direntry_info_t *dip);
|
||||||
static msg_t node_dir_next(void *instance, vfs_direntry_info_t *dip);
|
static msg_t node_dir_next(void *instance, vfs_direntry_info_t *dip);
|
||||||
|
|
||||||
static const struct vfs_overlay_dir_node_vmt dir_node_vmt = {
|
static const struct vfs_overlay_dir_node_vmt dir_node_vmt = {
|
||||||
.addref = node_dir_addref,
|
.addref = node_dir_addref,
|
||||||
.release = node_dir_release,
|
.release = node_dir_release,
|
||||||
.dir_first = node_dir_first,
|
.dir_first = node_dir_first,
|
||||||
.dir_next = node_dir_next
|
.dir_next = node_dir_next
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -56,10 +56,14 @@ static msg_t drv_open_file(void *instance,
|
||||||
vfs_file_node_c **vfnpp);
|
vfs_file_node_c **vfnpp);
|
||||||
|
|
||||||
static const struct vfs_sfs_driver_vmt driver_vmt = {
|
static const struct vfs_sfs_driver_vmt driver_vmt = {
|
||||||
.set_cwd = drv_set_cwd,
|
.set_cwd = drv_set_cwd,
|
||||||
.get_cwd = drv_get_cwd,
|
.get_cwd = drv_get_cwd,
|
||||||
.open_dir = drv_open_dir,
|
.open_dir = drv_open_dir,
|
||||||
.open_file = drv_open_file
|
.open_file = drv_open_file,
|
||||||
|
.unlink = drv_unlink_unimpl,
|
||||||
|
.rename = drv_rename_unimpl,
|
||||||
|
.mkdir = drv_mkdir_unimpl,
|
||||||
|
.rmdir = drv_rmdir_unimpl
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *node_dir_addref(void *instance);
|
static void *node_dir_addref(void *instance);
|
||||||
|
@ -68,10 +72,10 @@ static msg_t node_dir_first(void *instance, vfs_direntry_info_t *dip);
|
||||||
static msg_t node_dir_next(void *instance, vfs_direntry_info_t *dip);
|
static msg_t node_dir_next(void *instance, vfs_direntry_info_t *dip);
|
||||||
|
|
||||||
static const struct vfs_sfs_dir_node_vmt dir_node_vmt = {
|
static const struct vfs_sfs_dir_node_vmt dir_node_vmt = {
|
||||||
.addref = node_dir_addref,
|
.addref = node_dir_addref,
|
||||||
.release = node_dir_release,
|
.release = node_dir_release,
|
||||||
.dir_first = node_dir_first,
|
.dir_first = node_dir_first,
|
||||||
.dir_next = node_dir_next
|
.dir_next = node_dir_next
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *node_file_addref(void *instance);
|
static void *node_file_addref(void *instance);
|
||||||
|
|
|
@ -59,7 +59,11 @@ static const struct vfs_streams_driver_vmt driver_vmt = {
|
||||||
.set_cwd = drv_set_cwd,
|
.set_cwd = drv_set_cwd,
|
||||||
.get_cwd = drv_get_cwd,
|
.get_cwd = drv_get_cwd,
|
||||||
.open_dir = drv_open_dir,
|
.open_dir = drv_open_dir,
|
||||||
.open_file = drv_open_file
|
.open_file = drv_open_file,
|
||||||
|
.unlink = drv_unlink_unimpl,
|
||||||
|
.rename = drv_rename_unimpl,
|
||||||
|
.mkdir = drv_mkdir_unimpl,
|
||||||
|
.rmdir = drv_rmdir_unimpl
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *node_dir_addref(void *instance);
|
static void *node_dir_addref(void *instance);
|
||||||
|
|
|
@ -56,10 +56,14 @@ static msg_t drv_open_file(void *instance,
|
||||||
vfs_file_node_c **vfnpp);
|
vfs_file_node_c **vfnpp);
|
||||||
|
|
||||||
static const struct vfs_template_driver_vmt driver_vmt = {
|
static const struct vfs_template_driver_vmt driver_vmt = {
|
||||||
.set_cwd = drv_set_cwd,
|
.set_cwd = drv_set_cwd,
|
||||||
.get_cwd = drv_get_cwd,
|
.get_cwd = drv_get_cwd,
|
||||||
.open_dir = drv_open_dir,
|
.open_dir = drv_open_dir,
|
||||||
.open_file = drv_open_file
|
.open_file = drv_open_file,
|
||||||
|
.unlink = drv_unlink_unimpl,
|
||||||
|
.rename = drv_rename_unimpl,
|
||||||
|
.mkdir = drv_mkdir_unimpl,
|
||||||
|
.rmdir = drv_rmdir_unimpl
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *node_dir_addref(void *instance);
|
static void *node_dir_addref(void *instance);
|
||||||
|
@ -68,10 +72,10 @@ static msg_t node_dir_first(void *instance, vfs_direntry_info_t *dip);
|
||||||
static msg_t node_dir_next(void *instance, vfs_direntry_info_t *dip);
|
static msg_t node_dir_next(void *instance, vfs_direntry_info_t *dip);
|
||||||
|
|
||||||
static const struct vfs_template_dir_node_vmt dir_node_vmt = {
|
static const struct vfs_template_dir_node_vmt dir_node_vmt = {
|
||||||
.addref = node_dir_addref,
|
.addref = node_dir_addref,
|
||||||
.release = node_dir_release,
|
.release = node_dir_release,
|
||||||
.dir_first = node_dir_first,
|
.dir_first = node_dir_first,
|
||||||
.dir_next = node_dir_next
|
.dir_next = node_dir_next
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *node_file_addref(void *instance);
|
static void *node_file_addref(void *instance);
|
||||||
|
|
|
@ -120,6 +120,13 @@ extern "C" {
|
||||||
const char *path,
|
const char *path,
|
||||||
int flags,
|
int flags,
|
||||||
vfs_node_c **vnpp);
|
vfs_node_c **vnpp);
|
||||||
|
msg_t drv_unlink_unimpl(void *instance, const char *path);
|
||||||
|
msg_t drv_rename_unimpl(void *instance,
|
||||||
|
const char *oldpath,
|
||||||
|
const char *newpath);
|
||||||
|
msg_t drv_mkdir_unimpl(void *instance,
|
||||||
|
const char *path);
|
||||||
|
msg_t drv_rmdir_unimpl(void *instance, const char *path);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -83,4 +83,40 @@ msg_t vfsDrvOpen(vfs_driver_c *drvp,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msg_t drv_unlink_unimpl(void *instance, const char *path) {
|
||||||
|
|
||||||
|
(void)instance;
|
||||||
|
(void)path;
|
||||||
|
|
||||||
|
return CH_RET_ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_t drv_rename_unimpl(void *instance,
|
||||||
|
const char *oldpath,
|
||||||
|
const char *newpath) {
|
||||||
|
|
||||||
|
(void)instance;
|
||||||
|
(void)oldpath;
|
||||||
|
(void)newpath;
|
||||||
|
|
||||||
|
return CH_RET_ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_t drv_mkdir_unimpl(void *instance,
|
||||||
|
const char *path) {
|
||||||
|
|
||||||
|
(void)instance;
|
||||||
|
(void)path;
|
||||||
|
|
||||||
|
return CH_RET_ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
msg_t drv_rmdir_unimpl(void *instance, const char *path) {
|
||||||
|
|
||||||
|
(void)instance;
|
||||||
|
(void)path;
|
||||||
|
|
||||||
|
return CH_RET_ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
Loading…
Reference in New Issue