Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src DIRBLKSIZ -> LFS_DIRBLKSIZ
details: https://anonhg.NetBSD.org/src/rev/48a33fd7e44a
branches: trunk
changeset: 787244:48a33fd7e44a
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Jun 08 02:14:46 2013 +0000
description:
DIRBLKSIZ -> LFS_DIRBLKSIZ
DIRECTSIZ -> LFS_DIRECTSIZ
DIRSIZ -> LFS_DIRSIZ
OLDDIRFMT -> LFS_OLDDIRFMT
NEWDIRFMT -> LFS_NEWDIRFMT
IFTODT -> LFS_IFTODT
DTTOIF -> LFS_DTTOIF
diffstat:
sbin/fsck_lfs/dir.c | 52 ++++++++++++++++++++--------------------
sbin/fsck_lfs/inode.c | 4 +-
sbin/fsck_lfs/pass1.c | 4 +-
sbin/fsck_lfs/pass2.c | 16 ++++++------
sbin/newfs_lfs/make_lfs.c | 22 ++++++++--------
sys/ufs/lfs/lfs.h | 59 +++++++++++++++++++++++++++++++++++++++++++++-
sys/ufs/lfs/lfs_vfsops.c | 6 ++--
sys/ufs/lfs/ulfs_dir.h | 59 ++-------------------------------------------
sys/ufs/lfs/ulfs_dirhash.c | 20 +++++++-------
sys/ufs/lfs/ulfs_dirhash.h | 4 +-
sys/ufs/lfs/ulfs_extattr.c | 16 ++++++------
sys/ufs/lfs/ulfs_lookup.c | 24 +++++++++---------
sys/ufs/lfs/ulfs_rename.c | 10 +++---
sys/ufs/lfs/ulfs_vnops.c | 8 +++---
14 files changed, 154 insertions(+), 150 deletions(-)
diffs (truncated from 851 to 300 lines):
diff -r c7f5f3a285fe -r 48a33fd7e44a sbin/fsck_lfs/dir.c
--- a/sbin/fsck_lfs/dir.c Sat Jun 08 02:13:33 2013 +0000
+++ b/sbin/fsck_lfs/dir.c Sat Jun 08 02:14:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.29 2013/06/08 02:12:56 dholland Exp $ */
+/* $NetBSD: dir.c,v 1.30 2013/06/08 02:14:46 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -57,7 +57,7 @@
int lfmode = 01700;
struct lfs_dirtemplate emptydir = {
.dot_ino = 0,
- .dot_reclen = DIRBLKSIZ,
+ .dot_reclen = LFS_DIRBLKSIZ,
};
struct lfs_dirtemplate dirhead = {
.dot_ino = 0,
@@ -66,7 +66,7 @@
.dot_namlen = 1,
.dot_name = ".",
.dotdot_ino = 0,
- .dotdot_reclen = DIRBLKSIZ - 12,
+ .dotdot_reclen = LFS_DIRBLKSIZ - 12,
.dotdot_type = LFS_DT_DIR,
.dotdot_namlen = 2,
.dotdot_name = ".."
@@ -77,7 +77,7 @@
.dot_namlen = 1,
.dot_name = ".",
.dotdot_ino = 0,
- .dotdot_reclen = DIRBLKSIZ - 12,
+ .dotdot_reclen = LFS_DIRBLKSIZ - 12,
.dotdot_namlen = 2,
.dotdot_name = ".."
};
@@ -135,14 +135,14 @@
struct ubuf *bp;
int dsize, n;
long blksiz;
- char dbuf[DIRBLKSIZ];
+ char dbuf[LFS_DIRBLKSIZ];
struct uvnode *vp;
if (idesc->id_type != DATA)
errexit("wrong type to dirscan %d", idesc->id_type);
if (idesc->id_entryno == 0 &&
- (idesc->id_filesize & (DIRBLKSIZ - 1)) != 0)
- idesc->id_filesize = roundup(idesc->id_filesize, DIRBLKSIZ);
+ (idesc->id_filesize & (LFS_DIRBLKSIZ - 1)) != 0)
+ idesc->id_filesize = roundup(idesc->id_filesize, LFS_DIRBLKSIZ);
blksiz = idesc->id_numfrags * fs->lfs_fsize;
if (chkrange(idesc->id_blkno, idesc->id_numfrags)) {
idesc->id_filesize -= blksiz;
@@ -181,7 +181,7 @@
blksiz = idesc->id_numfrags * fs->lfs_fsize;
bread(vp, idesc->id_lblkno, blksiz, NOCRED, 0, &bp);
- if (idesc->id_loc % DIRBLKSIZ == 0 && idesc->id_filesize > 0 &&
+ if (idesc->id_loc % LFS_DIRBLKSIZ == 0 && idesc->id_filesize > 0 &&
idesc->id_loc < blksiz) {
dp = (struct lfs_direct *) (bp->b_data + idesc->id_loc);
if (dircheck(idesc, dp))
@@ -192,7 +192,7 @@
fix = dofix(idesc, "DIRECTORY CORRUPTED");
bread(vp, idesc->id_lblkno, blksiz, NOCRED, 0, &bp);
dp = (struct lfs_direct *) (bp->b_data + idesc->id_loc);
- dp->d_reclen = DIRBLKSIZ;
+ dp->d_reclen = LFS_DIRBLKSIZ;
dp->d_ino = 0;
dp->d_type = 0;
dp->d_namlen = 0;
@@ -201,8 +201,8 @@
VOP_BWRITE(bp);
else
brelse(bp, 0);
- idesc->id_loc += DIRBLKSIZ;
- idesc->id_filesize -= DIRBLKSIZ;
+ idesc->id_loc += LFS_DIRBLKSIZ;
+ idesc->id_filesize -= LFS_DIRBLKSIZ;
return (dp);
}
dpok:
@@ -214,7 +214,7 @@
dp = (struct lfs_direct *) (bp->b_data + dploc);
idesc->id_loc += dp->d_reclen;
idesc->id_filesize -= dp->d_reclen;
- if ((idesc->id_loc % DIRBLKSIZ) == 0) {
+ if ((idesc->id_loc % LFS_DIRBLKSIZ) == 0) {
brelse(bp, 0);
return dp;
}
@@ -222,7 +222,7 @@
if (idesc->id_loc < blksiz && idesc->id_filesize > 0 &&
dircheck(idesc, ndp) == 0) {
brelse(bp, 0);
- size = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ);
+ size = LFS_DIRBLKSIZ - (idesc->id_loc % LFS_DIRBLKSIZ);
idesc->id_loc += size;
idesc->id_filesize -= size;
if (idesc->id_fix == IGNORE)
@@ -253,7 +253,7 @@
u_char namlen, type;
int spaceleft;
- spaceleft = DIRBLKSIZ - (idesc->id_loc % DIRBLKSIZ);
+ spaceleft = LFS_DIRBLKSIZ - (idesc->id_loc % LFS_DIRBLKSIZ);
if (dp->d_ino >= maxino ||
dp->d_reclen == 0 ||
dp->d_reclen > spaceleft ||
@@ -267,7 +267,7 @@
}
if (dp->d_ino == 0)
return (1);
- size = DIRSIZ(0, dp, 0);
+ size = LFS_DIRSIZ(0, dp, 0);
namlen = dp->d_namlen;
type = dp->d_type;
if (dp->d_reclen < size ||
@@ -363,9 +363,9 @@
int newlen, oldlen;
newent.d_namlen = strlen(idesc->id_name);
- newlen = DIRSIZ(0, &newent, 0);
+ newlen = LFS_DIRSIZ(0, &newent, 0);
if (dirp->d_ino != 0)
- oldlen = DIRSIZ(0, dirp, 0);
+ oldlen = LFS_DIRSIZ(0, dirp, 0);
else
oldlen = 0;
if (dirp->d_reclen - oldlen < newlen)
@@ -541,8 +541,8 @@
idesc.id_name = name;
vp = vget(fs, parent);
dp = VTOD(vp);
- if (dp->di_size % DIRBLKSIZ) {
- dp->di_size = roundup(dp->di_size, DIRBLKSIZ);
+ if (dp->di_size % LFS_DIRBLKSIZ) {
+ dp->di_size = roundup(dp->di_size, LFS_DIRBLKSIZ);
inodirty(VTOI(vp));
}
if ((ckinode(dp, &idesc) & ALTERED) != 0)
@@ -563,7 +563,7 @@
{
daddr_t lastbn;
struct ubuf *bp;
- char *cp, firstblk[DIRBLKSIZ];
+ char *cp, firstblk[LFS_DIRBLKSIZ];
lastbn = lblkno(fs, dp->di_size);
if (lastbn >= ULFS_NDADDR - 1 || dp->di_db[lastbn] == 0 || dp->di_size == 0)
@@ -578,14 +578,14 @@
(long) dblksize(fs, dp, lastbn + 1), NOCRED, 0, &bp);
if (bp->b_flags & B_ERROR)
goto bad;
- memcpy(firstblk, bp->b_data, DIRBLKSIZ);
+ memcpy(firstblk, bp->b_data, LFS_DIRBLKSIZ);
bread(vp, lastbn, fs->lfs_bsize, NOCRED, 0, &bp);
if (bp->b_flags & B_ERROR)
goto bad;
- memcpy(bp->b_data, firstblk, DIRBLKSIZ);
- for (cp = &bp->b_data[DIRBLKSIZ];
+ memcpy(bp->b_data, firstblk, LFS_DIRBLKSIZ);
+ for (cp = &bp->b_data[LFS_DIRBLKSIZ];
cp < &bp->b_data[fs->lfs_bsize];
- cp += DIRBLKSIZ)
+ cp += LFS_DIRBLKSIZ)
memcpy(cp, &emptydir, sizeof emptydir);
VOP_BWRITE(bp);
bread(vp, dp->di_db[lastbn + 1],
@@ -635,9 +635,9 @@
return (0);
}
memcpy(bp->b_data, dirp, sizeof(struct lfs_dirtemplate));
- for (cp = &bp->b_data[DIRBLKSIZ];
+ for (cp = &bp->b_data[LFS_DIRBLKSIZ];
cp < &bp->b_data[fs->lfs_fsize];
- cp += DIRBLKSIZ)
+ cp += LFS_DIRBLKSIZ)
memcpy(cp, &emptydir, sizeof emptydir);
VOP_BWRITE(bp);
dp->di_nlink = 2;
diff -r c7f5f3a285fe -r 48a33fd7e44a sbin/fsck_lfs/inode.c
--- a/sbin/fsck_lfs/inode.c Sat Jun 08 02:13:33 2013 +0000
+++ b/sbin/fsck_lfs/inode.c Sat Jun 08 02:14:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.48 2013/06/08 02:12:56 dholland Exp $ */
+/* $NetBSD: inode.c,v 1.49 2013/06/08 02:14:46 dholland Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -619,7 +619,7 @@
dp->di_blocks = btofsb(fs, fs->lfs_fsize);
n_files++;
inodirty(VTOI(vp));
- typemap[ino] = IFTODT(type);
+ typemap[ino] = LFS_IFTODT(type);
return (ino);
}
diff -r c7f5f3a285fe -r 48a33fd7e44a sbin/fsck_lfs/pass1.c
--- a/sbin/fsck_lfs/pass1.c Sat Jun 08 02:13:33 2013 +0000
+++ b/sbin/fsck_lfs/pass1.c Sat Jun 08 02:14:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass1.c,v 1.34 2013/06/08 02:11:11 dholland Exp $ */
+/* $NetBSD: pass1.c,v 1.35 2013/06/08 02:14:46 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -293,7 +293,7 @@
brelse(bp, 0);
}
- typemap[inumber] = IFTODT(mode);
+ typemap[inumber] = LFS_IFTODT(mode);
badblk = dupblk = 0;
idesc->id_number = inumber;
(void) ckinode(VTOD(vp), idesc);
diff -r c7f5f3a285fe -r 48a33fd7e44a sbin/fsck_lfs/pass2.c
--- a/sbin/fsck_lfs/pass2.c Sat Jun 08 02:13:33 2013 +0000
+++ b/sbin/fsck_lfs/pass2.c Sat Jun 08 02:14:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pass2.c,v 1.21 2013/06/08 02:12:56 dholland Exp $ */
+/* $NetBSD: pass2.c,v 1.22 2013/06/08 02:14:46 dholland Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -133,21 +133,21 @@
continue;
if (inp->i_isize < MINDIRSIZE) {
direrror(inp->i_number, "DIRECTORY TOO SHORT");
- inp->i_isize = roundup(MINDIRSIZE, DIRBLKSIZ);
+ inp->i_isize = roundup(MINDIRSIZE, LFS_DIRBLKSIZ);
if (reply("FIX") == 1) {
vp = vget(fs, inp->i_number);
dp = VTOD(vp);
dp->di_size = inp->i_isize;
inodirty(VTOI(vp));
}
- } else if ((inp->i_isize & (DIRBLKSIZ - 1)) != 0) {
+ } else if ((inp->i_isize & (LFS_DIRBLKSIZ - 1)) != 0) {
getpathname(pathbuf, sizeof(pathbuf), inp->i_number,
inp->i_number);
pwarn("DIRECTORY %s: LENGTH %lu NOT MULTIPLE OF %d",
- pathbuf, (unsigned long) inp->i_isize, DIRBLKSIZ);
+ pathbuf, (unsigned long) inp->i_isize, LFS_DIRBLKSIZ);
if (preen)
printf(" (ADJUSTED)\n");
- inp->i_isize = roundup(inp->i_isize, DIRBLKSIZ);
+ inp->i_isize = roundup(inp->i_isize, LFS_DIRBLKSIZ);
if (preen || reply("ADJUST") == 1) {
vp = vget(fs, inp->i_number);
dp = VTOD(vp);
@@ -235,7 +235,7 @@
proto.d_type = LFS_DT_DIR;
proto.d_namlen = 1;
(void) strlcpy(proto.d_name, ".", sizeof(proto.d_name));
- entrysize = DIRSIZ(0, &proto, 0);
+ entrysize = LFS_DIRSIZ(0, &proto, 0);
if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) {
pfatal("CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS %s\n",
dirp->d_name);
@@ -266,9 +266,9 @@
proto.d_type = LFS_DT_DIR;
proto.d_namlen = 2;
(void) strlcpy(proto.d_name, "..", sizeof(proto.d_name));
- entrysize = DIRSIZ(0, &proto, 0);
+ entrysize = LFS_DIRSIZ(0, &proto, 0);
if (idesc->id_entryno == 0) {
- n = DIRSIZ(0, dirp, 0);
+ n = LFS_DIRSIZ(0, dirp, 0);
if (dirp->d_reclen < n + entrysize)
goto chk2;
proto.d_reclen = dirp->d_reclen - n;
diff -r c7f5f3a285fe -r 48a33fd7e44a sbin/newfs_lfs/make_lfs.c
--- a/sbin/newfs_lfs/make_lfs.c Sat Jun 08 02:13:33 2013 +0000
+++ b/sbin/newfs_lfs/make_lfs.c Sat Jun 08 02:14:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make_lfs.c,v 1.25 2013/06/08 02:12:56 dholland Exp $ */
+/* $NetBSD: make_lfs.c,v 1.26 2013/06/08 02:14:46 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.25 2013/06/08 02:12:56 dholland Exp $");
+__RCSID("$NetBSD: make_lfs.c,v 1.26 2013/06/08 02:14:46 dholland Exp $");
#endif
#endif /* not lint */
@@ -285,16 +285,16 @@
char *cp;
int i, spcleft;
- spcleft = DIRBLKSIZ;
+ spcleft = LFS_DIRBLKSIZ;
for (cp = bufp, i = 0; i < entries - 1; i++) {
- protodir[i].d_reclen = DIRSIZ(NEWDIRFMT, &protodir[i], 0);
Home |
Main Index |
Thread Index |
Old Index