s3:util: rename procid_equal() to serverid_equal()
authorMichael Adam <obnox@samba.org>
Fri, 15 Jun 2012 22:26:26 +0000 (00:26 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 21 Jun 2012 06:27:32 +0000 (08:27 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
16 files changed:
source3/include/proto.h
source3/lib/dbwrap/dbwrap_watch.c
source3/lib/g_lock.c
source3/lib/util.c
source3/locking/brlock.c
source3/locking/locking.c
source3/locking/posix.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/close.c
source3/smbd/notify_internal.c
source3/smbd/open.c
source3/smbd/oplock.c
source3/smbd/sesssetup.c
source3/utils/net_status.c
source3/utils/status.c
source3/web/statuspage.c

index 64af7c2559af56575b18cd8bc0f889d3e3f3ada7..69661bb8c567c58e27427d76c28f72156499f489 100644 (file)
@@ -470,7 +470,7 @@ void set_my_unique_id(uint64_t unique_id);
 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);
index ea75427ffc63d6868dc79b63db34b57ae0145b46..701ac9d02f2c6ddae2750fde7686d6df4ae8a393 100644 (file)
@@ -166,7 +166,7 @@ static NTSTATUS dbwrap_record_del_watcher(TDB_DATA w_key, struct server_id id)
        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;
index 06a14fac6cb16f4539a6bd7eb28ee41955617fe4..d505b6bea63e3d3094c3f68e8809801cf5de835e 100644 (file)
@@ -119,7 +119,7 @@ static NTSTATUS g_lock_trylock(struct db_record *rec, struct server_id self,
        }
 
        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;
                }
@@ -327,7 +327,7 @@ NTSTATUS g_lock_unlock(struct g_lock_ctx *ctx, const char *name)
                goto done;
        }
        for (i=0; i<num_locks; i++) {
-               if (procid_equal(&self, &locks[i].pid)) {
+               if (serverid_equal(&self, &locks[i].pid)) {
                        break;
                }
        }
index 2a01e2c9f98d685c832f1519781d30e9a72f31a1..653fff5c64e9f9069982509a01f83ed4fb57a65f 100644 (file)
@@ -2058,7 +2058,7 @@ struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx)
        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;
index 836bbb49a78782b85afe6f76e3ce43421f4f0a6e..71509362532f8d2dd813916d90db27c0b206d6c2 100644 (file)
@@ -69,7 +69,7 @@ static void print_lock_struct(unsigned int i, struct lock_struct *pls)
 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));
 }
@@ -252,7 +252,7 @@ NTSTATUS brl_lock_failed(files_struct *fsp, const struct lock_struct *lock, bool
                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) {
@@ -1509,7 +1509,7 @@ void brl_close_fnum(struct messaging_context *msg_ctx,
        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,
@@ -1958,7 +1958,7 @@ void brl_revalidate(struct messaging_context *msg_ctx,
        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
                         */
index c7d8fb4fa468064fb301093c696d0ec0f0640308..95e9b7755332d8fa7b99de35306e8667d2cb0b8c 100644 (file)
@@ -553,7 +553,7 @@ bool rename_share_filename(struct messaging_context *msg_ctx,
                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;
                }
 
@@ -755,7 +755,7 @@ static bool share_modes_identical(struct share_mode_entry *e1,
           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 );
 }
@@ -763,7 +763,7 @@ static bool share_modes_identical(struct share_mode_entry *e1,
 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));
 }
index 02d9b6d3e3481d186d833097c2665fcc537fdceb..e5320f87053038d6d26e9a11c0e3ef9a45b0c0c2 100644 (file)
@@ -777,7 +777,7 @@ static struct lock_list *posix_lock_list(TALLOC_CTX *ctx,
                }
 
                /* 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;
                }
 
index d351468dce26dcb2d4b9b53e159e6b35f4d0e4e8..6702784ff536ebd2e2ce6698a7423b8c1e2de935 100644 (file)
@@ -856,7 +856,7 @@ static void sess_file_fn( const struct share_mode_entry *e,
 {
        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++;
        }
 
index 1fb7bdeb84da8ed4237b740cad5f50090f46bfa5..a3eedbfa6b67f05cd87f61cf583c17ca504a9773 100644 (file)
@@ -232,7 +232,7 @@ static void notify_deferred_opens(struct smbd_server_connection *sconn,
        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
@@ -427,7 +427,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
                            && (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;
                        }
@@ -1103,7 +1103,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp,
                                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;
                                }
index 9af3b459ff75c0855cb8a65d3663a9aadb8a0fc4..4fb1b351f3241c67d070fd28404fdf864fd6233d 100644 (file)
@@ -453,7 +453,7 @@ static NTSTATUS notify_del_entry(struct db_record *rec,
                if (e->private_data != private_data) {
                        continue;
                }
-               if (procid_equal(&e->server, pid)) {
+               if (serverid_equal(&e->server, pid)) {
                        break;
                }
        }
index 26d6971a42016cb0fecae32046cb956f4281f232..273f3b2c1eda48eedf2af70fb479c5cf9c3e997c 100644 (file)
@@ -913,7 +913,7 @@ static void validate_my_share_entries(struct smbd_server_connection *sconn,
        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;
        }
 
@@ -1363,7 +1363,7 @@ static void defer_open(struct share_mode_lock *lck,
                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",
index 54d95a25b56b0c27b183f354188d264082098f50..406ffd1e3d4666140cd47476978aa901835d55f2 100644 (file)
@@ -564,7 +564,7 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
 
        /* 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();
        }
 
@@ -876,7 +876,7 @@ static void do_break_to_none(struct tevent_req *req)
                 * 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,
index 2658a3a27f756d70fc3c3d2524df5710942f51fb..81e56eb2084788c3069bec28a8669bff165a86cb 100644 (file)
@@ -343,7 +343,7 @@ static int shutdown_other_smbds(const struct connections_key *key,
                return 0;
        }
 
-       if (procid_equal(&crec->pid, &self_pid)) {
+       if (serverid_equal(&crec->pid, &self_pid)) {
                DEBUG(10, ("It's me\n"));
                return 0;
        }
index 85d023505e9abaf9fbc9bd2bc8d700d4a41d94c4..c96730f1c13d9b98b9ef77256a6859e0c79925f2 100644 (file)
@@ -152,7 +152,7 @@ static int show_share_parseable(const struct connections_key *key,
 
        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;
                }
index 5ff4c314706640ba4647037db934f7dd07b427ff..3d16f8e3e73a99b0a85f712e94ef07f4489193b3 100644 (file)
@@ -88,7 +88,7 @@ static unsigned int Ucrit_checkPid(struct server_id pid)
                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;
                }
        }
index dd83d158ae1e2890e1684ac4267974dc1e0a29fc..8eac8036d024538b8ca4591225f614dbac41e9ed 100644 (file)
@@ -89,7 +89,7 @@ static char *mapPid2Machine (struct server_id pid)
        /* 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 */
 
@@ -207,7 +207,7 @@ static int traverse_fn2(const struct connections_key *key,
                         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);