- 论坛徽章:
- 0
|
回复 2# Tinnal
多谢Tinna。问题出现在 brd.c中 brd_ioctl中
当 bdev->bd_opners 大于1的时候,就返回设备 busy错误,
看了一下,这个bd_opners属于 block_device的一个成员变量,所以,我觉的,如果同时打开ram0,到ram15这么多设备
这个现象应该是不能避免的。不知道理解的对不对。
还有一个疑惑,为什么x86的机器这么测试没有问题。。。
//-----------brd_ioctl函数-----
error = -EBUSY;
//printk("%s-opener:%d\n",__func__,bdev->bd_openers);
if (bdev->bd_openers <= 1)
{
/*
* Kill the cache first, so it isn't written back to the
* device.
*
* Another thread might instantiate more buffercache here,
* but there is not much we can do to close that race.
*/
kill_bdev(bdev);
brd_free_pages(brd);
error = 0;
}
mutex_unlock(&bdev->bd_mutex);
mutex_unlock(&brd_mutex);
if(error)
printk("[%d]\n",error);
return error;
|
|