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/modules/vfs_default.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 848440809c..258caf8299 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -1226,21 +1226,17 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle, ret = SMB_VFS_FSTAT(fsp, &sbuf); } else { - struct smb_filename *smb_fname = NULL; - NTSTATUS status; + struct smb_filename smb_fname; + + ZERO_STRUCT(smb_fname); + smb_fname.base_name = discard_const_p(char, fname); - status = create_synthetic_smb_fname(talloc_tos(), fname, NULL, - NULL, &smb_fname); - if (!NT_STATUS_IS_OK(status)) { - return status; - } if (lp_posix_pathnames()) { - ret = SMB_VFS_LSTAT(handle->conn, smb_fname); + ret = SMB_VFS_LSTAT(handle->conn, &smb_fname); } else { - ret = SMB_VFS_STAT(handle->conn, smb_fname); + ret = SMB_VFS_STAT(handle->conn, &smb_fname); } - sbuf = smb_fname->st; - TALLOC_FREE(smb_fname); + sbuf = smb_fname.st; } if (ret == -1) { -- cgit