• J
    fdc: rework pick_geometry · f31937aa
    John Snow 提交于
    This one is the crazy one.
    
    fd_revalidate currently uses pick_geometry to tell if the diskette
    geometry has changed upon an eject/insert event, but it won't allow us
    to insert a 1.44MB diskette into a 2.88MB drive. This is inflexible.
    
    The new algorithm applies a new heuristic to guessing disk geometries
    that allows us to switch diskette types as long as the physical size
    matches before falling back to the old heuristic.
    
    The old one is roughly:
     - If the size (sectors) and type matches, choose it.
     - Fall back to the first geometry that matched our type.
    
    The new one is:
     - If the size (sectors) and type matches, choose it.
     - If the size (sectors) and physical size match, choose it.
     - Fall back to the first geometry that matched our type.
    Signed-off-by: NJohn Snow <jsnow@redhat.com>
    Reviewed-by: NEric Blake <eblake@redhat.com>
    Message-id: 1453495865-9649-11-git-send-email-jsnow@redhat.com
    f31937aa
fdc.c 81.3 KB