diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2017-02-15 19:50:26 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2017-02-15 19:50:26 +0000 |
| commit | 1dc349ab9564b54c1b1f619045e95f966a9aae86 (patch) | |
| tree | 9430648d462fa23db629b080e6fa38b22a37260c /sbin/fsdb | |
| parent | 605703b5dfe92b64a2127637f30db6385a89f685 (diff) | |
Notes
Diffstat (limited to 'sbin/fsdb')
| -rw-r--r-- | sbin/fsdb/fsdb.c | 24 | ||||
| -rw-r--r-- | sbin/fsdb/fsdbutil.c | 8 |
2 files changed, 16 insertions, 16 deletions
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c index b35a06775452e..4a612ec7cd2e7 100644 --- a/sbin/fsdb/fsdb.c +++ b/sbin/fsdb/fsdb.c @@ -231,8 +231,8 @@ cmdloop(void) EditLine *elptr; HistEvent he; - curinode = ginode(ROOTINO); - curinum = ROOTINO; + curinode = ginode(UFS_ROOTINO); + curinum = UFS_ROOTINO; printactive(0); hist = history_init(); @@ -299,11 +299,11 @@ union dinode *curinode; ino_t curinum, ocurrent; #define GETINUM(ac,inum) inum = strtoul(argv[ac], &cp, 0); \ - if (inum < ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \ +if (inum < UFS_ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \ printf("inode %ju out of range; range is [%ju,%ju]\n", \ - (uintmax_t)inum, (uintmax_t)ROOTINO, (uintmax_t)maxino); \ + (uintmax_t)inum, (uintmax_t)UFS_ROOTINO, (uintmax_t)maxino);\ return 1; \ - } +} /* * Focus on given inode number @@ -486,8 +486,8 @@ CMDFUNCSTART(findblk) inosused = sblock.fs_ipg; for (; inosused > 0; inum++, inosused--) { - /* Skip magic inodes: 0, WINO, ROOTINO. */ - if (inum < ROOTINO) + /* Skip magic inodes: 0, UFS_WINO, UFS_ROOTINO. */ + if (inum < UFS_ROOTINO) continue; /* * Check if the block we are looking for is just an inode block. @@ -531,10 +531,10 @@ CMDFUNCSTART(findblk) } /* Look through direct data blocks. */ if (is_ufs2 ? - find_blks64(curinode->dp2.di_db, NDADDR, wantedblk64) : - find_blks32(curinode->dp1.di_db, NDADDR, wantedblk32)) + find_blks64(curinode->dp2.di_db, UFS_NDADDR, wantedblk64) : + find_blks32(curinode->dp1.di_db, UFS_NDADDR, wantedblk32)) goto end; - for (i = 0; i < NIADDR; i++) { + for (i = 0; i < UFS_NIADDR; i++) { /* * Does the block we are looking for belongs to the * indirect blocks? @@ -726,8 +726,8 @@ CMDFUNCSTART(focusname) ocurrent = curinum; if (argv[1][0] == '/') { - curinum = ROOTINO; - curinode = ginode(ROOTINO); + curinum = UFS_ROOTINO; + curinode = ginode(UFS_ROOTINO); } else { if (!checkactivedir()) return 1; diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c index 265a0965cbcf3..b3f3f7c0e3c8a 100644 --- a/sbin/fsdb/fsdbutil.c +++ b/sbin/fsdb/fsdbutil.c @@ -292,13 +292,13 @@ printblocks(ino_t inum, union dinode *dp) printf("Blocks for inode %ju:\n", (uintmax_t)inum); printf("Direct blocks:\n"); ndb = howmany(DIP(dp, di_size), sblock.fs_bsize); - for (i = 0; i < NDADDR && i < ndb; i++) { + for (i = 0; i < UFS_NDADDR && i < ndb; i++) { if (i > 0) printf(", "); blkno = DIP(dp, di_db[i]); printf("%jd", (intmax_t)blkno); } - if (ndb <= NDADDR) { + if (ndb <= UFS_NDADDR) { offset = blkoff(&sblock, DIP(dp, di_size)); if (offset != 0) { nfrags = numfrags(&sblock, fragroundup(&sblock, offset)); @@ -306,14 +306,14 @@ printblocks(ino_t inum, union dinode *dp) } } putchar('\n'); - if (ndb <= NDADDR) + if (ndb <= UFS_NDADDR) return; bufp = malloc((unsigned int)sblock.fs_bsize); if (bufp == NULL) errx(EEXIT, "cannot allocate indirect block buffer"); printf("Indirect blocks:\n"); - for (i = 0; i < NIADDR; i++) + for (i = 0; i < UFS_NIADDR; i++) printindir(DIP(dp, di_ib[i]), i, bufp); free(bufp); } |
