DragonFly BSD
DragonFly kernel List (threaded) for 2006-08
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: VOP_RENAME of the future

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Aug 2006 15:53:50 -0700 (PDT)

:It seems then that I was wrong. I misunderstood the meaning of the lock
:flags. I thought LK_RETRY is the way for making the lock acquisition
:blocking, and without that the lock acquisition becomes non-blocking 
:and thence fallible.
:Sorry for arguing based on a confused perception of the concepts

    This is a very common mistake, and it's really the fault of the lockmgr
    code, not you.  The original designers of the lockmgr code in their
    infinite wisdom made the locking code not retry a blocked lock by 
    default.  It's absolutely the wrong way to do it.  So if you do a 
    lockmgr LK_EXCLUSIVE without LK_RETRY, it will still block, but it 
    won't retry after it unblocks.

    The confusion is exasperated by the fact that you can set LK_RETRY
    in the default flags in the lockinit() call, and then not have to
    specify it in the lockmgr() call to have it still retry.

    I spent gobs of time cleaning up the lockmgr code.  The LK_RETRY-as-default
    is one bit that I haven't cleaned up yet.

					Matthew Dillon 

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]