int sent_oplock_break;
struct timed_event *oplock_timeout;
struct lock_struct last_lock_failure;
+ int current_lock_count; /* Count the number of outstanding locks and pending locks. */
struct share_mode_entry *pending_break_messages;
int num_pending_break_messages;
lock_flav,
blocking_lock);
+ /* blocking ie. pending, locks also count here,
+ * as this is an efficiency counter to avoid checking
+ * the lock db. on close. JRA. */
+
+ fsp->current_lock_count++;
+
return br_lck;
}
return NT_STATUS_RANGE_NOT_LOCKED;
}
+ SMB_ASSERT(fsp->current_lock_count > 0);
+ fsp->current_lock_count--;
+
return NT_STATUS_OK;
}
return NT_STATUS_DOS(ERRDOS, ERRcancelviolation);
}
+ SMB_ASSERT(fsp->current_lock_count > 0);
+ fsp->current_lock_count++;
+
return NT_STATUS_OK;
}
return;
}
+ /* If we have not outstanding locks or pending
+ * locks then we don't need to look in the lock db.
+ */
+
+ if (fsp->current_lock_count == 0) {
+ return;
+ }
+
br_lck = brl_get_locks(NULL,fsp);
if (br_lck) {