summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_default.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/modules/vfs_default.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/modules/vfs_default.c')
-rw-r--r--source3/modules/vfs_default.c18
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) {