Hi, everybody I am working on transfer RaidFrame from FreeBSD4.x to FreeBSD5.0. Scott Long has transfered RAIDFrame from NetBSD to FreeBSD 4.x. Now, I am transfering those codes to FreeBSD5.0. This is my first strolling in FreeBSD5.0 kernel. Firstly, I transfered some codes based on the relationship of vinum and ccd between 4.x and 5.0. It could compile successfully. Now when I boot the box, the system tell me: panic: sleeping without a mutex Debugger("panic") Stopped at Debugger+0x40: xorl %eax,%eax I traced the source code and found some information as follow: These is a function on RAIDFrame in the FreeBSD4.x . static __inline int RF_LTSLEEP(void *cond, int pri, const char *text, int time, struct simplelock *mutex) { int ret; if (mutex != NULL) simple_unlock(mutex); ret = tsleep(cond, pri, text, time); if (mutex != NULL) simple_lock(mutex); return (ret); } These is the above funtion I modifed to support FreeBSD5.0: static __inline int RF_LTSLEEP(void *cond, int pri, const char *text, int time, struct mtx *mutex) { int ret; if (mutex != NULL) mtx_unlock(mutex); ret = tsleep(cond, pri, text, time); if (mutex != NULL) mtx_lock(mutex); return (ret); } I have a clear ideal to use mtx. I think there are maybe some problem in using the mtx. Thank you very much! Best Regards Ouyang Kai 从网站得到更多信息。MSN Explorer 免费下载:http://explorer.msn.com/lccn |
- help! Rasa Karapandza
- kai ouyang