* @brief Search for a mount point associated with a specific device ID in the mount tree. * * This function initiates a search for a mount point that is associated with the specified * device ID `dev_id` starting from the root mount point. It first checks the root mount point * directly, and if not found, it recursively searches the entire mount tree using the * internal helper function `_dfs
| 221 | * Otherwise, returns RT_NULL. |
| 222 | */ |
| 223 | struct dfs_mnt *dfs_mnt_dev_lookup(rt_device_t dev_id) |
| 224 | { |
| 225 | struct dfs_mnt *mnt = _root_mnt; |
| 226 | struct dfs_mnt *ret = RT_NULL; |
| 227 | |
| 228 | if (mnt) |
| 229 | { |
| 230 | dfs_lock(); |
| 231 | |
| 232 | if (mnt->dev_id == dev_id) |
| 233 | { |
| 234 | dfs_unlock(); |
| 235 | return mnt; |
| 236 | } |
| 237 | |
| 238 | ret = _dfs_mnt_dev_lookup(mnt, dev_id); |
| 239 | |
| 240 | dfs_unlock(); |
| 241 | } |
| 242 | |
| 243 | return ret; |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * @brief Look up the mount point associated with a given full path. |
no test coverage detected