summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/fsck.h
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2004-09-01 05:48:06 +0000
committerscottl <scottl@FreeBSD.org>2004-09-01 05:48:06 +0000
commit6703db134608d1953b911a81784b3e83dcc59e74 (patch)
treeca85a75b39183c91099ae8817abea2672f6adcd0 /sbin/fsck_ffs/fsck.h
parent0067bbd33a34b1b53ea517ebf1d167b22fd6e37d (diff)
downloadFreeBSD-src-6703db134608d1953b911a81784b3e83dcc59e74.zip
FreeBSD-src-6703db134608d1953b911a81784b3e83dcc59e74.tar.gz
Create DIP_SET() and IBLK_SET() macros to fix lvalue warnings.
Inspired by: kan
Diffstat (limited to 'sbin/fsck_ffs/fsck.h')
-rw-r--r--sbin/fsck_ffs/fsck.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h
index 1763fa1..b654249 100644
--- a/sbin/fsck_ffs/fsck.h
+++ b/sbin/fsck_ffs/fsck.h
@@ -56,6 +56,13 @@ union dinode {
((sblock.fs_magic == FS_UFS1_MAGIC) ? \
(dp)->dp1.field : (dp)->dp2.field)
+#define DIP_SET(dp, field, val) do { \
+ if (sblock.fs_magic == FS_UFS1_MAGIC) \
+ (dp)->dp1.field = (val); \
+ else \
+ (dp)->dp2.field = (val); \
+ } while (0)
+
/*
* Each inode on the file system is described by the following structure.
* The linkcnt is initially set to the value in the inode. Each time it
@@ -107,10 +114,18 @@ struct bufarea {
} b_un;
char b_dirty;
};
+
#define IBLK(bp, i) \
((sblock.fs_magic == FS_UFS1_MAGIC) ? \
(bp)->b_un.b_indir1[i] : (bp)->b_un.b_indir2[i])
+#define IBLK_SET(bp, i, val) do { \
+ if (sblock.fs_magic == FS_UFS1_MAGIC) \
+ (bp)->b_un.b_indir1[i] = (val); \
+ else \
+ (bp)->b_un.b_indir2[i] = (val); \
+ } while (0)
+
#define B_INUSE 1
#define MINBUFS 5 /* minimum number of buffers required */
OpenPOWER on IntegriCloud