[PATCH 2/2] param: remove unused get_share_params()

David Disseldorp ddiss at samba.org
Tue Nov 25 14:22:24 MST 2014


Given a share name, get_share_params() returns corresponding snum inside
a struct share_params. find_service() provides duplicate functionality.

Signed-off-by: David Disseldorp <ddiss at samba.org>
---
 source3/include/proto.h |  2 --
 source3/param/service.c | 22 ----------------------
 2 files changed, 24 deletions(-)

diff --git a/source3/include/proto.h b/source3/include/proto.h
index ce23289..82e1032 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1084,8 +1084,6 @@ int lp_numservices(void);
 void lp_dump(FILE *f, bool show_defaults, int maxtoprint);
 void lp_dump_one(FILE * f, bool show_defaults, int snum);
 int lp_servicenumber(const char *pszServiceName);
-struct share_params *get_share_params(TALLOC_CTX *mem_ctx,
-				      const char *sharename);
 const char *volume_label(TALLOC_CTX *ctx, int snum);
 bool lp_domain_master(void);
 bool lp_preferred_master(void);
diff --git a/source3/param/service.c b/source3/param/service.c
index 473fc82..b21be60 100644
--- a/source3/param/service.c
+++ b/source3/param/service.c
@@ -251,25 +251,3 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out)
 
 	return (iService);
 }
-
-
-struct share_params *get_share_params(TALLOC_CTX *mem_ctx,
-				      const char *sharename)
-{
-	struct share_params *result;
-	char *sname = NULL;
-	int snum;
-
-	snum = find_service(mem_ctx, sharename, &sname);
-	if (snum < 0 || sname == NULL) {
-		return NULL;
-	}
-
-	if (!(result = talloc(mem_ctx, struct share_params))) {
-		DEBUG(0, ("talloc failed\n"));
-		return NULL;
-	}
-
-	result->service = snum;
-	return result;
-}
-- 
2.1.2



More information about the samba-technical mailing list