- for (ip = ih->ih_chain[0]; ip != (struct inode *)ih; ip = ip->i_forw)
- if (ino == ip->i_number && dev == ip->i_dev) {
- /*
- * Following is essentially an inline expanded
- * copy of igrab(), expanded inline for speed,
- * and so that the test for a mounted on inode
- * can be deferred until after we are sure that
- * the inode isn't busy.
- */
- if ((ip->i_flag&ILOCKED) != 0) {
- ip->i_flag |= IWANT;
- sleep((caddr_t)ip, PINOD);
- goto loop;
- }
- if ((ip->i_flag&IMOUNT) != 0) {
- for (mp = &mount[0]; mp < &mount[NMOUNT]; mp++)
- if(mp->m_inodp == ip) {
- dev = mp->m_dev;
- fs = mp->m_bufp->b_un.b_fs;
- ino = ROOTINO;
- goto loop;
- }
- panic("no imt");
- }
- if (ip->i_count == 0) { /* ino on free list */
- if (iq = ip->i_freef)
- iq->i_freeb = ip->i_freeb;
- else
- ifreet = ip->i_freeb;
- *ip->i_freeb = iq;
- ip->i_freef = NULL;
- ip->i_freeb = NULL;
- }
- ip->i_count++;
- ip->i_flag |= ILOCKED;
- return(ip);
+loop:
+ for (ip = ih->ih_chain[0]; ip != (struct inode *)ih; ip = ip->i_forw) {
+ if (ino != ip->i_number || dev != ip->i_dev)
+ continue;
+ if ((ip->i_flag&ILOCKED) != 0) {
+ ip->i_flag |= IWANT;
+ sleep((caddr_t)ip, PINOD);
+ goto loop;