Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/util-linux/volume_id/ext.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/util-linux/volume_id/ext.c
r2725 r3232 20 20 21 21 #include "volume_id_internal.h" 22 #include "bb_e2fs_defs.h" 22 23 23 struct ext2_super_block {24 uint32_t inodes_count;25 uint32_t blocks_count;26 uint32_t r_blocks_count;27 uint32_t free_blocks_count;28 uint32_t free_inodes_count;29 uint32_t first_data_block;30 uint32_t log_block_size;31 uint32_t dummy3[7];32 uint8_t magic[2];33 uint16_t state;34 uint32_t dummy5[8];35 uint32_t feature_compat;36 uint32_t feature_incompat;37 uint32_t feature_ro_compat;38 uint8_t uuid[16];39 uint8_t volume_name[16];40 } PACKED;41 42 #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0000000443 #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0000000844 24 #define EXT_SUPERBLOCK_OFFSET 0x400 45 25 … … 55 35 return -1; 56 36 57 if (es-> magic[0] != 0123 || es->magic[1] != 0357) {37 if (es->s_magic != cpu_to_le16(EXT2_SUPER_MAGIC)) { 58 38 dbg("ext: no magic found"); 59 39 return -1; … … 62 42 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 63 43 // volume_id_set_label_raw(id, es->volume_name, 16); 64 volume_id_set_label_string(id, es->volume_name, 16);65 volume_id_set_uuid(id, es-> uuid, UUID_DCE);44 volume_id_set_label_string(id, (void*)es->s_volume_name, 16); 45 volume_id_set_uuid(id, es->s_uuid, UUID_DCE); 66 46 dbg("ext: label '%s' uuid '%s'", id->label, id->uuid); 67 47 68 // if ((le32_to_cpu(es->feature_compat) & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) 69 // id->type = "ext3"; 70 // else 71 // id->type = "ext2"; 72 48 #if ENABLE_FEATURE_BLKID_TYPE 49 if ((es->s_feature_ro_compat & cpu_to_le32(EXT4_FEATURE_RO_COMPAT_HUGE_FILE | EXT4_FEATURE_RO_COMPAT_DIR_NLINK)) 50 || (es->s_feature_incompat & cpu_to_le32(EXT4_FEATURE_INCOMPAT_EXTENTS | EXT4_FEATURE_INCOMPAT_64BIT)) 51 ) { 52 id->type = "ext4"; 53 } 54 else if (es->s_feature_compat & cpu_to_le32(EXT3_FEATURE_COMPAT_HAS_JOURNAL)) 55 id->type = "ext3"; 56 else 57 id->type = "ext2"; 58 #endif 73 59 return 0; 74 60 }
Note:
See TracChangeset
for help on using the changeset viewer.