sys/vfs/hammer: Cleanup HAMMER_ENCODE_XXX() macros master
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 6 Jul 2015 10:07:48 +0000 (19:07 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 6 Jul 2015 15:24:53 +0000 (00:24 +0900)
- Define HAMMER_ENCODE_XXX() macros using HAMMER_ENCODE()
  which is a generic version of these.

sys/vfs/hammer/hammer_disk.h

index 65adcb4..61e17e6 100644 (file)
@@ -193,21 +193,12 @@ typedef u_int32_t hammer_crc_t;
        ((zone_base) |                                  \
        HAMMER_VOL_ENCODE(vol_no) |                     \
        HAMMER_SHORT_OFF_ENCODE(offset))
-
 #define HAMMER_ENCODE_RAW_VOLUME(vol_no, offset)       \
-       (HAMMER_ZONE_RAW_VOLUME |                       \
-       HAMMER_VOL_ENCODE(vol_no) |                     \
-       HAMMER_SHORT_OFF_ENCODE(offset))
-
+       HAMMER_ENCODE(HAMMER_ZONE_RAW_VOLUME, vol_no, offset)
 #define HAMMER_ENCODE_RAW_BUFFER(vol_no, offset)       \
-       (HAMMER_ZONE_RAW_BUFFER |                       \
-       HAMMER_VOL_ENCODE(vol_no) |                     \
-       HAMMER_SHORT_OFF_ENCODE(offset))
-
+       HAMMER_ENCODE(HAMMER_ZONE_RAW_BUFFER, vol_no, offset)
 #define HAMMER_ENCODE_FREEMAP(vol_no, offset)          \
-       (HAMMER_ZONE_FREEMAP |                          \
-       HAMMER_VOL_ENCODE(vol_no) |                     \
-       HAMMER_SHORT_OFF_ENCODE(offset))
+       HAMMER_ENCODE(HAMMER_ZONE_FREEMAP, vol_no, offset)
 
 /*
  * Translate a zone address to zone-2 address.