diff --git a/books/21cnbao/simple/本书代码/第6章-字符设备/VirtualDisk.c b/books/21cnbao/simple/本书代码/第6章-字符设备/VirtualDisk.c index 70ace76..14d2f35 100644 --- a/books/21cnbao/simple/本书代码/第6章-字符设备/VirtualDisk.c +++ b/books/21cnbao/simple/本书代码/第6章-字符设备/VirtualDisk.c @@ -73,7 +73,7 @@ static int VirtualDisk_ioctl( #else //long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); //long (*compat_ioctl) (struct file *file, unsigned int cmd, unsigned long arg) -static long VirtualDisk_compat_ioctl( +static long VirtualDisk_unlocked_ioctl( struct file *filp, unsigned int cmd, unsigned long arg) @@ -110,7 +110,7 @@ static ssize_t VirtualDisk_read(struct file *filp, char __user *buf, size_t size int ret = 0;/*ֵ*/ struct VirtualDisk *devp = filp->private_data; /*豸ṹָ*/ - printk("p = %d\n", p); + printk("p = %ld\n", p); /*ͻȡЧĶ*/ if (p >= VIRTUALDISK_SIZE) /*Ҫȡƫƴ豸ڴռ*/ return count ? - ENXIO: 0;/*ȡַ*/ @@ -208,7 +208,7 @@ static const struct file_operations VirtualDisk_fops = #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) .ioctl = VirtualDisk_ioctl,/*ƺ*/ #else - .compat_ioctl = VirtualDisk_compat_ioctl, + .compat_ioctl = VirtualDisk_unlocked_ioctl, #endif .open = VirtualDisk_open,/*豸*/ .release = VirtualDisk_release,/*ͷ豸*/