Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Tidy the MAXSYMLINKLEN macros.
details: https://anonhg.NetBSD.org/src/rev/3a55d84fcb74
branches: trunk
changeset: 340338:3a55d84fcb74
user: dholland <dholland%NetBSD.org@localhost>
date: Tue Sep 01 06:12:33 2015 +0000
description:
Tidy the MAXSYMLINKLEN macros.
diffstat:
sbin/fsck_lfs/setup.c | 8 ++++----
sbin/newfs_lfs/make_lfs.c | 8 ++++----
sys/ufs/lfs/lfs_accessors.h | 12 ++++++++----
3 files changed, 16 insertions(+), 12 deletions(-)
diffs (88 lines):
diff -r 0e7cdeb4d595 -r 3a55d84fcb74 sbin/fsck_lfs/setup.c
--- a/sbin/fsck_lfs/setup.c Tue Sep 01 06:12:04 2015 +0000
+++ b/sbin/fsck_lfs/setup.c Tue Sep 01 06:12:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.57 2015/09/01 06:12:04 dholland Exp $ */
+/* $NetBSD: setup.c,v 1.58 2015/09/01 06:12:33 dholland Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -394,10 +394,10 @@
sbdirty();
}
}
- if (lfs_sb_getmaxsymlinklen(fs) != ULFS1_MAXSYMLINKLEN) {
+ if (lfs_sb_getmaxsymlinklen(fs) != LFS_MAXSYMLINKLEN(fs)) {
pwarn("INCORRECT MAXSYMLINKLEN=%d IN SUPERBLOCK (SHOULD BE %zu)",
- lfs_sb_getmaxsymlinklen(fs), ULFS1_MAXSYMLINKLEN);
- lfs_sb_setmaxsymlinklen(fs, ULFS1_MAXSYMLINKLEN);
+ lfs_sb_getmaxsymlinklen(fs), LFS_MAXSYMLINKLEN(fs));
+ lfs_sb_setmaxsymlinklen(fs, LFS_MAXSYMLINKLEN(fs));
if (preen)
printf(" (FIXED)\n");
if (preen || reply("FIX") == 1) {
diff -r 0e7cdeb4d595 -r 3a55d84fcb74 sbin/newfs_lfs/make_lfs.c
--- a/sbin/newfs_lfs/make_lfs.c Tue Sep 01 06:12:04 2015 +0000
+++ b/sbin/newfs_lfs/make_lfs.c Tue Sep 01 06:12:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: make_lfs.c,v 1.46 2015/09/01 06:12:04 dholland Exp $ */
+/* $NetBSD: make_lfs.c,v 1.47 2015/09/01 06:12:33 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.46 2015/09/01 06:12:04 dholland Exp $");
+__RCSID("$NetBSD: make_lfs.c,v 1.47 2015/09/01 06:12:33 dholland Exp $");
#endif
#endif /* not lint */
@@ -152,7 +152,7 @@
.dlfs_fbmask = DFL_LFS_FBMASK,
.dlfs_blktodb = 0,
.dlfs_sushift = 0,
- .dlfs_maxsymlinklen = ULFS1_MAXSYMLINKLEN,
+ .dlfs_maxsymlinklen = LFS32_MAXSYMLINKLEN,
.dlfs_sboffs = { 0 },
.dlfs_nclean = 0,
.dlfs_fsmnt = { 0 },
@@ -216,7 +216,7 @@
.dlfs_blktodb = 0,
.dlfs_sushift = 0,
.dlfs_sboffs = { 0 },
- .dlfs_maxsymlinklen = ULFS2_MAXSYMLINKLEN,
+ .dlfs_maxsymlinklen = LFS64_MAXSYMLINKLEN,
.dlfs_nclean = 0,
.dlfs_fsmnt = { 0 },
.dlfs_pflags = LFS_PF_CLEAN,
diff -r 0e7cdeb4d595 -r 3a55d84fcb74 sys/ufs/lfs/lfs_accessors.h
--- a/sys/ufs/lfs/lfs_accessors.h Tue Sep 01 06:12:04 2015 +0000
+++ b/sys/ufs/lfs/lfs_accessors.h Tue Sep 01 06:12:33 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_accessors.h,v 1.19 2015/09/01 06:12:04 dholland Exp $ */
+/* $NetBSD: lfs_accessors.h,v 1.20 2015/09/01 06:12:33 dholland Exp $ */
/* from NetBSD: lfs.h,v 1.165 2015/07/24 06:59:32 dholland Exp */
/* from NetBSD: dinode.h,v 1.22 2013/01/22 09:39:18 dholland Exp */
@@ -208,12 +208,16 @@
/*
* Maximum length of a symlink that can be stored within the inode.
*/
-#define ULFS1_MAXSYMLINKLEN ((ULFS_NDADDR + ULFS_NIADDR) * sizeof(int32_t))
-#define ULFS2_MAXSYMLINKLEN ((ULFS_NDADDR + ULFS_NIADDR) * sizeof(int64_t))
+#define LFS32_MAXSYMLINKLEN ((ULFS_NDADDR + ULFS_NIADDR) * sizeof(int32_t))
+#define LFS64_MAXSYMLINKLEN ((ULFS_NDADDR + ULFS_NIADDR) * sizeof(int64_t))
+#define LFS_MAXSYMLINKLEN(fs) \
+ ((fs)->lfs_is64 ? LFS64_MAXSYMLINKLEN : LFS32_MAXSYMLINKLEN)
+
+/* get rid of this eventually */
#define ULFS_MAXSYMLINKLEN(ip) \
((ip)->i_ump->um_fstype == ULFS1) ? \
- ULFS1_MAXSYMLINKLEN : ULFS2_MAXSYMLINKLEN
+ LFS32_MAXSYMLINKLEN : LFS64_MAXSYMLINKLEN
#define DINOSIZE(fs) ((fs)->lfs_is64 ? sizeof(struct lfs64_dinode) : sizeof(struct lfs32_dinode))
Home |
Main Index |
Thread Index |
Old Index