intmain(){ constchar*devicePath="/dev/sda";// 设备路径 intfd=open(devicePath,O_RDWR);// 打开设备文件 if(fd==-1){ perror("无法打开设备文件"); return1; } structblock_device*bdev=blkdev_get_by_path(devicePath,FMODE_READ|FMODE_WRITE,NULL);// 获取 block_device 结构体指针 if(!bdev...