Skip to content

Commit

Permalink
s/partition_table/mbr_partition_table for #14.
Browse files Browse the repository at this point in the history
  • Loading branch information
bamos committed Oct 12, 2014
1 parent af82232 commit 0c5de1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/gray-crawler/mbr/mbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int64_t mbr_partition_offset(struct disk_mbr mbr, int pte)

/* prints partition entry according to Wikipedia:
* http://en.wikipedia.org/wiki/Master_boot_record */
int mbr_print_partition(struct partition_table_entry pte)
int mbr_print_partition(struct mbr_partition_table_entry pte)
{
char size_buf[SECTOR_SIZE];
memset(size_buf, 0x00, SECTOR_SIZE);
Expand Down Expand Up @@ -285,13 +285,13 @@ int mbr_serialize_pt(struct pt pt, struct bitarray* bits,
bool mbr_get_next_partition(struct pt pt, struct pte* pte)
{
struct disk_mbr* mbr = (struct disk_mbr*) pt.pt_info;
struct partition_table_entry* entry = (struct partition_table_entry*)
malloc(sizeof(struct partition_table_entry));
struct mbr_partition_table_entry* entry = (struct mbr_partition_table_entry*)
malloc(sizeof(struct mbr_partition_table_entry));
static int pte_num = 0;

if (pte_num < 4)
{
memcpy(entry, &mbr->pt[pte_num], sizeof(struct partition_table_entry));
memcpy(entry, &mbr->pt[pte_num], sizeof(struct mbr_partition_table_entry));
pte->pt_num = pte_num;
pte->pt_off = entry->first_sector_lba * SECTOR_SIZE;
pte->pte_info = (void*) entry;
Expand All @@ -312,8 +312,8 @@ int mbr_serialize_pte(struct pte pt_pte,
{
struct bson_info* serialized;
struct bson_kv value;
struct partition_table_entry* pte =
(struct partition_table_entry *) pt_pte.pte_info;
struct mbr_partition_table_entry* pte =
(struct mbr_partition_table_entry *) pt_pte.pte_info;
int32_t partition_type;
int32_t final_sector;
int ret;
Expand Down
4 changes: 2 additions & 2 deletions src/include/mbr.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "bitarray.h"
#include "gray-crawler.h"

struct partition_table_entry
struct mbr_partition_table_entry
{
uint8_t status;
uint8_t start_chs[3];
Expand All @@ -48,7 +48,7 @@ struct disk_mbr
uint8_t code[440];
uint32_t disk_signature;
uint16_t reserved;
struct partition_table_entry pt[4];
struct mbr_partition_table_entry pt[4];
uint8_t signature[2];
}__attribute__((packed));

Expand Down

0 comments on commit 0c5de1f

Please sign in to comment.