對我們的塊驅動程序的參數進行設置(磁頭,柱面,扇區/柱面),通過對fosp中的getgeo成員進行賦值:
static struct block_device_operations simp_blkdev_fops={
? ? ? ? .owner? ? ? ? = THIS_MODULE,
? ? ? ? .getgeo? ? ? ? = simp_blkdev_getgeo,
};
然后實現simp_blkdev_getgeo函數:
static int simp_blkdev_getgeo(struct block_device *bdev,?struct hd_geometry *geo);
geo->sector = ?*;
geo->head = ?*;
完成塊設備的參數設置。