* @brief Dump all directory entries in the hash table for debugging * * @param[in] argc Number of command line arguments (unused) * @param[in] argv Array of command line arguments (unused) * * @return int Always returns 0 indicating success * * @note Prints each dentry's full path, memory address and reference count */
| 496 | * @note Prints each dentry's full path, memory address and reference count |
| 497 | */ |
| 498 | int dfs_dentry_dump(int argc, char** argv) |
| 499 | { |
| 500 | int index = 0; |
| 501 | struct dfs_dentry *entry = RT_NULL; |
| 502 | |
| 503 | dfs_lock(); |
| 504 | for (index = 0; index < DFS_DENTRY_HASH_NR; index ++) |
| 505 | { |
| 506 | rt_list_for_each_entry(entry, &hash_head.head[index], hashlist) |
| 507 | { |
| 508 | printf("dentry: %s%s @ %p, ref_count = %zd\n", entry->mnt->fullpath, entry->pathname, entry, (size_t)rt_atomic_load(&entry->ref_count)); |
| 509 | } |
| 510 | } |
| 511 | dfs_unlock(); |
| 512 | |
| 513 | return 0; |
| 514 | } |
| 515 | MSH_CMD_EXPORT_ALIAS(dfs_dentry_dump, dentry_dump, dump dentry in the system); |
nothing calls this directly
no test coverage detected