Date: Mon, 28 Sep 1998 00:53:50 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: bf20761@binghamton.edu (zhihuizhang) Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Question on vnode's type Message-ID: <199809280053.RAA07815@usr05.primenet.com> In-Reply-To: <Pine.SOL.L3.93.980926234110.17763A-100000@bingsun2> from "zhihuizhang" at Sep 26, 98 11:43:45 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> There are nine types of vnodes available: VNON, VREG, VDIR, VBLK, VCHR, > VLNK, VSOCK, VFIFO, VBAD. Can anyone describe for me their usages? > > Any help is appreciated. VNON No type VREG A regular file VDIR A directory VBLK A block special device VCHR A character special device VLNK A symbolic link VSOCK A socket VFIFO A FIFO (named pipe) VBAD An old style bad sector map It is also useful to know: VFIFO uses the "struct fileops" from /sys/kern/sys_pipe.c VSOCK uses the "struct fileops" from /sys/kern/sys_socket.c(*) Everything else uses the one from /sys/kern/vfs_vnops.c (*) The System V IPC calls are implemented using the POSIX domain sockets. In general, the VFIFO/VSOCK code, which is why "struct fileops" is used at all, is an artifact of an incomplete integration of the VFS code into the kernel. In general, the problems associated with this are: (1) You can't use advisory locking on VFIFO/VSOCK vnodes. (2) You must take extra indirection overhead on all read, write, ioctl, poll, and close calls. (3) No other normal vnode operations are permitted, except as they are special cased (e.g., an fcntl(2) call to F_SETOWN/F_GETOWN won't work on a DTYPE_PIPE/DTYPE_FIFO, but will work on a DTYPE_VNODE/DTYPE_SOCKET). (4) It offends people who have aesthetic sensibilities. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809280053.RAA07815>