From d1c34d405421e2969d6cf4fc7438f783e7d6b0a5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 15 Nov 2009 10:46:23 +0100 Subject: s3: Replace some create_synthetic_smb_fname() calls In very hot codepaths like the statcache copy_smb_filename and the subsequent recursive talloc_free is noticable in the CPU load. --- source3/smbd/notify.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'source3/smbd/notify.c') diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index e430fcfc04..0c75769594 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -367,20 +367,16 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter, path += 2; } if (parent_dirname(talloc_tos(), path, &parent, &name)) { - struct smb_filename *smb_fname_parent = NULL; - NTSTATUS status; + struct smb_filename smb_fname_parent; - status = create_synthetic_smb_fname(talloc_tos(), parent, NULL, - NULL, &smb_fname_parent); - if (!NT_STATUS_IS_OK(status)) { - return; - } - if (SMB_VFS_STAT(conn, smb_fname_parent) != -1) { + ZERO_STRUCT(smb_fname_parent); + smb_fname_parent.base_name = parent; + + if (SMB_VFS_STAT(conn, &smb_fname_parent) != -1) { notify_onelevel(conn->notify_ctx, action, filter, - SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent->st), + SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st), name); } - TALLOC_FREE(smb_fname_parent); } fullpath = talloc_asprintf(talloc_tos(), "%s/%s", conn->connectpath, -- cgit