Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Allow superblock accessors that widen 32-bit dis...
details: https://anonhg.NetBSD.org/src/rev/8da257a5cdae
branches: trunk
changeset: 339657:8da257a5cdae
user: dholland <dholland%NetBSD.org@localhost>
date: Sun Aug 02 17:57:27 2015 +0000
description:
Allow superblock accessors that widen 32-bit disk fields to 64-bit
memory values.
diffstat:
sys/ufs/lfs/lfs_accessors.h | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (43 lines):
diff -r a27112301215 -r 8da257a5cdae sys/ufs/lfs/lfs_accessors.h
--- a/sys/ufs/lfs/lfs_accessors.h Sun Aug 02 17:56:24 2015 +0000
+++ b/sys/ufs/lfs/lfs_accessors.h Sun Aug 02 17:57:27 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_accessors.h,v 1.2 2015/07/28 05:14:23 dholland Exp $ */
+/* $NetBSD: lfs_accessors.h,v 1.3 2015/08/02 17:57:27 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 */
@@ -388,7 +388,7 @@
#define STRUCT_LFS struct lfs
#endif
-#define LFS_DEF_SB_ACCESSOR(type, field) \
+#define LFS_DEF_SB_ACCESSOR_FULL(type, type32, field) \
static __unused inline type \
lfs_sb_get##field(STRUCT_LFS *fs) \
{ \
@@ -402,19 +402,21 @@
static __unused inline void \
lfs_sb_add##field(STRUCT_LFS *fs, type val) \
{ \
- type *p = &fs->lfs_dlfs.dlfs_##field; \
+ type32 *p = &fs->lfs_dlfs.dlfs_##field; \
*p += val; \
} \
static __unused inline void \
lfs_sb_sub##field(STRUCT_LFS *fs, type val) \
{ \
- type *p = &fs->lfs_dlfs.dlfs_##field; \
+ type32 *p = &fs->lfs_dlfs.dlfs_##field; \
*p -= val; \
}
+#define LFS_DEF_SB_ACCESSOR(t, f) LFS_DEF_SB_ACCESSOR_FULL(t, t, f)
+
#define lfs_magic lfs_dlfs.dlfs_magic
#define lfs_version lfs_dlfs.dlfs_version
-LFS_DEF_SB_ACCESSOR(u_int32_t, size);
+LFS_DEF_SB_ACCESSOR_FULL(u_int64_t, u_int32_t, size);
LFS_DEF_SB_ACCESSOR(u_int32_t, ssize);
LFS_DEF_SB_ACCESSOR(u_int32_t, dsize);
LFS_DEF_SB_ACCESSOR(u_int32_t, bsize);
Home |
Main Index |
Thread Index |
Old Index