On 06/15/2018 06:39 AM, Tuan Viet Nguyen wrote:
Hello,
I'm trying to integrate a FS supporting async lock (can run callback when a lock is granted) as ganesha FSAL. For the moment I do not make any upcalls to FSAL and the lock still work. I wonder how it can work? may be SAL handles that itself, does it have an internal lock queue and tries/retries the waiting lock by making lock calls again frequently to the FSAL to know when it can grant the lock?
Can somebody shed some light on that? And if it is the case, I imagine that making the grant_lock upcall will increase the performance? Or there are even more benefits?
Thank you Viet
So, SAL won't grant locks itself, it always calls lock_op2() in the FSAL to grant the lock. However, if there is a blocking lock, and the FSAL doesn't support async locks, then it will keep track of the lock itself, and whenever a lock is released, it will check to see if any blocked locks are now unblocked, and if so call lock_op2() to grant those locks. What does your FSAL set for fso_lock_support_async_block? What does your lock_op2() return for a normal lock attempt? Daniel