MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_mnt_dev_lookup

Function dfs_mnt_dev_lookup

components/dfs/dfs_v2/src/dfs_mnt.c:223–244  ·  view source on GitHub ↗

* @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

Source from the content-addressed store, hash-verified

221 * Otherwise, returns RT_NULL.
222 */
223struct 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.

Callers 1

dfs_mkfsFunction · 0.85

Calls 3

_dfs_mnt_dev_lookupFunction · 0.85
dfs_lockFunction · 0.70
dfs_unlockFunction · 0.70

Tested by

no test coverage detected