VFS locking questions

看板FB_hackers作者時間18年前 (2007/08/13 14:38), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
Hi, I have a couple of questions regarding VFS, since I'm trying to SMPify the fdescfs code in an effort to get some experience with VFS and freebsd locking... What is really LK_INTERLOCK? When should it be used? When should one acquire it (with VI_LOCK i assume), and what are the "semantics"? Let's say I have a function that should return a locked vnode. I lock the hash-table with a regular mutex. Then, when I traverse the list, I check if the entry is what I look for. If it is, I call VI_LOCK() on the vnode, use vget to increment refcount, and then use vn_lock(vp, LK_EXCLUSIVE...) to lock the vnode before the function returns. Is this correct behaviour? The LK_INTERLOCK bothers me a bit, because I'm not 100% sure on how it works. -- Ulf Lilleengen _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
文章代碼(AID): #16l_nb00 (FB_hackers)
文章代碼(AID): #16l_nb00 (FB_hackers)