Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Stick LFS_ in front of IFMT, IFIFO, IFREG, etc. so as not to...
details: https://anonhg.NetBSD.org/src/rev/1e3a61a300e1
branches: trunk
changeset: 787240:1e3a61a300e1
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Jun 08 02:11:11 2013 +0000
description:
Stick LFS_ in front of IFMT, IFIFO, IFREG, etc. so as not to conflict
with the UFS copies of these symbols. (Which themselves ought to have
UFS_ stuck on.)
diffstat:
sbin/fsck_lfs/dir.c | 12 ++++++------
sbin/fsck_lfs/inode.c | 18 +++++++++---------
sbin/fsck_lfs/pass1.c | 18 +++++++++---------
sbin/fsck_lfs/pass2.c | 10 +++++-----
sbin/fsck_lfs/utilities.c | 18 +++++++++---------
sbin/newfs_lfs/make_lfs.c | 8 ++++----
sys/ufs/lfs/lfs_rfw.c | 6 +++---
sys/ufs/lfs/lfs_segment.c | 14 +++++++-------
sys/ufs/lfs/lfs_vfsops.c | 6 +++---
sys/ufs/lfs/lfs_vnops.c | 6 +++---
sys/ufs/lfs/ulfs_dinode.h | 20 ++++++++++----------
sys/ufs/lfs/ulfs_rename.c | 8 ++++----
sys/ufs/lfs/ulfs_vnops.c | 12 ++++++------
13 files changed, 78 insertions(+), 78 deletions(-)
diffs (truncated from 515 to 300 lines):
diff -r 6851d567f0c3 -r 1e3a61a300e1 sbin/fsck_lfs/dir.c
--- a/sbin/fsck_lfs/dir.c Sat Jun 08 02:09:35 2013 +0000
+++ b/sbin/fsck_lfs/dir.c Sat Jun 08 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.27 2013/06/06 00:52:50 dholland Exp $ */
+/* $NetBSD: dir.c,v 1.28 2013/06/08 02:11:11 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -317,7 +317,7 @@
else {
if (ftypeok(VTOD(vp)))
pfatal("%s=%s\n",
- (VTOI(vp)->i_ffs1_mode & IFMT) == IFDIR ?
+ (VTOI(vp)->i_ffs1_mode & LFS_IFMT) == LFS_IFDIR ?
"DIR" : "FILE", pathbuf);
else
pfatal("NAME=%s\n", pathbuf);
@@ -337,7 +337,7 @@
clri(idesc, "UNREF", 0);
} else {
pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname :
- ((dp->di_mode & IFMT) == IFDIR ? "DIR" : "FILE"));
+ ((dp->di_mode & LFS_IFMT) == LFS_IFDIR ? "DIR" : "FILE"));
pinode(idesc->id_number);
printf(" COUNT %d SHOULD BE %d",
dp->di_nlink, dp->di_nlink - lcnt);
@@ -406,7 +406,7 @@
memset(&idesc, 0, sizeof(struct inodesc));
vp = vget(fs, orphan);
dp = VTOD(vp);
- lostdir = (dp->di_mode & IFMT) == IFDIR;
+ lostdir = (dp->di_mode & LFS_IFMT) == LFS_IFDIR;
pwarn("UNREF %s ", lostdir ? "DIR" : "FILE");
pinode(orphan);
if (preen && dp->di_size == 0)
@@ -448,7 +448,7 @@
}
vp = vget(fs, lfdir);
dp = VTOD(vp);
- if ((dp->di_mode & IFMT) != IFDIR) {
+ if ((dp->di_mode & LFS_IFMT) != LFS_IFDIR) {
pfatal("lost+found IS NOT A DIRECTORY");
if (reply("REALLOCATE") == 0)
return (0);
@@ -622,7 +622,7 @@
struct dirtemplate *dirp;
struct uvnode *vp;
- ino = allocino(request, IFDIR | mode);
+ ino = allocino(request, LFS_IFDIR | mode);
dirp = &dirhead;
dirp->dot_ino = ino;
dirp->dotdot_ino = parent;
diff -r 6851d567f0c3 -r 1e3a61a300e1 sbin/fsck_lfs/inode.c
--- a/sbin/fsck_lfs/inode.c Sat Jun 08 02:09:35 2013 +0000
+++ b/sbin/fsck_lfs/inode.c Sat Jun 08 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.46 2013/06/08 02:09:35 dholland Exp $ */
+/* $NetBSD: inode.c,v 1.47 2013/06/08 02:11:11 dholland Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -137,9 +137,9 @@
idesc->id_fix = DONTKNOW;
idesc->id_entryno = 0;
idesc->id_filesize = dp->di_size;
- mode = dp->di_mode & IFMT;
- if (mode == IFBLK || mode == IFCHR ||
- (mode == IFLNK && (dp->di_size < fs->lfs_maxsymlinklen ||
+ mode = dp->di_mode & LFS_IFMT;
+ if (mode == LFS_IFBLK || mode == LFS_IFCHR ||
+ (mode == LFS_IFLNK && (dp->di_size < fs->lfs_maxsymlinklen ||
(fs->lfs_maxsymlinklen == 0 &&
dp->di_blocks == 0))))
return (KEEPON);
@@ -432,7 +432,7 @@
vp = vget(fs, idesc->id_number);
if (flag & 0x1) {
pwarn("%s %s", type,
- (VTOI(vp)->i_ffs1_mode & IFMT) == IFDIR ? "DIR" : "FILE");
+ (VTOI(vp)->i_ffs1_mode & LFS_IFMT) == LFS_IFDIR ? "DIR" : "FILE");
pinode(idesc->id_number);
}
if ((flag & 0x2) || preen || reply("CLEAR") == 1) {
@@ -594,12 +594,12 @@
if (ino == maxino)
extend_ifile(fs);
- switch (type & IFMT) {
- case IFDIR:
+ switch (type & LFS_IFMT) {
+ case LFS_IFDIR:
statemap[ino] = DSTATE;
break;
- case IFREG:
- case IFLNK:
+ case LFS_IFREG:
+ case LFS_IFLNK:
statemap[ino] = FSTATE;
break;
default:
diff -r 6851d567f0c3 -r 1e3a61a300e1 sbin/fsck_lfs/pass1.c
--- a/sbin/fsck_lfs/pass1.c Sat Jun 08 02:09:35 2013 +0000
+++ b/sbin/fsck_lfs/pass1.c Sat Jun 08 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass1.c,v 1.33 2013/06/06 00:54:49 dholland Exp $ */
+/* $NetBSD: pass1.c,v 1.34 2013/06/08 02:11:11 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -132,7 +132,7 @@
if (inumber == 0 || dins[i]->daddr == 0)
continue;
tinode = ginode(inumber);
- if (tinode && (tinode->di_mode & IFMT) == IFDIR)
+ if (tinode && (tinode->di_mode & LFS_IFMT) == LFS_IFDIR)
numdirs++;
}
@@ -181,7 +181,7 @@
statemap[inumber] = USTATE;
return;
}
- mode = dp->di_mode & IFMT;
+ mode = dp->di_mode & LFS_IFMT;
/* XXX - LFS doesn't have this particular problem (?) */
if (mode == 0) {
@@ -208,11 +208,11 @@
(unsigned long long) dp->di_size);
goto unknown;
}
- if (!preen && mode == IFMT && reply("HOLD BAD BLOCK") == 1) {
+ if (!preen && mode == LFS_IFMT && reply("HOLD BAD BLOCK") == 1) {
vp = vget(fs, inumber);
dp = VTOD(vp);
dp->di_size = fs->lfs_fsize;
- dp->di_mode = IFREG | 0600;
+ dp->di_mode = LFS_IFREG | 0600;
inodirty(VTOI(vp));
}
ndb = howmany(dp->di_size, fs->lfs_bsize);
@@ -222,9 +222,9 @@
(unsigned long long) dp->di_size, ndb);
goto unknown;
}
- if (mode == IFBLK || mode == IFCHR)
+ if (mode == LFS_IFBLK || mode == LFS_IFCHR)
ndb++;
- if (mode == IFLNK) {
+ if (mode == LFS_IFLNK) {
/*
* Fake ndb value so direct/indirect block checks below
* will detect any garbage after symlink string.
@@ -266,7 +266,7 @@
zlnp->next = zlnhead;
zlnhead = zlnp;
}
- if (mode == IFDIR) {
+ if (mode == LFS_IFDIR) {
if (dp->di_size == 0)
statemap[inumber] = DCLEAR;
else
@@ -283,7 +283,7 @@
if (dp->di_nlink <= 0) {
LFS_IENTRY(ifp, fs, inumber, bp);
if (ifp->if_nextfree == LFS_ORPHAN_NEXTFREE) {
- statemap[inumber] = (mode == IFDIR ? DCLEAR : FCLEAR);
+ statemap[inumber] = (mode == LFS_IFDIR ? DCLEAR : FCLEAR);
/* Add this to our list of orphans */
zlnp = emalloc(sizeof *zlnp);
zlnp->zlncnt = inumber;
diff -r 6851d567f0c3 -r 1e3a61a300e1 sbin/fsck_lfs/pass2.c
--- a/sbin/fsck_lfs/pass2.c Sat Jun 08 02:09:35 2013 +0000
+++ b/sbin/fsck_lfs/pass2.c Sat Jun 08 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass2.c,v 1.19 2013/06/06 00:52:50 dholland Exp $ */
+/* $NetBSD: pass2.c,v 1.20 2013/06/08 02:11:11 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -103,8 +103,8 @@
errx(EEXIT, "%s", "");
vp = vget(fs, ULFS_ROOTINO);
dp = VTOD(vp);
- dp->di_mode &= ~IFMT;
- dp->di_mode |= IFDIR;
+ dp->di_mode &= ~LFS_IFMT;
+ dp->di_mode |= LFS_IFDIR;
inodirty(VTOI(vp));
break;
@@ -156,7 +156,7 @@
}
}
memset(&dino, 0, sizeof(struct ulfs1_dinode));
- dino.di_mode = IFDIR;
+ dino.di_mode = LFS_IFDIR;
dino.di_size = inp->i_isize;
memcpy(&dino.di_db[0], &inp->i_blks[0], (size_t) inp->i_numblks);
curino.id_number = inp->i_number;
@@ -382,7 +382,7 @@
break;
dp = ginode(dirp->d_ino);
statemap[dirp->d_ino] =
- (dp->di_mode & IFMT) == IFDIR ? DSTATE : FSTATE;
+ (dp->di_mode & LFS_IFMT) == LFS_IFDIR ? DSTATE : FSTATE;
lncntp[dirp->d_ino] = dp->di_nlink;
goto again;
diff -r 6851d567f0c3 -r 1e3a61a300e1 sbin/fsck_lfs/utilities.c
--- a/sbin/fsck_lfs/utilities.c Sat Jun 08 02:09:35 2013 +0000
+++ b/sbin/fsck_lfs/utilities.c Sat Jun 08 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: utilities.c,v 1.33 2013/06/06 00:52:50 dholland Exp $ */
+/* $NetBSD: utilities.c,v 1.34 2013/06/08 02:11:11 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -66,15 +66,15 @@
int
ftypeok(struct ulfs1_dinode * dp)
{
- switch (dp->di_mode & IFMT) {
+ switch (dp->di_mode & LFS_IFMT) {
- case IFDIR:
- case IFREG:
- case IFBLK:
- case IFCHR:
- case IFLNK:
- case IFSOCK:
- case IFIFO:
+ case LFS_IFDIR:
+ case LFS_IFREG:
+ case LFS_IFBLK:
+ case LFS_IFCHR:
+ case LFS_IFLNK:
+ case LFS_IFSOCK:
+ case LFS_IFIFO:
return (1);
default:
diff -r 6851d567f0c3 -r 1e3a61a300e1 sbin/newfs_lfs/make_lfs.c
--- a/sbin/newfs_lfs/make_lfs.c Sat Jun 08 02:09:35 2013 +0000
+++ b/sbin/newfs_lfs/make_lfs.c Sat Jun 08 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make_lfs.c,v 1.23 2013/06/08 02:09:35 dholland Exp $ */
+/* $NetBSD: make_lfs.c,v 1.24 2013/06/08 02:11:11 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
#if 0
static char sccsid[] = "@(#)lfs.c 8.5 (Berkeley) 5/24/95";
#else
-__RCSID("$NetBSD: make_lfs.c,v 1.23 2013/06/08 02:09:35 dholland Exp $");
+__RCSID("$NetBSD: make_lfs.c,v 1.24 2013/06/08 02:11:11 dholland Exp $");
#endif
#endif /* not lint */
@@ -615,7 +615,7 @@
if (dip == NULL)
err(1, NULL);
memset(dip, 0, sizeof(*dip));
- dip->di_mode = IFREG|IREAD|IWRITE;
+ dip->di_mode = LFS_IFREG|IREAD|IWRITE;
dip->di_flags = SF_IMMUTABLE;
make_dinode(LFS_IFILE_INUM, dip,
blkstofrags(fs, fs->lfs_cleansz + fs->lfs_segtabsz + 1), fs);
@@ -680,7 +680,7 @@
vp = lfs_raw_vget(fs, ULFS_ROOTINO, devfd, 0x0);
dip = VTOI(vp)->i_din.ffs1_din;
make_dinode(ULFS_ROOTINO, dip, howmany(DIRBLKSIZ,fs->lfs_fsize), fs);
- dip->di_mode = IFDIR | UMASK;
+ dip->di_mode = LFS_IFDIR | UMASK;
VTOI(vp)->i_lfs_osize = dip->di_size = DIRBLKSIZ;
#ifdef MAKE_LF_DIR
VTOI(vp)->i_nlink = dip->di_nlink = 3;
diff -r 6851d567f0c3 -r 1e3a61a300e1 sys/ufs/lfs/lfs_rfw.c
--- a/sys/ufs/lfs/lfs_rfw.c Sat Jun 08 02:09:35 2013 +0000
+++ b/sys/ufs/lfs/lfs_rfw.c Sat Jun 08 02:11:11 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_rfw.c,v 1.15 2013/06/06 00:48:04 dholland Exp $ */
+/* $NetBSD: lfs_rfw.c,v 1.16 2013/06/08 02:11:11 dholland Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_rfw.c,v 1.15 2013/06/06 00:48:04 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_rfw.c,v 1.16 2013/06/08 02:11:11 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@@ -180,7 +180,7 @@
* this later if it turns out to be some other kind of file.
Home |
Main Index |
Thread Index |
Old Index