fixed some compilation problems with code generated for bit fields wider than 64 bits
use sg->length instead of sg_dma_len so __free_pages won't crash