diff options
author | Volker Lendecke <vl@samba.org> | 2009-11-15 10:46:23 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-11-18 23:16:13 +0100 |
commit | d1c34d405421e2969d6cf4fc7438f783e7d6b0a5 (patch) | |
tree | 031d6a32c255db2a6a13d3a04bc4ea881129585d /source3/modules | |
parent | f6650f5d19ad90b8e1f392efbe211c4ffa0e70c0 (diff) | |
download | samba-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/modules')
-rw-r--r-- | source3/modules/vfs_default.c | 18 |
1 files changed, 7 insertions, 11 deletions
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) { |