-lfs_vget(mntp, ino, vpp)
- struct mount *mntp;
- ino_t ino;
- struct vnode **vpp;
-{
- register struct lfs *fs;
- register struct inode *ip;
- struct buf *bp;
- struct vnode *vp;
- struct ufsmount *ump;
- dev_t dev;
- int error;
-
-#ifdef VERBOSE
- printf("lfs_vget\n");
-#endif
- ump = VFSTOUFS(mntp);
- dev = ump->um_dev;
- if ((*vpp = ufs_ihashget(dev, ino)) != NULL)
- return (0);
-
- /* Allocate new vnode/inode. */
- if (error = lfs_vcreate(mntp, ino, &vp)) {
- *vpp = NULL;
- return (error);
- }
- /*
- * Put it onto its hash chain and lock it so that other requests for
- * this inode will block if they arrive while we are sleeping waiting
- * for old data structures to be purged or for the contents of the
- * disk portion of this inode to be read.
- */
- ip = VTOI(vp);
- ufs_ihashins(ip);
-
- /* Read in the disk contents for the inode, copy into the inode. */
- ip->i_lfs = fs = ump->um_lfs;
- if (error = bread(ump->um_devvp, lfs_itod(fs, ino),
- (int)fs->lfs_bsize, NOCRED, &bp)) {
- /*
- * The inode does not contain anything useful, so it
- * would be misleading to leave it on its hash chain.
- * Iput() will return it to the free list.
- */
- remque(ip);
- ip->i_forw = ip;
- ip->i_back = ip;
-
- /* Unlock and discard unneeded inode. */
- ufs_iput(ip);
- brelse(bp);
- *vpp = NULL;
- return (error);
- }
- ip->i_din = *lfs_ifind(fs, ino, bp->b_un.b_dino);
- brelse(bp);
-
- /*
- * Initialize the vnode from the inode, check for aliases. In all
- * cases re-init ip, the underlying vnode/inode may have changed.
- */
- if (error = ufs_vinit(mntp, &lfs_specops, LFS_FIFOOPS, &vp)) {
- ufs_iput(ip);
- *vpp = NULL;
- return (error);
- }
- /*
- * Finish inode initialization now that aliasing has been resolved.
- */
- ip->i_devvp = ump->um_devvp;
- VREF(ip->i_devvp);
- *vpp = vp;
- return (0);
-}
-
-int
-lfs_update(vp, ta, tm, waitfor)
- register struct vnode *vp;
- struct timeval *ta, *tm;
- int waitfor;