From: 黄涛 Date: Sun, 31 Jul 2011 16:21:45 +0000 (+0800) Subject: Revert "temp revert msdos change" X-Git-Tag: firefly_0821_release~9830 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b0335571664503a3f761e019f78d26e21a685630;p=firefly-linux-kernel-4.4.55.git Revert "temp revert msdos change" This reverts commit 8937476fff671d634c8b8df256d824fce0e60746. --- diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 5f79a6677c69..3c47d5db12d7 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c @@ -452,6 +452,13 @@ int msdos_partition(struct parsed_partitions *state) return 0; } +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("\n%s..%d... ==== Begin to parse sdcard-partition. ====xbw[mmc0]===\n",__FUNCTION__, __LINE__); + } +#endif + /* * Now that the 55aa signature is present, this is probably * either the boot sector of a FAT filesystem or a DOS-type @@ -461,6 +468,12 @@ int msdos_partition(struct parsed_partitions *state) p = (struct partition *) (data + 0x1be); for (slot = 1; slot <= 4; slot++, p++) { if (p->boot_ind != 0 && p->boot_ind != 0x80) { +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("%s..%d... ==== The sdcard has not MBR. ====xbw[mmc0]===\n",__FUNCTION__, __LINE__); + } +#endif /* * Even without a valid boot inidicator value * its still possible this is valid FAT filesystem @@ -471,9 +484,21 @@ int msdos_partition(struct parsed_partitions *state) && fat_valid_media(fb->media)) { strlcat(state->pp_buf, "\n", PAGE_SIZE); put_dev_sector(sect); +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("%s..%d... ==== The DBR(slot=%d) is valid. ====xbw[mmc0]===\n",__FUNCTION__, __LINE__, slot); + } +#endif return 1; } else { put_dev_sector(sect); +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("%s..%d... ==== The DBR is invalid. ====xbw[mmc0]===\n",__FUNCTION__, __LINE__); + } +#endif return 0; } } @@ -496,13 +521,25 @@ int msdos_partition(struct parsed_partitions *state) * First find the primary and DOS-type extended partitions. * On the second pass look inside *BSD, Unixware and Solaris partitions. */ - +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("%s..%d... ==== The sdcard has MBR. ====xbw[mmc0]===\n", __FUNCTION__, __LINE__); + } +#endif state->next = 5; for (slot = 1 ; slot <= 4 ; slot++, p++) { sector_t start = start_sect(p)*sector_size; sector_t size = nr_sects(p)*sector_size; if (!size) continue; +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("%s..%d... ==== partition-%d, size=%luKB ====xbw[mmc0]===\n",\ + __FUNCTION__, __LINE__, slot, size/2); + } +#endif if (is_extended_partition(p)) { /* * prevent someone doing mkfs or mkswap on an @@ -512,6 +549,12 @@ int msdos_partition(struct parsed_partitions *state) */ sector_t n = 2; n = min(size, max(sector_size, n)); +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("%s...%d... ==== extend partition-%d....====xbw[mmc0]===\n",__FUNCTION__, __LINE__, slot); + } +#endif put_partition(state, slot, start, n); strlcat(state->pp_buf, " <", PAGE_SIZE); @@ -519,6 +562,12 @@ int msdos_partition(struct parsed_partitions *state) strlcat(state->pp_buf, " >", PAGE_SIZE); continue; } +#if defined(CONFIG_SDMMC_RK29) && !defined(CONFIG_SDMMC_RK29_OLD) + if(179 == MAJOR(bdev->bd_dev)) + { + printk("%s..%d... ==== main partition-%d....====xbw[mmc0]===\n",__FUNCTION__, __LINE__, slot); + } +#endif put_partition(state, slot, start, size); if (SYS_IND(p) == LINUX_RAID_PARTITION) state->parts[slot].flags = ADDPART_FLAG_RAID;