Date: Wed, 15 Feb 2006 03:53:59 +0100 From: Maxime Henrion <mux@FreeBSD.org> To: Pranav Peshwe <pranavpeshwe@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Userland version of struct vnode ? Message-ID: <20060215025359.GG55746@elvis.mu.org> In-Reply-To: <cdfd7d6d0602141818x39a53077ofcf0d52ddad069e7@mail.gmail.com> References: <cdfd7d6d0602141818x39a53077ofcf0d52ddad069e7@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Pranav Peshwe wrote: > Hello, > Why is the 'Userland version' struct vnode created i.e struct > xvnode (in vnode.h) ? The comment says that it is 'for sysctl'.There are > also userland versions of struct file and struct tty.Can anybody please > explain about their use ? Those structures exist so that changing the size of the kernel struct vnode has no impact for the userland tools. If the sysctls were giving a struct vnode instead of a struct xvnode, every change in the layout or size of struct vnode would break the ABI and require a rebuild of all the userland tools gathering vnodes from the sysctl. It also allows the sysctl code to only give the meaningful fields back to userland, reducing the amount of memory that needs to be copied. Cheers, Maxime
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060215025359.GG55746>
