|
|
7f6688 |
autofs-5.1.3 - remove some redundant rpc library code
|
|
|
7f6688 |
|
|
|
7f6688 |
From: Ian Kent <raven@themaw.net>
|
|
|
7f6688 |
|
|
|
7f6688 |
Remove some redundant code that was used long long ago for testing.
|
|
|
7f6688 |
|
|
|
7f6688 |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
7f6688 |
---
|
|
|
7f6688 |
CHANGELOG | 1
|
|
|
7f6688 |
include/rpc_subs.h | 1
|
|
|
7f6688 |
lib/rpc_subs.c | 87 -----------------------------------------------------
|
|
|
7f6688 |
3 files changed, 1 insertion(+), 88 deletions(-)
|
|
|
7f6688 |
|
|
|
7f6688 |
--- autofs-5.0.7.orig/CHANGELOG
|
|
|
7f6688 |
+++ autofs-5.0.7/CHANGELOG
|
|
|
7f6688 |
@@ -303,6 +303,7 @@
|
|
|
7f6688 |
- use systemd sd_notify() at startup.
|
|
|
7f6688 |
- fix update_negative_cache() map source usage.
|
|
|
7f6688 |
- mark removed cache entry negative.
|
|
|
7f6688 |
+- remove some redundant rpc library code.
|
|
|
7f6688 |
|
|
|
7f6688 |
25/07/2012 autofs-5.0.7
|
|
|
7f6688 |
=======================
|
|
|
7f6688 |
--- autofs-5.0.7.orig/include/rpc_subs.h
|
|
|
7f6688 |
+++ autofs-5.0.7/include/rpc_subs.h
|
|
|
7f6688 |
@@ -71,7 +71,6 @@ int rpc_portmap_getport(struct conn_info
|
|
|
7f6688 |
int rpc_ping_proto(struct conn_info *);
|
|
|
7f6688 |
int rpc_ping(const char *, long, long, unsigned int);
|
|
|
7f6688 |
double elapsed(struct timeval, struct timeval);
|
|
|
7f6688 |
-int rpc_time(const char *, unsigned int, unsigned int, long, long, unsigned int, double *);
|
|
|
7f6688 |
const char *get_addr_string(struct sockaddr *, char *, socklen_t);
|
|
|
7f6688 |
|
|
|
7f6688 |
#endif
|
|
|
7f6688 |
--- autofs-5.0.7.orig/lib/rpc_subs.c
|
|
|
7f6688 |
+++ autofs-5.0.7/lib/rpc_subs.c
|
|
|
7f6688 |
@@ -1090,32 +1090,6 @@ double elapsed(struct timeval start, str
|
|
|
7f6688 |
return t2-t1;
|
|
|
7f6688 |
}
|
|
|
7f6688 |
|
|
|
7f6688 |
-int rpc_time(const char *host,
|
|
|
7f6688 |
- unsigned int ping_vers, unsigned int ping_proto,
|
|
|
7f6688 |
- long seconds, long micros, unsigned int option, double *result)
|
|
|
7f6688 |
-{
|
|
|
7f6688 |
- int status;
|
|
|
7f6688 |
- double taken;
|
|
|
7f6688 |
- struct timeval start, end;
|
|
|
7f6688 |
- struct timezone tz;
|
|
|
7f6688 |
- int proto = (ping_proto & RPC_PING_UDP) ? IPPROTO_UDP : IPPROTO_TCP;
|
|
|
7f6688 |
- unsigned long vers = ping_vers;
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- gettimeofday(&start, &tz;;
|
|
|
7f6688 |
- status = __rpc_ping(host, vers, proto, seconds, micros, option);
|
|
|
7f6688 |
- gettimeofday(&end, &tz;;
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- if (status == RPC_PING_FAIL || status < 0)
|
|
|
7f6688 |
- return status;
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- taken = elapsed(start, end);
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- if (result != NULL)
|
|
|
7f6688 |
- *result = taken;
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- return status;
|
|
|
7f6688 |
-}
|
|
|
7f6688 |
-
|
|
|
7f6688 |
static int rpc_get_exports_proto(struct conn_info *info, exports *exp)
|
|
|
7f6688 |
{
|
|
|
7f6688 |
CLIENT *client;
|
|
|
7f6688 |
@@ -1288,64 +1262,3 @@ const char *get_addr_string(struct socka
|
|
|
7f6688 |
|
|
|
7f6688 |
return inet_ntop(sa->sa_family, addr, name, len);
|
|
|
7f6688 |
}
|
|
|
7f6688 |
-
|
|
|
7f6688 |
-#if 0
|
|
|
7f6688 |
-#include <stdio.h>
|
|
|
7f6688 |
-
|
|
|
7f6688 |
-int main(int argc, char **argv)
|
|
|
7f6688 |
-{
|
|
|
7f6688 |
- int ret;
|
|
|
7f6688 |
- double res = 0.0;
|
|
|
7f6688 |
- exports exportlist, tmp;
|
|
|
7f6688 |
- groups grouplist;
|
|
|
7f6688 |
- int n, maxlen;
|
|
|
7f6688 |
-
|
|
|
7f6688 |
-/*
|
|
|
7f6688 |
- ret = rpc_ping("budgie", 10, 0, RPC_CLOSE_DEFAULT);
|
|
|
7f6688 |
- printf("ret = %d\n", ret);
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- res = 0.0;
|
|
|
7f6688 |
- ret = rpc_time("budgie", NFS2_VERSION, RPC_PING_TCP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
|
|
|
7f6688 |
- printf("v2 tcp ret = %d, res = %f\n", ret, res);
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- res = 0.0;
|
|
|
7f6688 |
- ret = rpc_time("budgie", NFS3_VERSION, RPC_PING_TCP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
|
|
|
7f6688 |
- printf("v3 tcp ret = %d, res = %f\n", ret, res);
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- res = 0.0;
|
|
|
7f6688 |
- ret = rpc_time("budgie", NFS2_VERSION, RPC_PING_UDP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
|
|
|
7f6688 |
- printf("v2 udp ret = %d, res = %f\n", ret, res);
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- res = 0.0;
|
|
|
7f6688 |
- ret = rpc_time("budgie", NFS3_VERSION, RPC_PING_UDP, 10, 0, RPC_CLOSE_DEFAULT, &res;;
|
|
|
7f6688 |
- printf("v3 udp ret = %d, res = %f\n", ret, res);
|
|
|
7f6688 |
-*/
|
|
|
7f6688 |
- exportlist = rpc_get_exports("budgie", 10, 0, RPC_CLOSE_NOLINGER);
|
|
|
7f6688 |
- exportlist = rpc_exports_prune(exportlist);
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- maxlen = 0;
|
|
|
7f6688 |
- for (tmp = exportlist; tmp; tmp = tmp->ex_next) {
|
|
|
7f6688 |
- if ((n = strlen(tmp->ex_dir)) > maxlen)
|
|
|
7f6688 |
- maxlen = n;
|
|
|
7f6688 |
- }
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- if (exportlist) {
|
|
|
7f6688 |
- while (exportlist) {
|
|
|
7f6688 |
- printf("%-*s ", maxlen, exportlist->ex_dir);
|
|
|
7f6688 |
- grouplist = exportlist->ex_groups;
|
|
|
7f6688 |
- if (grouplist) {
|
|
|
7f6688 |
- while (grouplist) {
|
|
|
7f6688 |
- printf("%s%s", grouplist->gr_name,
|
|
|
7f6688 |
- grouplist->gr_next ? "," : "");
|
|
|
7f6688 |
- grouplist = grouplist->gr_next;
|
|
|
7f6688 |
- }
|
|
|
7f6688 |
- }
|
|
|
7f6688 |
- printf("\n");
|
|
|
7f6688 |
- exportlist = exportlist->ex_next;
|
|
|
7f6688 |
- }
|
|
|
7f6688 |
- }
|
|
|
7f6688 |
- rpc_exports_free(exportlist);
|
|
|
7f6688 |
-
|
|
|
7f6688 |
- exit(0);
|
|
|
7f6688 |
-}
|
|
|
7f6688 |
-#endif
|