ip                236 console.c      consoleread(struct inode *ip, char *dst, int n)
ip                241 console.c        iunlock(ip);
ip                248 console.c              ilock(ip);
ip                268 console.c        ilock(ip);
ip                274 console.c      consolewrite(struct inode *ip, char *buf, int n)
ip                278 console.c        iunlock(ip);
ip                283 console.c        ilock(ip);
ip                 17 exec.c           struct inode *ip;
ip                 24 exec.c           if((ip = namei(path)) == 0){
ip                 29 exec.c           ilock(ip);
ip                 33 exec.c           if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf))
ip                 44 exec.c             if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
ip                 56 exec.c             if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
ip                 59 exec.c           iunlockput(ip);
ip                 61 exec.c           ip = 0;
ip                109 exec.c           if(ip){
ip                110 exec.c             iunlockput(ip);
ip                 77 file.c             iput(ff.ip);
ip                 87 file.c             ilock(f->ip);
ip                 88 file.c             stati(f->ip, st);
ip                 89 file.c             iunlock(f->ip);
ip                106 file.c             ilock(f->ip);
ip                107 file.c             if((r = readi(f->ip, addr, f->off, n)) > 0)
ip                109 file.c             iunlock(f->ip);
ip                141 file.c               ilock(f->ip);
ip                142 file.c               if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
ip                144 file.c               iunlock(f->ip);
ip                  7 file.h           struct inode *ip;
ip                221 fs.c           iupdate(struct inode *ip)
ip                226 fs.c             bp = bread(ip->dev, IBLOCK(ip->inum, sb));
ip                227 fs.c             dip = (struct dinode*)bp->data + ip->inum%IPB;
ip                228 fs.c             dip->type = ip->type;
ip                229 fs.c             dip->major = ip->major;
ip                230 fs.c             dip->minor = ip->minor;
ip                231 fs.c             dip->nlink = ip->nlink;
ip                232 fs.c             dip->size = ip->size;
ip                233 fs.c             memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
ip                244 fs.c             struct inode *ip, *empty;
ip                250 fs.c             for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
ip                251 fs.c               if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
ip                252 fs.c                 ip->ref++;
ip                254 fs.c                 return ip;
ip                256 fs.c               if(empty == 0 && ip->ref == 0)    // Remember empty slot.
ip                257 fs.c                 empty = ip;
ip                264 fs.c             ip = empty;
ip                265 fs.c             ip->dev = dev;
ip                266 fs.c             ip->inum = inum;
ip                267 fs.c             ip->ref = 1;
ip                268 fs.c             ip->valid = 0;
ip                271 fs.c             return ip;
ip                277 fs.c           idup(struct inode *ip)
ip                280 fs.c             ip->ref++;
ip                282 fs.c             return ip;
ip                288 fs.c           ilock(struct inode *ip)
ip                293 fs.c             if(ip == 0 || ip->ref < 1)
ip                296 fs.c             acquiresleep(&ip->lock);
ip                298 fs.c             if(ip->valid == 0){
ip                299 fs.c               bp = bread(ip->dev, IBLOCK(ip->inum, sb));
ip                300 fs.c               dip = (struct dinode*)bp->data + ip->inum%IPB;
ip                301 fs.c               ip->type = dip->type;
ip                302 fs.c               ip->major = dip->major;
ip                303 fs.c               ip->minor = dip->minor;
ip                304 fs.c               ip->nlink = dip->nlink;
ip                305 fs.c               ip->size = dip->size;
ip                306 fs.c               memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
ip                308 fs.c               ip->valid = 1;
ip                309 fs.c               if(ip->type == 0)
ip                316 fs.c           iunlock(struct inode *ip)
ip                318 fs.c             if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
ip                321 fs.c             releasesleep(&ip->lock);
ip                332 fs.c           iput(struct inode *ip)
ip                334 fs.c             acquiresleep(&ip->lock);
ip                335 fs.c             if(ip->valid && ip->nlink == 0){
ip                337 fs.c               int r = ip->ref;
ip                341 fs.c                 itrunc(ip);
ip                342 fs.c                 ip->type = 0;
ip                343 fs.c                 iupdate(ip);
ip                344 fs.c                 ip->valid = 0;
ip                347 fs.c             releasesleep(&ip->lock);
ip                350 fs.c             ip->ref--;
ip                356 fs.c           iunlockput(struct inode *ip)
ip                358 fs.c             iunlock(ip);
ip                359 fs.c             iput(ip);
ip                373 fs.c           bmap(struct inode *ip, uint bn)
ip                379 fs.c               if((addr = ip->addrs[bn]) == 0)
ip                380 fs.c                 ip->addrs[bn] = addr = balloc(ip->dev);
ip                387 fs.c               if((addr = ip->addrs[NDIRECT]) == 0)
ip                388 fs.c                 ip->addrs[NDIRECT] = addr = balloc(ip->dev);
ip                389 fs.c               bp = bread(ip->dev, addr);
ip                392 fs.c                 a[bn] = addr = balloc(ip->dev);
ip                408 fs.c           itrunc(struct inode *ip)
ip                415 fs.c               if(ip->addrs[i]){
ip                416 fs.c                 bfree(ip->dev, ip->addrs[i]);
ip                417 fs.c                 ip->addrs[i] = 0;
ip                421 fs.c             if(ip->addrs[NDIRECT]){
ip                422 fs.c               bp = bread(ip->dev, ip->addrs[NDIRECT]);
ip                426 fs.c                   bfree(ip->dev, a[j]);
ip                429 fs.c               bfree(ip->dev, ip->addrs[NDIRECT]);
ip                430 fs.c               ip->addrs[NDIRECT] = 0;
ip                433 fs.c             ip->size = 0;
ip                434 fs.c             iupdate(ip);
ip                440 fs.c           stati(struct inode *ip, struct stat *st)
ip                442 fs.c             st->dev = ip->dev;
ip                443 fs.c             st->ino = ip->inum;
ip                444 fs.c             st->type = ip->type;
ip                445 fs.c             st->nlink = ip->nlink;
ip                446 fs.c             st->size = ip->size;
ip                453 fs.c           readi(struct inode *ip, char *dst, uint off, uint n)
ip                458 fs.c             if(ip->type == T_DEV){
ip                459 fs.c               if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
ip                461 fs.c               return devsw[ip->major].read(ip, dst, n);
ip                464 fs.c             if(off > ip->size || off + n < off)
ip                466 fs.c             if(off + n > ip->size)
ip                467 fs.c               n = ip->size - off;
ip                470 fs.c               bp = bread(ip->dev, bmap(ip, off/BSIZE));
ip                482 fs.c           writei(struct inode *ip, char *src, uint off, uint n)
ip                487 fs.c             if(ip->type == T_DEV){
ip                488 fs.c               if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
ip                490 fs.c               return devsw[ip->major].write(ip, src, n);
ip                493 fs.c             if(off > ip->size || off + n < off)
ip                499 fs.c               bp = bread(ip->dev, bmap(ip, off/BSIZE));
ip                506 fs.c             if(n > 0 && off > ip->size){
ip                507 fs.c               ip->size = off;
ip                508 fs.c               iupdate(ip);
ip                556 fs.c             struct inode *ip;
ip                559 fs.c             if((ip = dirlookup(dp, name, 0)) != 0){
ip                560 fs.c               iput(ip);
ip                627 fs.c             struct inode *ip, *next;
ip                630 fs.c               ip = iget(ROOTDEV, ROOTINO);
ip                632 fs.c               ip = idup(myproc()->cwd);
ip                635 fs.c               ilock(ip);
ip                636 fs.c               if(ip->type != T_DIR){
ip                637 fs.c                 iunlockput(ip);
ip                642 fs.c                 iunlock(ip);
ip                643 fs.c                 return ip;
ip                645 fs.c               if((next = dirlookup(ip, name, 0)) == 0){
ip                646 fs.c                 iunlockput(ip);
ip                649 fs.c               iunlockput(ip);
ip                650 fs.c               ip = next;
ip                653 fs.c               iput(ip);
ip                656 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                 24 syscall.c        *ip = *(int*)(addr);
ip                 50 syscall.c      argint(int n, int *ip)
ip                 52 syscall.c        return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
ip                122 sysfile.c        struct inode *dp, *ip;
ip                128 sysfile.c        if((ip = namei(old)) == 0){
ip                133 sysfile.c        ilock(ip);
ip                134 sysfile.c        if(ip->type == T_DIR){
ip                135 sysfile.c          iunlockput(ip);
ip                140 sysfile.c        ip->nlink++;
ip                141 sysfile.c        iupdate(ip);
ip                142 sysfile.c        iunlock(ip);
ip                147 sysfile.c        if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
ip                152 sysfile.c        iput(ip);
ip                159 sysfile.c        ilock(ip);
ip                160 sysfile.c        ip->nlink--;
ip                161 sysfile.c        iupdate(ip);
ip                162 sysfile.c        iunlockput(ip);
ip                187 sysfile.c        struct inode *ip, *dp;
ip                207 sysfile.c        if((ip = dirlookup(dp, name, &off)) == 0)
ip                209 sysfile.c        ilock(ip);
ip                211 sysfile.c        if(ip->nlink < 1)
ip                213 sysfile.c        if(ip->type == T_DIR && !isdirempty(ip)){
ip                214 sysfile.c          iunlockput(ip);
ip                221 sysfile.c        if(ip->type == T_DIR){
ip                227 sysfile.c        ip->nlink--;
ip                228 sysfile.c        iupdate(ip);
ip                229 sysfile.c        iunlockput(ip);
ip                244 sysfile.c        struct inode *ip, *dp;
ip                251 sysfile.c        if((ip = dirlookup(dp, name, 0)) != 0){
ip                253 sysfile.c          ilock(ip);
ip                254 sysfile.c          if(type == T_FILE && ip->type == T_FILE)
ip                255 sysfile.c            return ip;
ip                256 sysfile.c          iunlockput(ip);
ip                260 sysfile.c        if((ip = ialloc(dp->dev, type)) == 0)
ip                263 sysfile.c        ilock(ip);
ip                264 sysfile.c        ip->major = major;
ip                265 sysfile.c        ip->minor = minor;
ip                266 sysfile.c        ip->nlink = 1;
ip                267 sysfile.c        iupdate(ip);
ip                273 sysfile.c          if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
ip                277 sysfile.c        if(dirlink(dp, name, ip->inum) < 0)
ip                282 sysfile.c        return ip;
ip                291 sysfile.c        struct inode *ip;
ip                299 sysfile.c          ip = create(path, T_FILE, 0, 0);
ip                300 sysfile.c          if(ip == 0){
ip                305 sysfile.c          if((ip = namei(path)) == 0){
ip                309 sysfile.c          ilock(ip);
ip                310 sysfile.c          if(ip->type == T_DIR && omode != O_RDONLY){
ip                311 sysfile.c            iunlockput(ip);
ip                320 sysfile.c          iunlockput(ip);
ip                324 sysfile.c        iunlock(ip);
ip                328 sysfile.c        f->ip = ip;
ip                339 sysfile.c        struct inode *ip;
ip                342 sysfile.c        if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
ip                346 sysfile.c        iunlockput(ip);
ip                354 sysfile.c        struct inode *ip;
ip                362 sysfile.c           (ip = create(path, T_DEV, major, minor)) == 0){
ip                366 sysfile.c        iunlockput(ip);
ip                375 sysfile.c        struct inode *ip;
ip                379 sysfile.c        if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
ip                383 sysfile.c        ilock(ip);
ip                384 sysfile.c        if(ip->type != T_DIR){
ip                385 sysfile.c          iunlockput(ip);
ip                389 sysfile.c        iunlock(ip);
ip                392 sysfile.c        curproc->cwd = ip;
ip                198 vm.c           loaduvm(pde_t *pgdir, char *addr, struct inode *ip, uint offset, uint sz)
ip                213 vm.c               if(readi(ip, P2V(pa), offset+i, n) != n)