ip 29 kernel/exec.c struct inode *ip; ip 36 kernel/exec.c if((ip = namei(path)) == 0){ ip 40 kernel/exec.c ilock(ip); ip 43 kernel/exec.c if(readi(ip, 0, (uint64)&elf, 0, sizeof(elf)) != sizeof(elf)) ip 54 kernel/exec.c if(readi(ip, 0, (uint64)&ph, off, sizeof(ph)) != sizeof(ph)) ip 68 kernel/exec.c if(loadseg(pagetable, ph.vaddr, ip, ph.off, ph.filesz) < 0) ip 71 kernel/exec.c iunlockput(ip); ip 73 kernel/exec.c ip = 0; ip 136 kernel/exec.c if(ip){ ip 137 kernel/exec.c iunlockput(ip); ip 148 kernel/exec.c loadseg(pagetable_t pagetable, uint64 va, struct inode *ip, uint offset, uint sz) ip 161 kernel/exec.c if(readi(ip, 0, (uint64)pa, offset+i, n) != n) ip 80 kernel/file.c iput(ff.ip); ip 94 kernel/file.c ilock(f->ip); ip 95 kernel/file.c stati(f->ip, &st); ip 96 kernel/file.c iunlock(f->ip); ip 121 kernel/file.c ilock(f->ip); ip 122 kernel/file.c if((r = readi(f->ip, 1, addr, f->off, n)) > 0) ip 124 kernel/file.c iunlock(f->ip); ip 163 kernel/file.c ilock(f->ip); ip 164 kernel/file.c if ((r = writei(f->ip, 1, addr + i, f->off, n1)) > 0) ip 166 kernel/file.c iunlock(f->ip); ip 7 kernel/file.h struct inode *ip; // FD_INODE and FD_DEVICE ip 226 kernel/fs.c iupdate(struct inode *ip) ip 231 kernel/fs.c bp = bread(ip->dev, IBLOCK(ip->inum, sb)); ip 232 kernel/fs.c dip = (struct dinode*)bp->data + ip->inum%IPB; ip 233 kernel/fs.c dip->type = ip->type; ip 234 kernel/fs.c dip->major = ip->major; ip 235 kernel/fs.c dip->minor = ip->minor; ip 236 kernel/fs.c dip->nlink = ip->nlink; ip 237 kernel/fs.c dip->size = ip->size; ip 238 kernel/fs.c memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); ip 249 kernel/fs.c struct inode *ip, *empty; ip 255 kernel/fs.c for(ip = &itable.inode[0]; ip < &itable.inode[NINODE]; ip++){ ip 256 kernel/fs.c if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ ip 257 kernel/fs.c ip->ref++; ip 259 kernel/fs.c return ip; ip 261 kernel/fs.c if(empty == 0 && ip->ref == 0) // Remember empty slot. ip 262 kernel/fs.c empty = ip; ip 269 kernel/fs.c ip = empty; ip 270 kernel/fs.c ip->dev = dev; ip 271 kernel/fs.c ip->inum = inum; ip 272 kernel/fs.c ip->ref = 1; ip 273 kernel/fs.c ip->valid = 0; ip 276 kernel/fs.c return ip; ip 282 kernel/fs.c idup(struct inode *ip) ip 285 kernel/fs.c ip->ref++; ip 287 kernel/fs.c return ip; ip 293 kernel/fs.c ilock(struct inode *ip) ip 298 kernel/fs.c if(ip == 0 || ip->ref < 1) ip 301 kernel/fs.c acquiresleep(&ip->lock); ip 303 kernel/fs.c if(ip->valid == 0){ ip 304 kernel/fs.c bp = bread(ip->dev, IBLOCK(ip->inum, sb)); ip 305 kernel/fs.c dip = (struct dinode*)bp->data + ip->inum%IPB; ip 306 kernel/fs.c ip->type = dip->type; ip 307 kernel/fs.c ip->major = dip->major; ip 308 kernel/fs.c ip->minor = dip->minor; ip 309 kernel/fs.c ip->nlink = dip->nlink; ip 310 kernel/fs.c ip->size = dip->size; ip 311 kernel/fs.c memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); ip 313 kernel/fs.c ip->valid = 1; ip 314 kernel/fs.c if(ip->type == 0) ip 321 kernel/fs.c iunlock(struct inode *ip) ip 323 kernel/fs.c if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) ip 326 kernel/fs.c releasesleep(&ip->lock); ip 337 kernel/fs.c iput(struct inode *ip) ip 341 kernel/fs.c if(ip->ref == 1 && ip->valid && ip->nlink == 0){ ip 346 kernel/fs.c acquiresleep(&ip->lock); ip 350 kernel/fs.c itrunc(ip); ip 351 kernel/fs.c ip->type = 0; ip 352 kernel/fs.c iupdate(ip); ip 353 kernel/fs.c ip->valid = 0; ip 355 kernel/fs.c releasesleep(&ip->lock); ip 360 kernel/fs.c ip->ref--; ip 366 kernel/fs.c iunlockput(struct inode *ip) ip 368 kernel/fs.c iunlock(ip); ip 369 kernel/fs.c iput(ip); ip 383 kernel/fs.c bmap(struct inode *ip, uint bn) ip 389 kernel/fs.c if((addr = ip->addrs[bn]) == 0){ ip 390 kernel/fs.c addr = balloc(ip->dev); ip 393 kernel/fs.c ip->addrs[bn] = addr; ip 401 kernel/fs.c if((addr = ip->addrs[NDIRECT]) == 0){ ip 402 kernel/fs.c addr = balloc(ip->dev); ip 405 kernel/fs.c ip->addrs[NDIRECT] = addr; ip 407 kernel/fs.c bp = bread(ip->dev, addr); ip 410 kernel/fs.c addr = balloc(ip->dev); ip 426 kernel/fs.c itrunc(struct inode *ip) ip 433 kernel/fs.c if(ip->addrs[i]){ ip 434 kernel/fs.c bfree(ip->dev, ip->addrs[i]); ip 435 kernel/fs.c ip->addrs[i] = 0; ip 439 kernel/fs.c if(ip->addrs[NDIRECT]){ ip 440 kernel/fs.c bp = bread(ip->dev, ip->addrs[NDIRECT]); ip 444 kernel/fs.c bfree(ip->dev, a[j]); ip 447 kernel/fs.c bfree(ip->dev, ip->addrs[NDIRECT]); ip 448 kernel/fs.c ip->addrs[NDIRECT] = 0; ip 451 kernel/fs.c ip->size = 0; ip 452 kernel/fs.c iupdate(ip); ip 458 kernel/fs.c stati(struct inode *ip, struct stat *st) ip 460 kernel/fs.c st->dev = ip->dev; ip 461 kernel/fs.c st->ino = ip->inum; ip 462 kernel/fs.c st->type = ip->type; ip 463 kernel/fs.c st->nlink = ip->nlink; ip 464 kernel/fs.c st->size = ip->size; ip 472 kernel/fs.c readi(struct inode *ip, int user_dst, uint64 dst, uint off, uint n) ip 477 kernel/fs.c if(off > ip->size || off + n < off) ip 479 kernel/fs.c if(off + n > ip->size) ip 480 kernel/fs.c n = ip->size - off; ip 483 kernel/fs.c uint addr = bmap(ip, off/BSIZE); ip 486 kernel/fs.c bp = bread(ip->dev, addr); ip 506 kernel/fs.c writei(struct inode *ip, int user_src, uint64 src, uint off, uint n) ip 511 kernel/fs.c if(off > ip->size || off + n < off) ip 517 kernel/fs.c uint addr = bmap(ip, off/BSIZE); ip 520 kernel/fs.c bp = bread(ip->dev, addr); ip 530 kernel/fs.c if(off > ip->size) ip 531 kernel/fs.c ip->size = off; ip 536 kernel/fs.c iupdate(ip); ip 584 kernel/fs.c struct inode *ip; ip 587 kernel/fs.c if((ip = dirlookup(dp, name, 0)) != 0){ ip 588 kernel/fs.c iput(ip); ip 654 kernel/fs.c struct inode *ip, *next; ip 657 kernel/fs.c ip = iget(ROOTDEV, ROOTINO); ip 659 kernel/fs.c ip = idup(myproc()->cwd); ip 662 kernel/fs.c ilock(ip); ip 663 kernel/fs.c if(ip->type != T_DIR){ ip 664 kernel/fs.c iunlockput(ip); ip 669 kernel/fs.c iunlock(ip); ip 670 kernel/fs.c return ip; ip 672 kernel/fs.c if((next = dirlookup(ip, name, 0)) == 0){ ip 673 kernel/fs.c iunlockput(ip); ip 676 kernel/fs.c iunlockput(ip); ip 677 kernel/fs.c ip = next; ip 680 kernel/fs.c iput(ip); ip 683 kernel/fs.c return ip; ip 12 kernel/syscall.c fetchaddr(uint64 addr, uint64 *ip) ip 17 kernel/syscall.c if(copyin(p->pagetable, (char *)ip, addr, sizeof(*ip)) != 0) ip 57 kernel/syscall.c argint(int n, int *ip) ip 59 kernel/syscall.c *ip = argraw(n); ip 66 kernel/syscall.c argaddr(int n, uint64 *ip) ip 68 kernel/syscall.c *ip = argraw(n); ip 127 kernel/sysfile.c struct inode *dp, *ip; ip 133 kernel/sysfile.c if((ip = namei(old)) == 0){ ip 138 kernel/sysfile.c ilock(ip); ip 139 kernel/sysfile.c if(ip->type == T_DIR){ ip 140 kernel/sysfile.c iunlockput(ip); ip 145 kernel/sysfile.c ip->nlink++; ip 146 kernel/sysfile.c iupdate(ip); ip 147 kernel/sysfile.c iunlock(ip); ip 152 kernel/sysfile.c if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ ip 157 kernel/sysfile.c iput(ip); ip 164 kernel/sysfile.c ilock(ip); ip 165 kernel/sysfile.c ip->nlink--; ip 166 kernel/sysfile.c iupdate(ip); ip 167 kernel/sysfile.c iunlockput(ip); ip 191 kernel/sysfile.c struct inode *ip, *dp; ip 211 kernel/sysfile.c if((ip = dirlookup(dp, name, &off)) == 0) ip 213 kernel/sysfile.c ilock(ip); ip 215 kernel/sysfile.c if(ip->nlink < 1) ip 217 kernel/sysfile.c if(ip->type == T_DIR && !isdirempty(ip)){ ip 218 kernel/sysfile.c iunlockput(ip); ip 225 kernel/sysfile.c if(ip->type == T_DIR){ ip 231 kernel/sysfile.c ip->nlink--; ip 232 kernel/sysfile.c iupdate(ip); ip 233 kernel/sysfile.c iunlockput(ip); ip 248 kernel/sysfile.c struct inode *ip, *dp; ip 256 kernel/sysfile.c if((ip = dirlookup(dp, name, 0)) != 0){ ip 258 kernel/sysfile.c ilock(ip); ip 259 kernel/sysfile.c if(type == T_FILE && (ip->type == T_FILE || ip->type == T_DEVICE)) ip 260 kernel/sysfile.c return ip; ip 261 kernel/sysfile.c iunlockput(ip); ip 265 kernel/sysfile.c if((ip = ialloc(dp->dev, type)) == 0){ ip 270 kernel/sysfile.c ilock(ip); ip 271 kernel/sysfile.c ip->major = major; ip 272 kernel/sysfile.c ip->minor = minor; ip 273 kernel/sysfile.c ip->nlink = 1; ip 274 kernel/sysfile.c iupdate(ip); ip 278 kernel/sysfile.c if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) ip 282 kernel/sysfile.c if(dirlink(dp, name, ip->inum) < 0) ip 293 kernel/sysfile.c return ip; ip 297 kernel/sysfile.c ip->nlink = 0; ip 298 kernel/sysfile.c iupdate(ip); ip 299 kernel/sysfile.c iunlockput(ip); ip 310 kernel/sysfile.c struct inode *ip; ip 320 kernel/sysfile.c ip = create(path, T_FILE, 0, 0); ip 321 kernel/sysfile.c if(ip == 0){ ip 326 kernel/sysfile.c if((ip = namei(path)) == 0){ ip 330 kernel/sysfile.c ilock(ip); ip 331 kernel/sysfile.c if(ip->type == T_DIR && omode != O_RDONLY){ ip 332 kernel/sysfile.c iunlockput(ip); ip 338 kernel/sysfile.c if(ip->type == T_DEVICE && (ip->major < 0 || ip->major >= NDEV)){ ip 339 kernel/sysfile.c iunlockput(ip); ip 347 kernel/sysfile.c iunlockput(ip); ip 352 kernel/sysfile.c if(ip->type == T_DEVICE){ ip 354 kernel/sysfile.c f->major = ip->major; ip 359 kernel/sysfile.c f->ip = ip; ip 363 kernel/sysfile.c if((omode & O_TRUNC) && ip->type == T_FILE){ ip 364 kernel/sysfile.c itrunc(ip); ip 367 kernel/sysfile.c iunlock(ip); ip 377 kernel/sysfile.c struct inode *ip; ip 380 kernel/sysfile.c if(argstr(0, path, MAXPATH) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ ip 384 kernel/sysfile.c iunlockput(ip); ip 392 kernel/sysfile.c struct inode *ip; ip 400 kernel/sysfile.c (ip = create(path, T_DEVICE, major, minor)) == 0){ ip 404 kernel/sysfile.c iunlockput(ip); ip 413 kernel/sysfile.c struct inode *ip; ip 417 kernel/sysfile.c if(argstr(0, path, MAXPATH) < 0 || (ip = namei(path)) == 0){ ip 421 kernel/sysfile.c ilock(ip); ip 422 kernel/sysfile.c if(ip->type != T_DIR){ ip 423 kernel/sysfile.c iunlockput(ip); ip 427 kernel/sysfile.c iunlock(ip); ip 430 kernel/sysfile.c p->cwd = ip; ip 39 mkfs/mkfs.c void rinode(uint inum, struct dinode *ip); ip 187 mkfs/mkfs.c winode(uint inum, struct dinode *ip) ip 196 mkfs/mkfs.c *dip = *ip; ip 201 mkfs/mkfs.c rinode(uint inum, struct dinode *ip) ip 210 mkfs/mkfs.c *ip = *dip;