cifs_build_devname(9)
π cifs_build_devname(9) π
okay so bestie, welcome to the kernel API manual β this page lives in section 9 and it's about cifs_build_devname, which is literally the glow-up your UNC needs. no cap, it's a whole vibe. β¨
π NAME π
cifs_build_devname β build a devicename from a UNC and optional prepath π¦
β¨ SYNOPSIS β¨
char * cifs_build_devname (char *nodename , const char *prepath );
like, that's the whole signature. she's simple, she's iconic, she ate. π
πΈ ARGUMENTS πΈ
nodenameβ pointer to UNC string. yes bestie, a whole UNC. π«Άprepathβ pointer to prefixpath (orNULLif there isn't one). literallyNULLis a valid mood here, no prepath energy. π
π DESCRIPTION π
okay so here's the tea: this function builds a new cifs devicename after chasing a DFS referral. like, it goes and follows the referral first, then constructs the thing. very main character of it. π₯
the way it works is:
- it allocates a buffer big enough to hold the final thing β generous queen, always sizing up. π
- it copies the UNC from the
nodename, and then - it concatenates the
prepathonto the end of it β but only if there is one. no prepath? no problem, she just skips that step. π
and then it returns a pointer to the built string, or a ERR_PTR. yup, ERR_PTR β that's the "something went wrong bestie" signal, wrapped up in a pointer. π
β οΈ real talk though: the caller is responsible for freeing the returned string. this function is not your mom, she is NOT cleaning up after you. if you don't free it, that's a leak and it's giving memory issues. ngl, please free it. π§
π¦ SEE ALSO π¦
- Kernel file
./fs/smb/client/namespace.cβ go read it, iykyk π
and that's the page!! fr fr this one came from ./fs/smb/client, dated October 2026 β star of the Kernel API Manual lineup, periodt. βππ
π¦ 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