Revert "source3/smbd"
[metze/samba/wip.git] / source3 / locking / locking.c
index d90e8c679b1cfc2d2bea9e7f4b5a3aafce9e4060..b9afd2392c46f973581e4d930cf8316837179b7c 100644 (file)
@@ -669,23 +669,6 @@ static void fill_deferred_open_entry(struct share_mode_entry *e,
 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;
@@ -764,7 +747,6 @@ static struct share_mode_entry *find_share_mode_entry(struct share_mode_data *d,
 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);
@@ -776,22 +758,6 @@ bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp)
        *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;
 }