* @brief Register a filesystem type * * This function registers a new filesystem type with the global filesystem type list. * * @param[in] fs Pointer to the filesystem type to register * @return int 0 on success, or a negative error code on failure */
| 79 | * @return int 0 on success, or a negative error code on failure |
| 80 | */ |
| 81 | int dfs_register(struct dfs_filesystem_type *fs) |
| 82 | { |
| 83 | int ret = 0; |
| 84 | struct dfs_filesystem_type **type = _find_filesystem(fs->fs_ops->name); |
| 85 | |
| 86 | LOG_D("register %s file system.", fs->fs_ops->name); |
| 87 | |
| 88 | if (*type) |
| 89 | { |
| 90 | ret = -EBUSY; |
| 91 | } |
| 92 | else |
| 93 | { |
| 94 | *type = fs; |
| 95 | } |
| 96 | |
| 97 | return ret; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * @brief Unregister a filesystem type |
no test coverage detected