ceph_mdsc_build_path(9)
π ceph_mdsc_build_path(9) π
okay so this is a page from the Kernel API Manual β yes, the kernel, bestie, we're in the kernel now β and it's literally about building a path string to a given dentry. that's the whole vibe. β¨
π SYNOPSIS π
char * ceph_mdsc_build_path (struct ceph_mds_client *mdsc , struct
dentry *dentry , struct ceph_path_info *path_info , int for_wire );
like, four args, returns a char *, we move π
πΈ ARGUMENTS πΈ
mdscβ the mds client, your main character struct π«Άdentryβ the dentry we're building a path to, like the destination of the whole journeypath_infoβ the output situation: path, length, base ino+snap, plus thefreepathownership flag (so you know who's responsible for freeing, very important, don't ghost your memory management π«Ά)for_wireβ is this path actually getting sent to the MDS? yes/no, that's it
π¦ DESCRIPTION π¦
So we're building a string that represents the path to the dentry. Honestly it's mostly called for two totally different purposes:
- we need to build a path string to send to the MDS (
for_wire == true) - we need a path string for local presentation (e.g.
debugfs) (for_wire == false)
The path is built in reverse, starting with the dentry β iconic, backwards, we love her β and then we walk back up toward the root, building the path until the first non-snapped inode is reached (for_wire) or the root inode is reached (!for_wire).
Also, and this is the detail that eats: hidden .snap dirs get encoded as a double /. Like, literally:
foo/.snap/bar -> foo//bar
no cap, that's the encoding. π₯
β SEE ALSO β
- Kernel file
./fs/ceph/mds_client.c ceph_mdsc_wait_for_reset(9)
and that's the whole page, bestie!! huge love to ./fs/ceph for putting it out, October 2026 edition, version vibes included πππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms