summaryrefslogtreecommitdiffstats
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-12-29 13:56:44 +0100
committerJeremy Allison <jra@samba.org>2014-04-23 22:33:08 +0200
commit3e24e07467962436fa505f3b8e591f1af6cafdc0 (patch)
treebb0eb8e9a6b306dac79d90d21b5fb696ac395ec6 /source3/smbd
parent6dcf2c7eab0f39a17f22b09df94e5fcdac8726d1 (diff)
downloadsamba-3e24e07467962436fa505f3b8e591f1af6cafdc0.tar.gz
samba-3e24e07467962436fa505f3b8e591f1af6cafdc0.tar.xz
samba-3e24e07467962436fa505f3b8e591f1af6cafdc0.zip
lib: Move full_path_tos to util_str.c
This can be useful elsewhere Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/files.c39
-rw-r--r--source3/smbd/proto.h3
2 files changed, 0 insertions, 42 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 5cf037edc26..84968067082 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -688,45 +688,6 @@ NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from,
return fsp_set_smb_fname(to, from->fsp_name);
}
-/*
- * This routine improves performance for operations temporarily acting on a
- * full path. It is equivalent to the much more expensive
- *
- * talloc_asprintf(talloc_tos(), "%s/%s", dir, name)
- *
- * This actually does make a difference in metadata-heavy workloads (i.e. the
- * "standard" client.txt nbench run.
- */
-
-ssize_t full_path_tos(const char *dir, const char *name,
- char *tmpbuf, size_t tmpbuf_len,
- char **pdst, char **to_free)
-{
- size_t dirlen, namelen, len;
- char *dst;
-
- dirlen = strlen(dir);
- namelen = strlen(name);
- len = dirlen + namelen + 1;
-
- if (len < tmpbuf_len) {
- dst = tmpbuf;
- *to_free = NULL;
- } else {
- dst = talloc_array(talloc_tos(), char, len+1);
- if (dst == NULL) {
- return -1;
- }
- *to_free = dst;
- }
-
- memcpy(dst, dir, dirlen);
- dst[dirlen] = '/';
- memcpy(dst+dirlen+1, name, namelen+1);
- *pdst = dst;
- return len;
-}
-
/**
* Return a jenkins hash of a pathname on a connection.
*/
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 62c9728a4e8..d9b86b6f539 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -397,9 +397,6 @@ NTSTATUS file_name_hash(connection_struct *conn,
const char *name, uint32_t *p_name_hash);
NTSTATUS fsp_set_smb_fname(struct files_struct *fsp,
const struct smb_filename *smb_fname_in);
-ssize_t full_path_tos(const char *dir, const char *name,
- char *tmpbuf, size_t tmpbuf_len,
- char **pdst, char **to_free);
/* The following definitions come from smbd/ipc.c */