struct server_id pid_to_procid(pid_t pid);
struct server_id procid_self(void);
struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx);
-bool procid_equal(const struct server_id *p1, const struct server_id *p2);
+bool serverid_equal(const struct server_id *p1, const struct server_id *p2);
bool procid_is_me(const struct server_id *pid);
struct server_id interpret_pid(const char *pid_string);
char *procid_str_static(const struct server_id *pid);
num_ids = value.dsize / sizeof(struct server_id);
for (i=0; i<num_ids; i++) {
- if (procid_equal(&id, &ids[i])) {
+ if (serverid_equal(&id, &ids[i])) {
ids[i] = ids[num_ids-1];
value.dsize -= sizeof(struct server_id);
break;
}
for (i=0; i<num_locks; i++) {
- if (procid_equal(&self, &locks[i].pid)) {
+ if (serverid_equal(&self, &locks[i].pid)) {
status = NT_STATUS_INTERNAL_ERROR;
goto done;
}
goto done;
}
for (i=0; i<num_locks; i++) {
- if (procid_equal(&self, &locks[i].pid)) {
+ if (serverid_equal(&self, &locks[i].pid)) {
break;
}
}
return server_id;
}
-bool procid_equal(const struct server_id *p1, const struct server_id *p2)
+bool serverid_equal(const struct server_id *p1, const struct server_id *p2)
{
if (p1->pid != p2->pid) {
return false;
bool brl_same_context(const struct lock_context *ctx1,
const struct lock_context *ctx2)
{
- return (procid_equal(&ctx1->pid, &ctx2->pid) &&
+ return (serverid_equal(&ctx1->pid, &ctx2->pid) &&
(ctx1->smblctx == ctx2->smblctx) &&
(ctx1->tid == ctx2->tid));
}
return NT_STATUS_FILE_LOCK_CONFLICT;
}
- if (procid_equal(&lock->context.pid, &fsp->last_lock_failure.context.pid) &&
+ if (serverid_equal(&lock->context.pid, &fsp->last_lock_failure.context.pid) &&
lock->context.tid == fsp->last_lock_failure.context.tid &&
lock->fnum == fsp->last_lock_failure.fnum &&
lock->start == fsp->last_lock_failure.start) {
for (i=0; i < num_locks_copy; i++) {
struct lock_struct *lock = &locks_copy[i];
- if (lock->context.tid == tid && procid_equal(&lock->context.pid, &pid) &&
+ if (lock->context.tid == tid && serverid_equal(&lock->context.pid, &pid) &&
(lock->fnum == fnum)) {
brl_unlock(msg_ctx,
br_lck,
ZERO_STRUCT(last_pid);
for (i=0; i<state->num_pids; i++) {
- if (procid_equal(&last_pid, &state->pids[i])) {
+ if (serverid_equal(&last_pid, &state->pids[i])) {
/*
* We've seen that one already
*/
se->name_hash = new_name_hash;
/* But not to ourselves... */
- if (procid_equal(&se->pid, &self_pid)) {
+ if (serverid_equal(&se->pid, &self_pid)) {
continue;
}
sharing the same share mode entry may validly differ in
fsp->share_access field. */
- return (procid_equal(&e1->pid, &e2->pid) &&
+ return (serverid_equal(&e1->pid, &e2->pid) &&
file_id_equal(&e1->id, &e2->id) &&
e1->share_file_id == e2->share_file_id );
}
static bool deferred_open_identical(struct share_mode_entry *e1,
struct share_mode_entry *e2)
{
- return (procid_equal(&e1->pid, &e2->pid) &&
+ return (serverid_equal(&e1->pid, &e2->pid) &&
(e1->op_mid == e2->op_mid) &&
file_id_equal(&e1->id, &e2->id));
}
}
/* Ignore locks not owned by this process. */
- if (!procid_equal(&lock->context.pid, &lock_ctx->pid)) {
+ if (!serverid_equal(&lock->context.pid, &lock_ctx->pid)) {
continue;
}
{
struct sess_file_count *sess = (struct sess_file_count *)data;
- if ( procid_equal(&e->pid, &sess->pid) && (sess->uid == e->uid) ) {
+ if (serverid_equal(&e->pid, &sess->pid) && (sess->uid == e->uid)) {
sess->count++;
}
for (i=0; i<num_deferred; i++) {
struct share_mode_entry *e = &deferred[i];
- if (procid_equal(&self, &e->pid)) {
+ if (serverid_equal(&self, &e->pid)) {
/*
* We need to notify ourself to retry the open. Do
* this by finding the queued SMB record, moving it to
&& (e->flags & SHARE_MODE_FLAG_POSIX_OPEN)) {
continue;
}
- if (procid_equal(&self, &e->pid) &&
+ if (serverid_equal(&self, &e->pid) &&
(e->share_file_id == fsp->fh->gen_id)) {
continue;
}
if (fsp->posix_open && (e->flags & SHARE_MODE_FLAG_POSIX_OPEN)) {
continue;
}
- if (procid_equal(&self, &e->pid) &&
+ if (serverid_equal(&self, &e->pid) &&
(e->share_file_id == fsp->fh->gen_id)) {
continue;
}
if (e->private_data != private_data) {
continue;
}
- if (procid_equal(&e->server, pid)) {
+ if (serverid_equal(&e->server, pid)) {
break;
}
}
struct server_id self = messaging_server_id(sconn->msg_ctx);
files_struct *fsp;
- if (!procid_equal(&self, &share_entry->pid)) {
+ if (!serverid_equal(&self, &share_entry->pid)) {
return;
}
struct share_mode_entry *e = &lck->data->share_modes[i];
if (is_deferred_open_entry(e) &&
- procid_equal(&self, &e->pid) &&
+ serverid_equal(&self, &e->pid) &&
(e->op_mid == req->mid)) {
DEBUG(0, ("Trying to defer an already deferred "
"request: mid=%llu, exiting\n",
/* Need to wait before sending a break
message if we sent ourselves this message. */
- if (procid_equal(&self, &src)) {
+ if (serverid_equal(&self, &src)) {
wait_before_sending_break();
}
* Bugid #5980.
*/
- if (procid_equal(&self, &share_entry->pid)) {
+ if (serverid_equal(&self, &share_entry->pid)) {
struct files_struct *cur_fsp =
initial_break_processing(state->sconn,
share_entry->id,
return 0;
}
- if (procid_equal(&crec->pid, &self_pid)) {
+ if (serverid_equal(&crec->pid, &self_pid)) {
DEBUG(10, ("It's me\n"));
return 0;
}
for (i=0; i<ids->num_entries; i++) {
struct server_id id = ids->entries[i].pid;
- if (procid_equal(&id, &crec->pid)) {
+ if (serverid_equal(&id, &crec->pid)) {
guest = false;
break;
}
return 1;
for (i=0;i<Ucrit_MaxPid;i++) {
- if (procid_equal(&pid, &Ucrit_pid[i])) {
+ if (serverid_equal(&pid, &Ucrit_pid[i])) {
return 1;
}
}
/* show machine name rather PID on table "Open Files"? */
if (PID_or_Machine) {
for (map = pidmap; map != NULL; map = map->next) {
- if (procid_equal(&pid, &map->pid)) {
+ if (serverid_equal(&pid, &map->pid)) {
if (map->machine == NULL) /* no machine name */
break; /* show PID */
void *private_data)
{
if (crec->cnum == TID_FIELD_INVALID || !process_exists(crec->pid) ||
- procid_equal(&crec->pid, &smbd_pid))
+ serverid_equal(&crec->pid, &smbd_pid))
return 0;
addPid2Machine (crec->pid, crec->machine);