Lines Matching refs:owner

17  * information: Portions Copyright [yyyy] [name of copyright owner]
33 * grab it from the current owner (without informing the owner).
161 * that the lock page contained a zero, then it invalidates the owner's
167 * timeout on the lock. The owner's mapping to the unlock page
168 * is invalidated so that the driver will be woken again when the owner
329 struct segproc *owner; /* current owner of lock */
762 if (sdp == lp->owner) {
770 ASSERT(sdp != lp->owner);
914 lp->owner = NULL;
938 ASSERT(lp->owner == NULL);
967 ASSERT(lp->owner == NULL);
1046 ASSERT(lp->owner != sdp); /* Not current owner of lock */
1295 SegProc *owner = lp->owner;
1300 "seglock_lockfault: hdl=%p, sdp=%p, lp=%p owner=%p\n",
1301 (void *)dhp, (void *)sdp, (void *)lp, (void *)owner));
1306 /* If Lock has no current owner, give the mapping to new owner */
1307 if (owner == NULL) {
1308 DEBUGF(4, (CE_CONT, " lock has no current owner\n"));
1312 if (owner == sdp) {
1314 * Current owner is faulting on owned lock segment OR
1315 * Current owner is faulting on unlock page and has no waiters
1316 * Then can give the mapping to current owner
1319 DEBUGF(4, (CE_CONT, "lock owner faulting\n"));
1325 * Release the lock, owner, and owners mappings
1326 * As the owner is trying to write to the unlock page, leave
1330 DEBUGF(4, (CE_CONT, " owner fault on unlock seg w/ sleeper\n"));
1335 ASSERT(owner != sdp);
1338 * If old owner faulting on trash unlock mapping,
1345 DEBUGF(4, (CE_CONT, " old owner reloads trash mapping\n"));
1351 * Non-owner faulting. Need to check current LOCK state.
1354 * the owner cannot change its value before we change mappings
1357 * We do that by unloading the owner's mappings
1359 DEBUGF(4, (CE_CONT, " owner loses mappings to check lock state\n"));
1360 err = devmap_unload(owner->lockseg, lp->cookie, PAGESIZE);
1361 err |= devmap_unload(owner->unlockseg, lp->cookie, PAGESIZE);
1363 return (err); /* unable to remove owner mapping */
1366 * If lock is not held, then current owner mappings were
1367 * unloaded above and we can give the lock to the new owner
1371 "Free lock (%p): Giving mapping to new owner %d\n",
1381 * the lock while there is an owner.
1385 while ((owner = lp->owner) != NULL) {
1388 if ((lp->timeout == 0) || (owner->flag & SY_NOTIMEOUT)) {
1397 * to wake up and possibly steal this lock if the owner
1410 * Timeout and still old owner - steal lock
1411 * Force-Release lock and give old owner a trashpage mapping
1413 if ((rval == -1) && (lp->owner == owner)) {
1439 * Caller responsible for unloading old owner's mappings
1448 ASSERT(!((lp->owner == NULL) && (LOCK(lp) != 0)));
1454 /* current owner should not have a trash mapping */
1455 ASSERT(sdp != lp->owner);
1458 "new owner %d remapping old trash mapping\n",
1464 * abort before changing owner
1473 /* we have a new owner now */
1474 lp->owner = sdp;
1480 DEBUGF(4, (CE_CONT, "new owner %d gets lock mapping", ddi_get_pid()));
1490 * while here, give new owner a valid mapping to unlock
1501 * Unload owner's mappings, release the lock and wakeup any sleepers
1502 * If trash, then the old owner is given a trash mapping
1503 * => old owner held lock too long and caused a timeout
1508 SegProc *owner = lp->owner;
1510 DEBUGF(4, (CE_CONT, "winlock_giveup: lp=%p, owner=%p, trash %d\n",
1511 (void *)lp, (void *)ID(lp->owner), trash));
1514 ASSERT(owner != NULL);
1517 * owner loses lockpage/unlockpage mappings and gains a
1527 (void) devmap_unload(owner->lockseg, lp->cookie, PAGESIZE);
1528 (void) devmap_unload(owner->unlockseg, lp->cookie, PAGESIZE);
1532 if (err = devmap_unload(owner->lockseg, lp->cookie, PAGESIZE)) {
1538 * old owner gets mapping to trash page so it can continue
1542 if ((err = devmap_umem_remap(owner->unlockseg, winlock_dip,
1547 owner->flag |= TRASHPAGE;
1551 * process context and not on the owner's process context
1552 * we preload only if we happen to be in owner process context
1556 if (ID(owner) == CURPROC_ID) {
1557 (void) devmap_load(owner->unlockseg, lp->cookie,
1562 lp->owner = NULL;
1564 /* Clear the lock value in underlying page so new owner can grab it */
1591 ASSERT(lp->owner == NULL);
1617 lp->owner ? 'Y' : 'N',
1628 lp->owner ? 'Y' : 'N',
1650 "style=%d, lockptr=%p, timeout=%ld, clients=%p, owner=%p\n",
1652 (void *)lp->clients, (void *)lp->owner);
1658 (void *)sdp, sdp == lp->owner ? " (owner)" : "",