UFS/FFS split for LFS version 1; lfs moves down one level
SCCS-vsn: sys/ufs/lfs/lfs_inode.c 7.46
- * Copyright (c) 1982, 1986, 1989 Regents of the University of California.
+ * Copyright (c) 1986, 1989, 1991 Regents of the University of California.
* All rights reserved.
*
* %sccs.include.redist.c%
*
* All rights reserved.
*
* %sccs.include.redist.c%
*
- * @(#)lfs_inode.c 7.45 (Berkeley) %G%
+ * @(#)lfs_inode.c 7.46 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
-#include <ufs/quota.h>
-#include <ufs/inode.h>
-#include <ufs/ufsmount.h>
-#include <ufs/ufs_extern.h>
+#include <ufs/ufs/quota.h>
+#include <ufs/ufs/inode.h>
+#include <ufs/ufs/ufsmount.h>
+#include <ufs/ufs/ufs_extern.h>
-#include <lfs/lfs.h>
-#include <lfs/lfs_extern.h>
-
-extern int prtactive; /* 1 => print out reclaim of active vnodes */
+#include <ufs/lfs/lfs.h>
+#include <ufs/lfs/lfs_extern.h>
ino_t ino;
struct inode **ipp;
{
ino_t ino;
struct inode **ipp;
{
+ register struct lfs *fs;
register struct inode *ip;
register struct inode *ip;
- register struct vnode *vp;
-printf("lfs_iget ino %d\n", ino);
-
+ mntp = ITOV(pip)->v_mount;
+ fs = VFSTOUFS(mntp)->um_lfs;
if (ino < ROOTINO)
return (EINVAL);
if (ino < ROOTINO)
return (EINVAL);
return (0);
/* Allocate new vnode/inode. */
return (0);
/* Allocate new vnode/inode. */
- mntp = ITOV(pip)->v_mount;
- error = lfs_vcreate(mntp, ino, &nvp);
- if (error) {
+ if (error = lfs_vcreate(mntp, ino, &vp)) {
*ipp = NULL;
return (error);
}
*ipp = NULL;
return (error);
}
/*
* Put it onto its hash chain and lock it so that other requests for
/*
* Put it onto its hash chain and lock it so that other requests for
ufs_ihashins(ip);
/* Read in the disk contents for the inode, copy into the inode. */
ufs_ihashins(ip);
/* Read in the disk contents for the inode, copy into the inode. */
- fs = VFSTOUFS(mntp)->um_lfs;
if (error = bread(VFSTOUFS(mntp)->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
if (error = bread(VFSTOUFS(mntp)->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
- * take care of putting it back on the free list.
+ * return it to the free list.
*/
remque(ip);
ip->i_forw = ip;
*/
remque(ip);
ip->i_forw = ip;
ip->i_din = *lfs_ifind(fs, ino, bp->b_un.b_dino);
brelse(bp);
ip->i_din = *lfs_ifind(fs, ino, bp->b_un.b_dino);
brelse(bp);
- /* Initialize the vnode from the inode, check for aliases. */
- if (error = ufs_vinit(mntp, ip, &nip)) {
+ /*
+ * 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, &vp)) {
ufs_iput(ip);
*ipp = NULL;
return (error);
}
ufs_iput(ip);
*ipp = NULL;
return (error);
}
u_long length;
int flags;
{
u_long length;
int flags;
{
+ register struct lfs *fs;
struct buf *bp;
daddr_t lbn;
int error, offset, size;
struct buf *bp;
daddr_t lbn;
int error, offset, size;