SCCS-vsn: sys/ufs/lfs/lfs_alloc.c 7.35
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)lfs_alloc.c 7.34 (Berkeley) %G%
+ * @(#)lfs_alloc.c 7.35 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
/* Allocate a new inode. */
/* ARGSUSED */
int
/* Allocate a new inode. */
/* ARGSUSED */
int
-lfs_ialloc(pip, notused, cred, ipp)
- INODE *pip, **ipp;
+lfs_valloc(pvp, notused, cred, vpp)
+ VNODE *pvp, **vpp;
int notused;
UCRED *cred;
{
int notused;
UCRED *cred;
{
int error;
/* Get the head of the freelist. */
int error;
/* Get the head of the freelist. */
new_ino = fs->lfs_free;
if (new_ino == LFS_UNUSED_INUM) {
/*
new_ino = fs->lfs_free;
if (new_ino == LFS_UNUSED_INUM) {
/*
lfs_bwrite(bp);
/* Create a vnode to associate with the inode. */
lfs_bwrite(bp);
/* Create a vnode to associate with the inode. */
- error = lfs_vcreate(ITOV(pip)->v_mount, new_ino, &vp);
- if (error)
+ if (error = lfs_vcreate(pvp->v_mount, new_ino, &vp))
+ *vpp = vp;
+ ip = VTOI(vp);
+ VREF(ip->i_devvp);
/* Set a new generation number for this inode. */
if (++nextgennumber < (u_long)time.tv_sec)
/* Set a new generation number for this inode. */
if (++nextgennumber < (u_long)time.tv_sec)
ino_t ino;
VNODE **vpp;
{
ino_t ino;
VNODE **vpp;
{
+ extern struct vnodeops lfs_vnodeops;
INODE *ip;
UFSMOUNT *ump;
int error, i;
INODE *ip;
UFSMOUNT *ump;
int error, i;
/* Initialize the inode. */
ip = VTOI(*vpp);
/* Initialize the inode. */
ip = VTOI(*vpp);
- ip->i_diroff = 0;
- ip->i_devvp = ump->um_devvp;
- ip->i_dev = ump->um_dev;
- ip->i_lfs = ump->um_lfs;
- ip->i_lockf = 0;
+ ip->i_diroff = 0;
+ ip->i_lockf = 0;
+ ip->i_dev = ump->um_dev;
ip->i_number = ip->i_din.di_inum = ino;
ip->i_number = ip->i_din.di_inum = ino;
+ ip->i_lfs = ump->um_lfs;
+ ip->i_devvp = ump->um_devvp;
#ifdef QUOTA
for (i = 0; i < MAXQUOTAS; i++)
ip->i_dquot[i] = NODQUOT;
#endif
#ifdef QUOTA
for (i = 0; i < MAXQUOTAS; i++)
ip->i_dquot[i] = NODQUOT;
#endif
- VREF(ip->i_devvp); /* XXX: Why? */
return (0);
}
/* Free an inode. */
/* ARGUSED */
void
return (0);
}
/* Free an inode. */
/* ARGUSED */
void
-lfs_ifree(ip, notused1, notused2)
- INODE *ip;
+lfs_vfree(vp, notused1, notused2)
+ VNODE *vp;
ino_t notused1;
int notused2;
{
BUF *bp;
IFILE *ifp;
ino_t notused1;
int notused2;
{
BUF *bp;
IFILE *ifp;
struct lfs *fs;
ino_t ino;
struct lfs *fs;
ino_t ino;
#ifdef ALLOCPRINT
printf("lfs_ifree: free %d\n", ip->i_number);
#endif
#ifdef ALLOCPRINT
printf("lfs_ifree: free %d\n", ip->i_number);
#endif