#ifdef HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL
if (lp_clustering()) {
-// return ctdb_serverids_exist(messaging_ctdbd_connection(),
-// ids, num_ids, results);
+ return ctdb_serverids_exist(messaging_ctdbd_connection(),
+ ids, num_ids, results);
}
#endif
if (!processes_exist(ids, num_ids, results)) {
if (!results[i]) {
continue;
}
-#if 0
- typedef [public] struct {
- hyper pid;
- uint32 task_id;
- uint32 vnn;
- hyper unique_id;
- } server_id;
-#endif
- if (ids[i].unique_id == UINT64_MAX) {
- // bug #8760 :-)
- continue;
- }
serverid_fill_key(&ids[i], &key);
tdbkey = make_tdb_data((uint8_t *)&key, sizeof(key));
num_remote_pids = 0;
for (i=0; i<num_pids; i++) {
- results[i] = false;
-
if (procid_is_me(&pids[i])) {
results[i] = true;
continue;
}
-#if 0
- typedef [public] struct {
- hyper pid;
- uint32 task_id;
- uint32 vnn;
- hyper unique_id;
- } server_id;
-#endif
- if (pids[i].pid == UINT64_MAX &&
- pids[i].task_id == UINT32_MAX &&
- pids[i].vnn == UINT32_MAX &&
- pids[i].unique_id == UINT64_MAX) {
- // bug #8760 :-) :-) ok
- results[i] = true;
- continue;
- }
if (procid_is_local(&pids[i])) {
results[i] = ((kill(pids[i].pid,0) == 0) ||
(errno != ESRCH));
return false;
}
e = &d->share_modes[i];
-
- // TODO... is this still correct?
- if (d->num_share_modes == 1 &&
- e->pid.pid == UINT64_MAX &&
- e->pid.task_id == UINT32_MAX &&
- e->pid.vnn == UINT32_MAX &&
- e->pid.unique_id == UINT64_MAX) {
- *e = d->share_modes[d->num_share_modes-1];
- d->num_share_modes -= 1;
- d->modified = True;
- return true;
- }
-
if (serverid_exists(&e->pid)) {
DEBUG(10, ("PID %s (index %u out of %u) still exists\n",
procid_str_static(&e->pid), i,
static void add_share_mode_entry(struct share_mode_data *d,
const struct share_mode_entry *entry)
{
- uint32_t i = 0;
-
- while (i < d->num_share_modes) {
- struct share_mode_entry *e = &d->share_modes[i];
- if (e->pid.pid == UINT64_MAX &&
- e->pid.task_id == UINT32_MAX &&
- e->pid.vnn == UINT32_MAX &&
- e->pid.unique_id == UINT64_MAX) {
- *e = d->share_modes[d->num_share_modes-1];
- d->num_share_modes -= 1;
- d->modified = True;
- continue;
- }
-
- i += 1;
- }
-
ADD_TO_ARRAY(d, struct share_mode_entry, *entry,
&d->share_modes, &d->num_share_modes);
d->modified = True;
bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp)
{
struct share_mode_entry entry, *e;
- uint32_t i = 0;
/* Don't care about the pid owner being correct here - just a search. */
fill_share_mode_entry(&entry, fsp, (uid_t)-1, 0, NO_OPLOCK);
*e = lck->data->share_modes[lck->data->num_share_modes-1];
lck->data->num_share_modes -= 1;
lck->data->modified = True;
-
- while (i < lck->data->num_share_modes) {
- e = &lck->data->share_modes[i];
-
- if (e->pid.pid == UINT64_MAX &&
- e->pid.task_id == UINT32_MAX &&
- e->pid.vnn == UINT32_MAX &&
- e->pid.unique_id == UINT64_MAX) {
- *e = lck->data->share_modes[lck->data->num_share_modes-1];
- lck->data->num_share_modes -= 1;
- continue;
- }
-
- i += 1;
- }
-
return True;
}
NTSTATUS status = NT_STATUS_OK;
NTSTATUS tmp;
connection_struct *conn = fsp->conn;
- struct smbd_server_connection *sconn = conn->sconn;
int ret;
/*
status, map_nt_error_from_unix(ret));
}
- if (close_type == SHUTDOWN_CLOSE && fsp->smbXsrv->global->durable) {
- struct share_mode_lock *lck;
-
- lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id);
- if (lck != NULL && lck->data->num_share_modes == 1) {
- lck->data->share_modes[0].pid.pid = UINT64_MAX;
- lck->data->share_modes[0].pid.task_id = UINT32_MAX;
- lck->data->share_modes[0].pid.vnn = UINT32_MAX;
- lck->data->share_modes[0].pid.unique_id = UINT64_MAX; //todo place NTTIME expire timer here
- lck->data->modified = true;
-#if 0
- } else if (lck != NULL) {
- uint32_t i;
-
- for (i=0; i < lck->data->num_share_modes; i++) {
- struct share_mode_entry *e = &lck->data->share_modes[i];
- char msg[MSG_SMB_SHARE_MODE_ENTRY_SIZE];
-
- if (procid_is_me(&e->pid)) {
- continue;
- }
-
- share_mode_entry_to_message(msg, e);
-
- messaging_send_buf(fsp->conn->sconn->msg_ctx,
- e->pid,
- MSG_SMB_BREAK_RESPONSE,
- (uint8 *)msg,
- MSG_SMB_SHARE_MODE_ENTRY_SIZE);
- }
- }
-#endif
-
- tmp = close_filestruct(fsp);
- status = ntstatus_keeperror(status, tmp);
-
- if (fsp->oplock_type == LEVEL_II_OPLOCK) {
- sconn->oplocks.level_II_open--;
- } else if (EXCLUSIVE_OPLOCK_TYPE(fsp->oplock_type)) {
- sconn->oplocks.exclusive_open--;
- }
-
- SMB_ASSERT(sconn->oplocks.exclusive_open>=0);
- SMB_ASSERT(sconn->oplocks.level_II_open>=0);
-
- TALLOC_FREE(lck);
-
- tmp = fd_close(fsp);
- status = ntstatus_keeperror(status, tmp);
- file_free(req, fsp);
- return status;
- }
-
- TALLOC_FREE(lck);
-
-#if 0
- TALLOC_FREE(lck);
-
- tmp = fd_close(fsp);
- status = ntstatus_keeperror(status, tmp);
- file_free(req, fsp);
- return status;
-#endif
- }
-
/*
* If we're flushing on a close we can get a write
* error here, we must remember this.
(unsigned int)entry->share_access,
(unsigned int)entry->private_options));
- if (entry->pid.pid == UINT64_MAX) {
- return false;
- }
-
DEBUG(10,("share_conflict: access_mask = 0x%x, share_access = 0x%x\n",
(unsigned int)access_mask, (unsigned int)share_access));
return false;
}
- if (batch_entry->pid.pid == UINT64_MAX) {
- /* TODO: clean up */
- return false;
- }
-
/* Found a batch oplock */
send_break_message(fsp, batch_entry, mid, oplock_request);
return true;
return false;
}
- if (ex_entry->pid.pid == UINT64_MAX) {
- /* TODO: clean up */
- return false;
- }
-
/* Found an exclusive or batch oplock */
delay_it = is_delete_request(fsp) ?