Hi all
This is my first post in the mailing list, and I'm unsure if the question is relevant to this mailing list.
I want to know: What kind of lock does mutex_enter acquire? Is it Exclusive? or it can be shared?
I'm specially referring to this in comparison to the way locks are acquired in BSD. Here is an excerpt of the code:
 

mtx_lock(&ip->i_interlock);
ip->i_usecount--;

if (ip->i_usecount > 0) {
lockmgr(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock,
    NULL);
return;
}
mtx_unlock(&ip->i_interlock);
mtx_destroy(&ip->i_interlock);
lockdestroy(&ip->i_lock);
vrele(ip->i_devvp);
FREE(ip, M_NTFSNTNODE);

Here, mtx_lock, ip->i_usecount--, followed by mtx_unlock, I suppose can be done by
VN_RELE(ip);
 
but, what is the significance of lockmgr() function, and how does solaris deal with that, what is the corresponding function in solaris.
 
Thanks
Manish
_______________________________________________
ufs-discuss mailing list
[email protected]

Reply via email to