From owner-freebsd-hackers Thu Jun 21 11: 8:55 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 2DF6437B401 for ; Thu, 21 Jun 2001 11:08:52 -0700 (PDT) (envelope-from zzhang@cs.binghamton.edu) Received: from onyx (onyx.cs.binghamton.edu [128.226.140.171]) by bingnet2.cc.binghamton.edu (8.11.4/8.11.4) with ESMTP id f5LI8oU18771 for ; Thu, 21 Jun 2001 14:08:50 -0400 (EDT) Date: Thu, 21 Jun 2001 14:08:49 -0400 (EDT) From: Zhihui Zhang X-Sender: zzhang@onyx To: freebsd-hackers@freebsd.org Subject: Confusion with mknod() and devfs Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG There is following comment inside ufs_mknod() which says /* * Remove inode, then reload it through VFS_VGET so it is * checked to see if it is an alias of an existing entry in * the inode cache. */ I really can not understand it. For each new disk inode, we call ufs_vinit() from ffs_vget() and ufs_vinit() calls addaliasu() to add the vnode to the alias list. So why reload? The alias vnode is already handled after it calls ufs_makeinode(). Since DEVFS is in use, will it prevent a user from creating alias names to the same device? If so, there is no need to handle alias in the kernel. According to the red daemon book, alias vnodes are used to make cache coherent (vp as a key). But getblk() stuff does not seem to check it. This makes me feel the code is there for historical reasons. Thanks for any clarification. -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message