Lines Matching defs:the_lock

118 } the_lock;
259 return ((the_lock.nholders > 0) && the_lock.remote_daemon != NULL &&
260 (order == the_lock.remote_daemon->order));
393 if (the_lock.type == LOCK_WRITE && the_lock.remote_daemon == NULL)
433 the_lock.type = LOCK_WRITE;
434 the_lock.holding_pid[0] = lock_wanted.pid;
435 the_lock.nholders = 1;
436 the_lock.state = STATE_CLEAR;
448 if (the_lock.remote_daemon == NULL &&
449 the_lock.type == LOCK_WRITE) {
461 if ((the_lock.type != LOCK_WRITE &&
462 the_lock.state != STATE_ASKED) ||
463 (the_lock.type == LOCK_WRITE &&
464 the_lock.remote_daemon != NULL)) {
479 switch (the_lock.type) {
482 i = the_lock.nholders++;
483 the_lock.holding_pid[i] = lock_wanted.pid;
484 the_lock.state = STATE_CLEAR;
486 the_lock.nholders));
498 the_lock.holding_pid[0] = lock_wanted.pid;
499 the_lock.nholders = 1;
500 the_lock.type = LOCK_READ;
501 the_lock.state = STATE_CLEAR;
502 the_lock.remote_daemon = NULL;
521 the_lock.remote_daemon = NULL;
522 the_lock.state = STATE_ASKED;
526 the_lock.type = LOCK_WRITE;
527 the_lock.holder = lock_wanted.remote;
528 the_lock.nholders = 1;
529 the_lock.remote_daemon =
530 find_lockdaemon(&the_lock.holder);
531 the_lock.state = STATE_CLEAR;
537 DPF((stderr, "weird lock type held - %d\n", the_lock.type));
538 the_lock.type = LOCK_NOTLOCKED;
570 if (the_lock.type == type && addr_is_holder(msg->order)) {
589 if (the_lock.type == LOCK_NOTLOCKED && the_lock.state == STATE_ASKED) {
593 the_lock.state = STATE_CLEAR;
623 if (the_lock.type != LOCK_WRITE)
634 switch (the_lock.type) {
645 spcs_log("cfglockd", NULL, "Lock is %s (%d)", lt, the_lock.type);
647 the_lock.nholders);
648 if (the_lock.nholders > 0) {
649 for (i = 0; i < the_lock.nholders; i++)
651 the_lock.holding_pid[i]);
654 dp_addr(&the_lock.holder), the_lock.holder.sin_port,
655 the_lock.remote_daemon);
713 if (the_lock.remote_daemon == NULL &&
714 (the_lock.type == LOCK_WRITE ||
715 the_lock.type == LOCK_READ) &&
716 the_lock.holding_pid[0] == msg->pid) {
763 the_lock.remote_daemon = NULL;
764 the_lock.type = LOCK_NOTLOCKED;
765 the_lock.nholders = 0;
766 the_lock.state = STATE_CLEAR;
781 if (the_lock.type == LOCK_READ) {
783 for (i = 0; i < the_lock.nholders; i++) {
784 if (the_lock.holding_pid[i] == pid) {
786 the_lock.nholders));
787 --the_lock.nholders;
791 for (; i < the_lock.nholders; i++) {
792 the_lock.holding_pid[i] = the_lock.holding_pid[i+1];
794 if (the_lock.nholders > 0)
798 if (pid != the_lock.holding_pid[0])
800 the_lock.holding_pid[0] = (pid_t)0;
818 DPF((stderr, "when %s holds lock\n", dp_addr(&the_lock.holder)));
838 switch (the_lock.type) {
843 send_lockmsg(LOCK_READ, the_lock.holding_pid[0], d, seq);
846 send_lockmsg(LOCK_WRITE, the_lock.holding_pid[0], d, seq);
878 if (the_lock.remote_daemon) {
879 if (lockdaemon_dead(the_lock.remote_daemon)) {
881 the_lock.remote_daemon->up = 0;
884 send_lockmsg(GRANTED, (pid_t)0, &the_lock.holder, 0);
897 (void) printf("\nlock: %s\n", lockd_type(the_lock.type));
898 (void) printf(" no. holders: %d\n", the_lock.nholders);
899 (void) printf(" hold addr : %s\n", the_lock.remote_daemon?
900 dp_addr(the_lock.remote_daemon): "0.0.0.0");
902 for (i = 0; i < the_lock.nholders; i++) {
903 (void) printf(" %ld", the_lock.holding_pid[ i ]);
928 if (the_lock.type == LOCK_WRITE &&
929 the_lock.remote_daemon == NULL)
992 if (the_lock.type != LOCK_NOTLOCKED) {
1017 if (the_lock.type != LOCK_NOTLOCKED)
1365 if (the_lock.type != LOCK_NOTLOCKED &&
1366 the_lock.remote_daemon == NULL)