VFS_GETNEWFSID(9)
π VFS_GETNEWFSID(9) π
ok bestie so this is a page from the Kernel Developer's Manual (section 9, kernel land, we're in the deep end and it's giving main character energy π«Ά) and it's all about one lil function that hands out file system IDs like they're friendship bracelets.
β¨ NAME β¨
vfs_getnewfsid β allocate a new file system identifier π
πΈ SYNOPSIS πΈ
#include <sys/param.h>
#include <sys/mount.h>
void
vfs_getnewfsid(struct mount *mp);
like yes it takes one (1) pointer and returns nothing, humble of it honestly π
π¦ DESCRIPTION π¦
okay so vfs_getnewfsid() allocates a brand new file system identifier for the mount point you give it. no cap, that's the whole job.
File systems typically call vfs_getnewfsid() in their mount routine so they can snag a unique ID within the system β and that ID can later be used to uniquely identify the file system through calls like vfs_getvfs(9). it's giving "get your own name tag at the party so people know who you are" π
the actual fsid is made up of two 32 bit integers, and they live in the statfs structure of mp. breaking it down:
- the first integer is unique in the set of mounted file systems β¨
- the second holds the file system type π«
and here's the struct, verbatim, no edits bestie:
typedef struct fsid {
int32_t val[2];
} fsid_t;
π§ PSEUDOCODE π§
here's how it looks inside a mount routine, so you can clock the vibe:
xxx_mount(struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct thread *td)
{
...
vfs_getnewfsid(mp);
...
}
like, you literally just call it in the middle of everything else and it does its thing. obsessed. π
π SEE ALSO π
vfs_getvfs(9)β the bestie that looks up the fsid later π
π AUTHORS π
This manual page was written by Chad David <davidc@acns.ab.ca>.
fr fr that's the whole page. it's short, it's sweet, it ate and left no crumbs π
kay bye ily, this page came from Debian and it's dated November 21, 2001 β yeah it's a vintage icon, we stan a classic πβ¨π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms