summaryrefslogtreecommitdiff
path: root/source3/smbd/notify.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-11-15 10:46:23 +0100
committerVolker Lendecke <vl@samba.org>2009-11-18 23:16:13 +0100
commitd1c34d405421e2969d6cf4fc7438f783e7d6b0a5 (patch)
tree031d6a32c255db2a6a13d3a04bc4ea881129585d /source3/smbd/notify.c
parentf6650f5d19ad90b8e1f392efbe211c4ffa0e70c0 (diff)
downloadsamba-d1c34d405421e2969d6cf4fc7438f783e7d6b0a5.tar.gz
samba-d1c34d405421e2969d6cf4fc7438f783e7d6b0a5.tar.bz2
samba-d1c34d405421e2969d6cf4fc7438f783e7d6b0a5.zip
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.
Diffstat (limited to 'source3/smbd/notify.c')
-rw-r--r--source3/smbd/notify.c16
1 files changed, 6 insertions, 10 deletions
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,