1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

smbd: Move brl_validate to the cleanupd

This walks brlock.tdb, which can be time-consuming.

This adds a new includes.h include. It's too much of a pain for me now to
make locking/proto.h clean to include on its own.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2015-11-07 20:18:52 +01:00
parent 14fc9018aa
commit bbeabd346d
2 changed files with 14 additions and 7 deletions

View File

@ -283,8 +283,10 @@ static int smbd_parent_ctdb_reconfigured(
* Someone from the family died, validate our locks
*/
messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx),
MSG_SMB_BRL_VALIDATE, NULL, 0);
if (am_parent) {
messaging_send_buf(msg_ctx, am_parent->cleanupd,
MSG_SMB_BRL_VALIDATE, NULL, 0);
}
return 0;
}
@ -545,8 +547,8 @@ static void cleanup_timeout_fn(struct tevent_context *event_ctx,
DEBUG(1,("Cleaning up brl and lock database after unclean shutdown\n"));
message_send_all(parent->msg_ctx, MSG_SMB_UNLOCK, NULL, 0, NULL);
messaging_send_buf(parent->msg_ctx,
messaging_server_id(parent->msg_ctx),
messaging_send_buf(parent->msg_ctx, parent->cleanupd,
MSG_SMB_BRL_VALIDATE, NULL, 0);
}
@ -1003,8 +1005,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
messaging_register(msg_ctx, NULL, MSG_SMB_STAT_CACHE_DELETE,
smb_stat_cache_delete);
messaging_register(msg_ctx, NULL, MSG_DEBUG, smbd_msg_debug);
messaging_register(msg_ctx, NULL, MSG_SMB_BRL_VALIDATE,
brl_revalidate);
messaging_register(msg_ctx, NULL, MSG_SMB_FORCE_TDIS,
smb_parent_send_to_children);
messaging_register(msg_ctx, NULL, MSG_SMB_KILL_CLIENT_IP,

View File

@ -17,13 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "replace.h"
#include "includes.h"
#include "smbd_cleanupd.h"
#include "lib/util_procid.h"
#include "lib/util/tevent_ntstatus.h"
#include "lib/util/debug.h"
#include "smbprofile.h"
#include "serverid.h"
#include "locking/proto.h"
struct smbd_cleanupd_state {
pid_t parent_pid;
@ -65,6 +66,12 @@ struct tevent_req *smbd_cleanupd_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
status = messaging_register(msg, NULL, MSG_SMB_BRL_VALIDATE,
brl_revalidate);
if (tevent_req_nterror(req, status)) {
return tevent_req_post(req, ev);
}
return req;
}