aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsdb
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2018-03-17 01:48:27 +0000
committerEd Maste <emaste@FreeBSD.org>2018-03-17 01:48:27 +0000
commit1e2b9afca9212aa3d6f9cfc02c54f739a7c7c035 (patch)
tree2a7d490a37367cf95935a2bb7b8dd3cc1a778737 /sbin/fsdb
parent4e78ff7068e13cb32b4165fe362f8ddf81160031 (diff)
downloadsrc-1e2b9afca9212aa3d6f9cfc02c54f739a7c7c035.tar.gz
src-1e2b9afca9212aa3d6f9cfc02c54f739a7c7c035.zip
Prefix UFS symbols with UFS_ to reduce namespace pollution
Followup to r313780. Also prefix ext2's and nandfs's versions with EXT2_ and NANDFS_. Reported by: kib Reviewed by: kib, mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9623
Notes
Notes: svn path=/head/; revision=331083
Diffstat (limited to 'sbin/fsdb')
-rw-r--r--sbin/fsdb/fsdb.c22
-rw-r--r--sbin/fsdb/fsdbutil.c36
2 files changed, 29 insertions, 29 deletions
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index 1c6f78302fce..8f1598c1e8ab 100644
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
@@ -512,14 +512,14 @@ CMDFUNCSTART(findblk)
/* Get on-disk inode aka dinode. */
curinum = inum;
curinode = ginode(inum);
- /* Find IFLNK dinode with allocated data blocks. */
- switch (DIP(curinode, di_mode) & IFMT) {
- case IFDIR:
- case IFREG:
+ /* Find UFS_IFLNK dinode with allocated data blocks. */
+ switch (DIP(curinode, di_mode) & UFS_IFMT) {
+ case UFS_IFDIR:
+ case UFS_IFREG:
if (DIP(curinode, di_blocks) == 0)
continue;
break;
- case IFLNK:
+ case UFS_IFLNK:
{
uint64_t size = DIP(curinode, di_size);
if (size > 0 && size < sblock.fs_maxsymlinklen &&
@@ -889,10 +889,10 @@ struct typemap {
const char *typename;
int typebits;
} typenamemap[] = {
- {"file", IFREG},
- {"dir", IFDIR},
- {"socket", IFSOCK},
- {"fifo", IFIFO},
+ {"file", UFS_IFREG},
+ {"dir", UFS_IFDIR},
+ {"socket", UFS_IFSOCK},
+ {"fifo", UFS_IFIFO},
};
CMDFUNCSTART(newtype)
@@ -902,7 +902,7 @@ CMDFUNCSTART(newtype)
if (!checkactive())
return 1;
- type = DIP(curinode, di_mode) & IFMT;
+ type = DIP(curinode, di_mode) & UFS_IFMT;
for (tp = typenamemap;
tp < &typenamemap[nitems(typenamemap)];
tp++) {
@@ -917,7 +917,7 @@ CMDFUNCSTART(newtype)
warnx("try one of `file', `dir', `socket', `fifo'");
return 1;
}
- DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~IFMT);
+ DIP_SET(curinode, di_mode, DIP(curinode, di_mode) & ~UFS_IFMT);
DIP_SET(curinode, di_mode, DIP(curinode, di_mode) | type);
inodirty();
printactive(0);
diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c
index 6ad315df8eb6..afb0d20fd74f 100644
--- a/sbin/fsdb/fsdbutil.c
+++ b/sbin/fsdb/fsdbutil.c
@@ -120,20 +120,20 @@ printstat(const char *cp, ino_t inum, union dinode *dp)
time_t t;
printf("%s: ", cp);
- switch (DIP(dp, di_mode) & IFMT) {
- case IFDIR:
+ switch (DIP(dp, di_mode) & UFS_IFMT) {
+ case UFS_IFDIR:
puts("directory");
break;
- case IFREG:
+ case UFS_IFREG:
puts("regular file");
break;
- case IFBLK:
+ case UFS_IFBLK:
printf("block special (%#jx)", (uintmax_t)DIP(dp, di_rdev));
break;
- case IFCHR:
+ case UFS_IFCHR:
printf("character special (%#jx)", DIP(dp, di_rdev));
break;
- case IFLNK:
+ case UFS_IFLNK:
fputs("symlink",stdout);
if (DIP(dp, di_size) > 0 &&
DIP(dp, di_size) < sblock.fs_maxsymlinklen &&
@@ -147,10 +147,10 @@ printstat(const char *cp, ino_t inum, union dinode *dp)
putchar('\n');
}
break;
- case IFSOCK:
+ case UFS_IFSOCK:
puts("socket");
break;
- case IFIFO:
+ case UFS_IFIFO:
puts("fifo");
break;
}
@@ -338,7 +338,7 @@ checkactivedir(void)
warnx("no current inode\n");
return 0;
}
- if ((DIP(curinode, di_mode) & IFMT) != IFDIR) {
+ if ((DIP(curinode, di_mode) & UFS_IFMT) != UFS_IFDIR) {
warnx("inode %ju not a directory", (uintmax_t)curinum);
return 0;
}
@@ -350,14 +350,14 @@ printactive(int doblocks)
{
if (!checkactive())
return 1;
- switch (DIP(curinode, di_mode) & IFMT) {
- case IFDIR:
- case IFREG:
- case IFBLK:
- case IFCHR:
- case IFLNK:
- case IFSOCK:
- case IFIFO:
+ switch (DIP(curinode, di_mode) & UFS_IFMT) {
+ case UFS_IFDIR:
+ case UFS_IFREG:
+ case UFS_IFBLK:
+ case UFS_IFCHR:
+ case UFS_IFLNK:
+ case UFS_IFSOCK:
+ case UFS_IFIFO:
if (doblocks)
printblocks(curinum, curinode);
else
@@ -368,7 +368,7 @@ printactive(int doblocks)
break;
default:
printf("current inode %ju: screwy itype 0%o (mode 0%o)?\n",
- (uintmax_t)curinum, DIP(curinode, di_mode) & IFMT,
+ (uintmax_t)curinum, DIP(curinode, di_mode) & UFS_IFMT,
DIP(curinode, di_mode));
break;
}