static int check_geom(struct device *dev, int media, struct bootsector *boot) { int sect; if(media >= 0xfc && media <= 0xff) return 1; /* old DOS */ if (!IS_MFORMAT_ONLY(dev)) { if(compare(dev->sectors, 19) && compare(dev->sectors, 23) && compare(dev->sectors, 24) && compare(dev->sectors, 46) && compare(dev->sectors, 48)) return 1; /* check against contradictory info from configuration file */ if(compare(dev->heads, 2)) return 1; } /* check against info from boot */ if(boot) { sect = WORD(nsect); if((sect != 19 && sect != 23 && sect != 24 && sect != 46 && sect != 48) || (!IS_MFORMAT_ONLY(dev) && compare(dev->sectors, sect)) || WORD(nheads) !=2) return 1; } return 0; }
static int compare_geom(struct device *dev, struct device *orig_dev) { if(IS_MFORMAT_ONLY(orig_dev)) return 0; /* geometry only for mformatting ==> ok */ if(!orig_dev || !orig_dev->tracks || !dev || !dev->tracks) return 0; /* no original device. This is ok */ return(orig_dev->tracks != dev->tracks || orig_dev->heads != dev->heads || orig_dev->sectors != dev->sectors); }