SCCS-vsn: sys/ufs/lfs/lfs_alloc.c 7.37
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)lfs_alloc.c 7.36 (Berkeley) %G%
+ * @(#)lfs_alloc.c 7.37 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
printf("lfs_ialloc: allocate inode %d\n", new_ino);
#endif
printf("lfs_ialloc: allocate inode %d\n", new_ino);
#endif
- /* Read the appropriate block from the ifile. */
+ /*
+ * Remove the inode from the free list and write the free list
+ * back.
+ */
LFS_IENTRY(ifp, fs, new_ino, bp);
LFS_IENTRY(ifp, fs, new_ino, bp);
if (ifp->if_daddr != LFS_UNUSED_DADDR)
panic("lfs_ialloc: inuse inode on the free list");
if (ifp->if_daddr != LFS_UNUSED_DADDR)
panic("lfs_ialloc: inuse inode on the free list");
-
- /* Remove from the free list, set the access time, write it back. */
fs->lfs_free = ifp->if_nextfree;
ifp->if_st_atime = time.tv_sec;
fs->lfs_free = ifp->if_nextfree;
ifp->if_st_atime = time.tv_sec;
/* Create a vnode to associate with the inode. */
if (error = lfs_vcreate(pvp->v_mount, new_ino, &vp))
/* Create a vnode to associate with the inode. */
if (error = lfs_vcreate(pvp->v_mount, new_ino, &vp))
- * Read the appropriate block from the ifile. Set the inode entry to
- * unused, increment its version number and link it into the free chain.
+ * Set the ifile's inode entry to unused, increment its version number
+ * and link it into the free chain.
*/
LFS_IENTRY(ifp, fs, ino, bp);
ifp->if_daddr = LFS_UNUSED_DADDR;
++ifp->if_version;
ifp->if_nextfree = fs->lfs_free;
fs->lfs_free = ino;
*/
LFS_IENTRY(ifp, fs, ino, bp);
ifp->if_daddr = LFS_UNUSED_DADDR;
++ifp->if_version;
ifp->if_nextfree = fs->lfs_free;
fs->lfs_free = ino;
/* Set superblock modified bit and decrement file count. */
fs->lfs_fmod = 1;
/* Set superblock modified bit and decrement file count. */
fs->lfs_fmod = 1;