[RFC PATCH 1/4] bcache-tools: comments offset for members of struct cache_sb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds code comments to mark the offset of each member from
struct cache_sb. It is helpful for understand the super block on disk.

Signed-off-by: Coly Li <colyli@xxxxxxx>
---
 bcache.h | 64 ++++++++++++++++++++++++++++++--------------------------
 1 file changed, 34 insertions(+), 30 deletions(-)

diff --git a/bcache.h b/bcache.h
index c83f838..3fcf187 100644
--- a/bcache.h
+++ b/bcache.h
@@ -41,54 +41,58 @@ static const char bcache_magic[] = {
 #define SB_START		(SB_SECTOR * 512)
 
 struct cache_sb {
-	uint64_t		csum;
-	uint64_t		offset;	/* sector where this sb was written */
-	uint64_t		version;
+/*000*/	uint64_t		csum;
+	/* sector where this sb was written */
+/*008*/	uint64_t		offset;
+/*010*/	uint64_t		version;
 
-	uint8_t			magic[16];
+/*018*/	uint8_t			magic[16];
 
-	uint8_t			uuid[16];
+/*028*/	uint8_t			uuid[16];
 	union {
-		uint8_t		set_uuid[16];
-		uint64_t	set_magic;
+/*038*/		uint8_t		set_uuid[16];
+/*038*/		uint64_t	set_magic;
 	};
-	uint8_t			label[SB_LABEL_SIZE];
+/*048*/	uint8_t			label[SB_LABEL_SIZE];
 
-	uint64_t		flags;
-	uint64_t		seq;
-	uint64_t		pad[8];
+/*068*/	uint64_t		flags;
+/*070*/	uint64_t		seq;
+/*078*/	uint64_t		pad[8];
 
 	union {
 	struct {
-		/* Cache devices */
-		uint64_t	nbuckets;	/* device size */
+			/* Cache devices */
+/*0b8*/		uint64_t	nbuckets;	/* device size */
 
-		uint16_t	block_size;	/* sectors */
-		uint16_t	bucket_size;	/* sectors */
+/*0c0*/		uint16_t	block_size;	/* sectors */
+/*0c2*/		uint16_t	bucket_size;	/* sectors */
 
-		uint16_t	nr_in_set;
-		uint16_t	nr_this_dev;
+/*0c4*/		uint16_t	nr_in_set;
+/*0c6*/		uint16_t	nr_this_dev;
 	};
 	struct {
-		/* Backing devices */
-		uint64_t	data_offset;
-
-		/*
-		 * block_size from the cache device section is still used by
-		 * backing devices, so don't add anything here until we fix
-		 * things to not need it for backing devices anymore
-		 */
+			/* Backing devices */
+/*0b8*/		uint64_t	data_offset;
+
+			/*
+			 * block_size from the cache device section is still
+			 * used by backing devices, so don't add anything here
+			 * until we fix things to not need it for backing
+			 * devices anymore
+			 */
 	};
 	};
 
-	uint32_t		last_mount;	/* time_t */
+/*0c8*/	uint32_t		last_mount;	/* time_t */
 
-	uint16_t		first_bucket;
+/*0cc*/	uint16_t		first_bucket;
 	union {
-		uint16_t	njournal_buckets;
-		uint16_t	keys;
+/*0ce*/		uint16_t	njournal_buckets;
+/*0ce*/		uint16_t	keys;
 	};
-	uint64_t		d[SB_JOURNAL_BUCKETS];	/* journal buckets */
+	/* journal buckets */
+/*0d0*/	uint64_t		d[SB_JOURNAL_BUCKETS];
+/*8d0*/
 };
 
 static inline bool SB_IS_BDEV(const struct cache_sb *sb)
-- 
2.26.2




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux