Revert "TODO later? smbXsrv_open_close_all"
authorStefan Metzmacher <metze@samba.org>
Mon, 18 Jun 2012 11:32:29 +0000 (13:32 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 13 Aug 2018 14:20:47 +0000 (16:20 +0200)
This reverts commit be146b939400dda6d2ec5b77d9f6224ce6363927.

source3/smbd/smbXsrv_open.c

index f99e6de5789478efb5cc38701f7f1cb3fa8d9443..2a2cf6973e7da28f415737b99677469531d07783 100644 (file)
@@ -1188,87 +1188,6 @@ NTSTATUS smbXsrv_open_close(struct smbXsrv_open *op, NTTIME now)
        return error;
 }
 
-struct smbXsrv_open_close_all_state {
-       NTTIME now;
-       NTSTATUS first_status;
-       int errors;
-};
-
-static int smbXsrv_open_close_all_callback(struct db_record *local_rec,
-                                          void *private_data);
-
-static NTSTATUS smbXsrv_open_close_all(struct smbXsrv_open_table *table,
-                                      NTTIME now)
-{
-       struct smbXsrv_open_close_all_state state;
-       NTSTATUS status;
-       int count = 0;
-
-       ZERO_STRUCT(state);
-
-       if (table == NULL) {
-               return NT_STATUS_OK;
-       }
-
-       state.now = now;
-
-       status = dbwrap_traverse(table->local.db_ctx,
-                                smbXsrv_open_close_all_callback,
-                                &state, &count);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(0, ("smbXsrv_open_close_all: "
-                         "dbwrap_traverse() failed: %s\n",
-                         nt_errstr(status)));
-               return status;
-       }
-
-       if (!NT_STATUS_IS_OK(state.first_status)) {
-               DEBUG(0, ("smbXsrv_open_close_all: "
-                         "count[%d] errors[%d] first[%s]\n",
-                         count, state.errors,
-                         nt_errstr(state.first_status)));
-               return state.first_status;
-       }
-
-       return NT_STATUS_OK;
-}
-
-static int smbXsrv_open_close_all_callback(struct db_record *local_rec,
-                                          void *private_data)
-{
-       struct smbXsrv_open_close_all_state *state =
-               (struct smbXsrv_open_close_all_state *)private_data;
-       TDB_DATA val;
-       void *ptr = NULL;
-       struct smbXsrv_open *op = NULL;
-       NTSTATUS status;
-
-       val = dbwrap_record_get_value(local_rec);
-       if (val.dsize != sizeof(ptr)) {
-               status = NT_STATUS_INTERNAL_ERROR;
-               if (NT_STATUS_IS_OK(state->first_status)) {
-                       state->first_status = status;
-               }
-               state->errors++;
-               return 0;
-       }
-
-       memcpy(&ptr, val.dptr, val.dsize);
-       op = talloc_get_type_abort(ptr, struct smbXsrv_open);
-
-       op->db_rec = local_rec;
-       status = smbXsrv_open_close(op, state->now);
-       if (!NT_STATUS_IS_OK(status)) {
-               if (NT_STATUS_IS_OK(state->first_status)) {
-                       state->first_status = status;
-               }
-               state->errors++;
-               return 0;
-       }
-
-       return 0;
-}
-
 NTSTATUS smb1srv_open_table_init(struct smbXsrv_connection *conn)
 {
        uint32_t max_opens;