ip 228 console.c consoleread(struct inode *ip, char *dst, int n) ip 233 console.c iunlock(ip); ip 240 console.c ilock(ip); ip 260 console.c ilock(ip); ip 266 console.c consolewrite(struct inode *ip, char *buf, int n) ip 270 console.c iunlock(ip); ip 275 console.c ilock(ip); ip 17 exec.c struct inode *ip; ip 22 exec.c if((ip = namei(path)) == 0){ ip 26 exec.c ilock(ip); ip 30 exec.c if(readi(ip, (char*)&elf, 0, sizeof(elf)) < sizeof(elf)) ip 41 exec.c if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph)) ip 49 exec.c if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0) ip 52 exec.c iunlockput(ip); ip 54 exec.c ip = 0; ip 102 exec.c if(ip){ ip 103 exec.c iunlockput(ip); ip 76 file.c iput(ff.ip); ip 86 file.c ilock(f->ip); ip 87 file.c stati(f->ip, st); ip 88 file.c iunlock(f->ip); ip 105 file.c ilock(f->ip); ip 106 file.c if((r = readi(f->ip, addr, f->off, n)) > 0) ip 108 file.c iunlock(f->ip); ip 140 file.c ilock(f->ip); ip 141 file.c if ((r = writei(f->ip, addr + i, f->off, n1)) > 0) ip 143 file.c iunlock(f->ip); ip 7 file.h struct inode *ip; ip 200 fs.c iupdate(struct inode *ip) ip 205 fs.c bp = bread(ip->dev, IBLOCK(ip->inum, sb)); ip 206 fs.c dip = (struct dinode*)bp->data + ip->inum%IPB; ip 207 fs.c dip->type = ip->type; ip 208 fs.c dip->major = ip->major; ip 209 fs.c dip->minor = ip->minor; ip 210 fs.c dip->nlink = ip->nlink; ip 211 fs.c dip->size = ip->size; ip 212 fs.c memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); ip 223 fs.c struct inode *ip, *empty; ip 229 fs.c for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){ ip 230 fs.c if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip 231 fs.c ip->ref++; ip 233 fs.c return ip; ip 235 fs.c if(empty == 0 && ip->ref == 0) // Remember empty slot. ip 236 fs.c empty = ip; ip 243 fs.c ip = empty; ip 244 fs.c ip->dev = dev; ip 245 fs.c ip->inum = inum; ip 246 fs.c ip->ref = 1; ip 247 fs.c ip->flags = 0; ip 250 fs.c return ip; ip 256 fs.c idup(struct inode *ip) ip 259 fs.c ip->ref++; ip 261 fs.c return ip; ip 267 fs.c ilock(struct inode *ip) ip 272 fs.c if(ip == 0 || ip->ref < 1) ip 276 fs.c while(ip->flags & I_BUSY) ip 277 fs.c sleep(ip, &icache.lock); ip 278 fs.c ip->flags |= I_BUSY; ip 281 fs.c if(!(ip->flags & I_VALID)){ ip 282 fs.c bp = bread(ip->dev, IBLOCK(ip->inum, sb)); ip 283 fs.c dip = (struct dinode*)bp->data + ip->inum%IPB; ip 284 fs.c ip->type = dip->type; ip 285 fs.c ip->major = dip->major; ip 286 fs.c ip->minor = dip->minor; ip 287 fs.c ip->nlink = dip->nlink; ip 288 fs.c ip->size = dip->size; ip 289 fs.c memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); ip 291 fs.c ip->flags |= I_VALID; ip 292 fs.c if(ip->type == 0) ip 299 fs.c iunlock(struct inode *ip) ip 301 fs.c if(ip == 0 || !(ip->flags & I_BUSY) || ip->ref < 1) ip 305 fs.c ip->flags &= ~I_BUSY; ip 306 fs.c wakeup(ip); ip 318 fs.c iput(struct inode *ip) ip 321 fs.c if(ip->ref == 1 && (ip->flags & I_VALID) && ip->nlink == 0){ ip 323 fs.c if(ip->flags & I_BUSY) ip 325 fs.c ip->flags |= I_BUSY; ip 327 fs.c itrunc(ip); ip 328 fs.c ip->type = 0; ip 329 fs.c iupdate(ip); ip 331 fs.c ip->flags = 0; ip 332 fs.c wakeup(ip); ip 334 fs.c ip->ref--; ip 340 fs.c iunlockput(struct inode *ip) ip 342 fs.c iunlock(ip); ip 343 fs.c iput(ip); ip 357 fs.c bmap(struct inode *ip, uint bn) ip 363 fs.c if((addr = ip->addrs[bn]) == 0) ip 364 fs.c ip->addrs[bn] = addr = balloc(ip->dev); ip 371 fs.c if((addr = ip->addrs[NDIRECT]) == 0) ip 372 fs.c ip->addrs[NDIRECT] = addr = balloc(ip->dev); ip 373 fs.c bp = bread(ip->dev, addr); ip 376 fs.c a[bn] = addr = balloc(ip->dev); ip 392 fs.c itrunc(struct inode *ip) ip 399 fs.c if(ip->addrs[i]){ ip 400 fs.c bfree(ip->dev, ip->addrs[i]); ip 401 fs.c ip->addrs[i] = 0; ip 405 fs.c if(ip->addrs[NDIRECT]){ ip 406 fs.c bp = bread(ip->dev, ip->addrs[NDIRECT]); ip 410 fs.c bfree(ip->dev, a[j]); ip 413 fs.c bfree(ip->dev, ip->addrs[NDIRECT]); ip 414 fs.c ip->addrs[NDIRECT] = 0; ip 417 fs.c ip->size = 0; ip 418 fs.c iupdate(ip); ip 423 fs.c stati(struct inode *ip, struct stat *st) ip 425 fs.c st->dev = ip->dev; ip 426 fs.c st->ino = ip->inum; ip 427 fs.c st->type = ip->type; ip 428 fs.c st->nlink = ip->nlink; ip 429 fs.c st->size = ip->size; ip 435 fs.c readi(struct inode *ip, char *dst, uint off, uint n) ip 440 fs.c if(ip->type == T_DEV){ ip 441 fs.c if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read) ip 443 fs.c return devsw[ip->major].read(ip, dst, n); ip 446 fs.c if(off > ip->size || off + n < off) ip 448 fs.c if(off + n > ip->size) ip 449 fs.c n = ip->size - off; ip 452 fs.c bp = bread(ip->dev, bmap(ip, off/BSIZE)); ip 463 fs.c writei(struct inode *ip, char *src, uint off, uint n) ip 468 fs.c if(ip->type == T_DEV){ ip 469 fs.c if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write) ip 471 fs.c return devsw[ip->major].write(ip, src, n); ip 474 fs.c if(off > ip->size || off + n < off) ip 480 fs.c bp = bread(ip->dev, bmap(ip, off/BSIZE)); ip 487 fs.c if(n > 0 && off > ip->size){ ip 488 fs.c ip->size = off; ip 489 fs.c iupdate(ip); ip 537 fs.c struct inode *ip; ip 540 fs.c if((ip = dirlookup(dp, name, 0)) != 0){ ip 541 fs.c iput(ip); ip 608 fs.c struct inode *ip, *next; ip 611 fs.c ip = iget(ROOTDEV, ROOTINO); ip 613 fs.c ip = idup(proc->cwd); ip 616 fs.c ilock(ip); ip 617 fs.c if(ip->type != T_DIR){ ip 618 fs.c iunlockput(ip); ip 623 fs.c iunlock(ip); ip 624 fs.c return ip; ip 626 fs.c if((next = dirlookup(ip, name, 0)) == 0){ ip 627 fs.c iunlockput(ip); ip 630 fs.c iunlockput(ip); ip 631 fs.c ip = next; ip 634 fs.c iput(ip); ip 637 fs.c return ip; ip 39 mkfs.c void rinode(uint inum, struct dinode *ip); ip 184 mkfs.c winode(uint inum, struct dinode *ip) ip 193 mkfs.c *dip = *ip; ip 198 mkfs.c rinode(uint inum, struct dinode *ip) ip 207 mkfs.c *ip = *dip; ip 18 syscall.c fetchint(uint addr, int *ip) ip 22 syscall.c *ip = *(int*)(addr); ip 46 syscall.c argint(int n, int *ip) ip 48 syscall.c return fetchint(proc->tf->esp + 4 + 4*n, ip); ip 119 sysfile.c struct inode *dp, *ip; ip 125 sysfile.c if((ip = namei(old)) == 0){ ip 130 sysfile.c ilock(ip); ip 131 sysfile.c if(ip->type == T_DIR){ ip 132 sysfile.c iunlockput(ip); ip 137 sysfile.c ip->nlink++; ip 138 sysfile.c iupdate(ip); ip 139 sysfile.c iunlock(ip); ip 144 sysfile.c if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ ip 149 sysfile.c iput(ip); ip 156 sysfile.c ilock(ip); ip 157 sysfile.c ip->nlink--; ip 158 sysfile.c iupdate(ip); ip 159 sysfile.c iunlockput(ip); ip 184 sysfile.c struct inode *ip, *dp; ip 204 sysfile.c if((ip = dirlookup(dp, name, &off)) == 0) ip 206 sysfile.c ilock(ip); ip 208 sysfile.c if(ip->nlink < 1) ip 210 sysfile.c if(ip->type == T_DIR && !isdirempty(ip)){ ip 211 sysfile.c iunlockput(ip); ip 218 sysfile.c if(ip->type == T_DIR){ ip 224 sysfile.c ip->nlink--; ip 225 sysfile.c iupdate(ip); ip 226 sysfile.c iunlockput(ip); ip 242 sysfile.c struct inode *ip, *dp; ip 249 sysfile.c if((ip = dirlookup(dp, name, &off)) != 0){ ip 251 sysfile.c ilock(ip); ip 252 sysfile.c if(type == T_FILE && ip->type == T_FILE) ip 253 sysfile.c return ip; ip 254 sysfile.c iunlockput(ip); ip 258 sysfile.c if((ip = ialloc(dp->dev, type)) == 0) ip 261 sysfile.c ilock(ip); ip 262 sysfile.c ip->major = major; ip 263 sysfile.c ip->minor = minor; ip 264 sysfile.c ip->nlink = 1; ip 265 sysfile.c iupdate(ip); ip 271 sysfile.c if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) ip 275 sysfile.c if(dirlink(dp, name, ip->inum) < 0) ip 280 sysfile.c return ip; ip 289 sysfile.c struct inode *ip; ip 297 sysfile.c ip = create(path, T_FILE, 0, 0); ip 298 sysfile.c if(ip == 0){ ip 303 sysfile.c if((ip = namei(path)) == 0){ ip 307 sysfile.c ilock(ip); ip 308 sysfile.c if(ip->type == T_DIR && omode != O_RDONLY){ ip 309 sysfile.c iunlockput(ip); ip 318 sysfile.c iunlockput(ip); ip 322 sysfile.c iunlock(ip); ip 326 sysfile.c f->ip = ip; ip 337 sysfile.c struct inode *ip; ip 340 sysfile.c if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ ip 344 sysfile.c iunlockput(ip); ip 352 sysfile.c struct inode *ip; ip 361 sysfile.c (ip = create(path, T_DEV, major, minor)) == 0){ ip 365 sysfile.c iunlockput(ip); ip 374 sysfile.c struct inode *ip; ip 377 sysfile.c if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){ ip 381 sysfile.c ilock(ip); ip 382 sysfile.c if(ip->type != T_DIR){ ip 383 sysfile.c iunlockput(ip); ip 387 sysfile.c iunlock(ip); ip 390 sysfile.c proc->cwd = ip; ip 197 vm.c loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz) ip 212 vm.c if(readi(ip, p2v(pa), offset+i, n) != n)