diff options
author | Toomas Soome <tsoome@me.com> | 2018-11-27 19:47:25 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2020-01-04 13:47:53 +0200 |
commit | 064d16273d15bf6b8ef164ed9d00a767e2fcd0ed (patch) | |
tree | 2eb081b05136d06a2549611b8a022e9d6476dadc /usr/src | |
parent | f7afc1fdb20343a25c4d88d6e7004d102e4c3e38 (diff) | |
download | illumos-joyent-064d16273d15bf6b8ef164ed9d00a767e2fcd0ed.tar.gz |
12130 nfs/statd: cast between incompatible function types
Reviewed by: C Fraire <cfraire@me.com>
Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_proc.c | 33 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_statd.c | 20 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_statd.h | 16 | ||||
-rw-r--r-- | usr/src/cmd/fs.d/nfs/statd/sm_svc.c | 64 |
4 files changed, 73 insertions, 60 deletions
diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_proc.c b/usr/src/cmd/fs.d/nfs/statd/sm_proc.c index cf662c97f8..f3e050df8c 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_proc.c +++ b/usr/src/cmd/fs.d/nfs/statd/sm_proc.c @@ -96,8 +96,10 @@ extern struct lifconf *getmyaddrs(void); /* ARGSUSED */ void -sm_stat_svc(sm_name *namep, sm_stat_res *resp) +sm_stat_svc(void *arg1, void *arg2) { + sm_name *namep = arg1; + sm_stat_res *resp = arg2; if (debug) (void) printf("proc sm_stat: mon_name = %s\n", @@ -109,8 +111,10 @@ sm_stat_svc(sm_name *namep, sm_stat_res *resp) /* ARGSUSED */ void -sm_mon_svc(mon *monp, sm_stat_res *resp) +sm_mon_svc(void *arg1, void *arg2) { + mon *monp = arg1; + sm_stat_res *resp = arg2; mon_id *monidp; monidp = &monp->mon_id; @@ -135,8 +139,11 @@ sm_mon_svc(mon *monp, sm_stat_res *resp) /* ARGSUSED */ void -sm_unmon_svc(mon_id *monidp, sm_stat *resp) +sm_unmon_svc(void *arg1, void *arg2) { + mon_id *monidp = arg1; + sm_stat *resp = arg2; + rw_rdlock(&thr_rwlock); if (debug) { (void) printf( @@ -155,8 +162,11 @@ sm_unmon_svc(mon_id *monidp, sm_stat *resp) /* ARGSUSED */ void -sm_unmon_all_svc(my_id *myidp, sm_stat *resp) +sm_unmon_all_svc(void *arg1, void *arg2) { + my_id *myidp = arg1; + sm_stat *resp = arg2; + rw_rdlock(&thr_rwlock); if (debug) (void) printf("proc sm_unmon_all: [%s, %d, %d, %d]\n", @@ -173,8 +183,10 @@ sm_unmon_all_svc(my_id *myidp, sm_stat *resp) * Notifies lockd specified by name that state has changed for this server. */ void -sm_notify_svc(stat_chge *ntfp) +sm_notify_svc(void *arg, void *arg1 __unused) { + stat_chge *ntfp = arg; + rw_rdlock(&thr_rwlock); if (debug) (void) printf("sm_notify: %s state =%d\n", @@ -185,7 +197,7 @@ sm_notify_svc(stat_chge *ntfp) /* ARGSUSED */ void -sm_simu_crash_svc(void *myidp) +sm_simu_crash_svc(void *myidp, void *arg __unused) { int i; struct mon_entry *monitor_q; @@ -235,8 +247,10 @@ sm_simu_crash_svc(void *myidp) /* ARGSUSED */ void -nsmaddrproc1_reg(reg1args *regargs, reg1res *regresp) +nsmaddrproc1_reg(void *arg1, void *arg2) { + reg1args *regargs = arg1; + reg1res *regresp = arg2; nsm_addr_res status; name_addr_entry_t *entry; char *tmp_n_bytes; @@ -1174,7 +1188,8 @@ in_host_array(char *host) * nothing and leaves host_name the way it was previous to the call. */ static void -add_to_host_array(char *host) { +add_to_host_array(char *host) +{ void *new_block = NULL; @@ -1182,7 +1197,7 @@ add_to_host_array(char *host) { if (addrix >= host_name_count) { host_name_count += HOST_NAME_INCR; new_block = realloc((void *)host_name, - host_name_count*sizeof (char *)); + host_name_count * sizeof (char *)); if (new_block != NULL) host_name = new_block; else { diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_statd.c b/usr/src/cmd/fs.d/nfs/statd/sm_statd.c index e7805e7747..b8d97b7571 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_statd.c +++ b/usr/src/cmd/fs.d/nfs/statd/sm_statd.c @@ -29,7 +29,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -91,8 +91,8 @@ static void delete_name(name_entry **namepp, char *name); static void remove_name(char *name, int op, int startup); static int statd_call_statd(char *name); static void pr_name(char *name, int flag); -static void *thr_statd_init(void); -static void *sm_try(void); +static void *thr_statd_init(void *); +static void *sm_try(void *); static void *thr_call_statd(void *); static void remove_single_name(char *name, char *dir1, char *dir2); static int move_file(char *fromdir, char *file, char *todir); @@ -238,8 +238,7 @@ statd_init(void) (void) closedir(dp); /* Contact hosts' statd */ - if (thr_create(NULL, 0, (void *(*)(void *))thr_statd_init, NULL, - THR_DETACHED, NULL)) { + if (thr_create(NULL, 0, thr_statd_init, NULL, THR_DETACHED, NULL)) { syslog(LOG_ERR, "statd: unable to create thread for thr_statd_init\n"); exit(1); @@ -250,10 +249,10 @@ statd_init(void) * Work thread which contacts hosts' statd. */ static void * -thr_statd_init(void) +thr_statd_init(void *arg __unused) { struct dirent *dirp; - DIR *dp; + DIR *dp; int num_threads; int num_join; int i; @@ -435,11 +434,10 @@ thr_statd_init(void) (void) printf("Creating thread for sm_try\n"); /* Continue to notify statd on hosts that were unreachable. */ - if (thr_create(NULL, 0, (void *(*)(void *))sm_try, NULL, THR_DETACHED, - NULL)) + if (thr_create(NULL, 0, sm_try, NULL, THR_DETACHED, NULL)) syslog(LOG_ERR, "statd: unable to create thread for sm_try().\n"); - thr_exit((void *) 0); + thr_exit(NULL); #ifdef lint return (0); #endif @@ -640,7 +638,7 @@ statd_call_statd(char *name) * variable will signal it. */ void * -sm_try(void) +sm_try(void *arg __unused) { name_entry *nl, *next; timestruc_t wtime; diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_statd.h b/usr/src/cmd/fs.d/nfs/statd/sm_statd.h index aa1368b461..112a091d07 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_statd.h +++ b/usr/src/cmd/fs.d/nfs/statd/sm_statd.h @@ -30,7 +30,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -203,13 +203,13 @@ extern char *xmalloc(unsigned); * RPC service functions, slightly different here than the * generated ones in sm_inter.h */ -extern void nsmaddrproc1_reg(reg1args *, reg1res *); -extern void sm_stat_svc(sm_name *namep, sm_stat_res *resp); -extern void sm_mon_svc(mon *monp, sm_stat_res *resp); -extern void sm_unmon_svc(mon_id *monidp, sm_stat *resp); -extern void sm_unmon_all_svc(my_id *myidp, sm_stat *resp); -extern void sm_simu_crash_svc(void *myidp); -extern void sm_notify_svc(stat_chge *ntfp); +extern void nsmaddrproc1_reg(void *, void *); +extern void sm_stat_svc(void *, void *); +extern void sm_mon_svc(void *, void *); +extern void sm_unmon_svc(void *, void *); +extern void sm_unmon_all_svc(void *, void *); +extern void sm_simu_crash_svc(void *, void *); +extern void sm_notify_svc(void *, void *); extern void sm_inithash(void); extern void copydir_from_to(char *from_dir, char *to_dir); diff --git a/usr/src/cmd/fs.d/nfs/statd/sm_svc.c b/usr/src/cmd/fs.d/nfs/statd/sm_svc.c index 8f19764116..ad000db8b3 100644 --- a/usr/src/cmd/fs.d/nfs/statd/sm_svc.c +++ b/usr/src/cmd/fs.d/nfs/statd/sm_svc.c @@ -26,7 +26,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * University Copyright- Copyright (c) 1982, 1986, 1988 @@ -142,41 +142,41 @@ static int nftw_owner(const char *, const struct stat *, int, struct FTW *); /* * statd protocol - * commands: - * SM_STAT - * returns stat_fail to caller - * SM_MON - * adds an entry to the monitor_q and the record_q. + * commands: + * SM_STAT + * returns stat_fail to caller + * SM_MON + * adds an entry to the monitor_q and the record_q. * This message is sent by the server lockd to the server * statd, to indicate that a new client is to be monitored. * It is also sent by the server lockd to the client statd * to indicate that a new server is to be monitored. - * SM_UNMON - * removes an entry from the monitor_q and the record_q - * SM_UNMON_ALL - * removes all entries from a particular host from the - * monitor_q and the record_q. Our statd has this - * disabled. - * SM_SIMU_CRASH - * simulate a crash. Removes everything from the - * record_q and the recovery_q, then calls statd_init() - * to restart things. This message is sent by the server + * SM_UNMON + * removes an entry from the monitor_q and the record_q + * SM_UNMON_ALL + * removes all entries from a particular host from the + * monitor_q and the record_q. Our statd has this + * disabled. + * SM_SIMU_CRASH + * simulate a crash. Removes everything from the + * record_q and the recovery_q, then calls statd_init() + * to restart things. This message is sent by the server * lockd to the server statd to have all clients notified * that they should reclaim locks. - * SM_NOTIFY + * SM_NOTIFY * Sent by statd on server to statd on client during * crash recovery. The client statd passes the info * to its lockd so it can attempt to reclaim the locks * held on the server. * * There are three main hash tables used to keep track of things. - * mon_table - * table that keeps track hosts statd must watch. If one of - * these hosts crashes, then any locks held by that host must - * be released. - * record_table - * used to keep track of all the hostname files stored in - * the directory /var/statmon/sm. These are client hosts who + * mon_table + * table that keeps track hosts statd must watch. If one of + * these hosts crashes, then any locks held by that host must + * be released. + * record_table + * used to keep track of all the hostname files stored in + * the directory /var/statmon/sm. These are client hosts who * are holding or have held a lock at some point. Needed * to determine if a file needs to be created for host in * /var/statmon/sm. @@ -210,7 +210,7 @@ sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp) } result; bool_t (*xdr_argument)(), (*xdr_result)(); - char *(*local)(); + void (*local)(void *, void *); /* * Dispatch according to which protocol is being used: @@ -227,7 +227,7 @@ sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp) case NSMADDRPROC1_REG: xdr_argument = xdr_reg1args; xdr_result = xdr_reg1res; - local = (char *(*)()) nsmaddrproc1_reg; + local = nsmaddrproc1_reg; break; case NSMADDRPROC1_UNREG: /* Not impl. */ @@ -245,37 +245,37 @@ sm_prog_1(struct svc_req *rqstp, SVCXPRT *transp) case SM_STAT: xdr_argument = xdr_sm_name; xdr_result = xdr_sm_stat_res; - local = (char *(*)()) sm_stat_svc; + local = sm_stat_svc; break; case SM_MON: xdr_argument = xdr_mon; xdr_result = xdr_sm_stat_res; - local = (char *(*)()) sm_mon_svc; + local = sm_mon_svc; break; case SM_UNMON: xdr_argument = xdr_mon_id; xdr_result = xdr_sm_stat; - local = (char *(*)()) sm_unmon_svc; + local = sm_unmon_svc; break; case SM_UNMON_ALL: xdr_argument = xdr_my_id; xdr_result = xdr_sm_stat; - local = (char *(*)()) sm_unmon_all_svc; + local = sm_unmon_all_svc; break; case SM_SIMU_CRASH: xdr_argument = xdr_void; xdr_result = xdr_void; - local = (char *(*)()) sm_simu_crash_svc; + local = sm_simu_crash_svc; break; case SM_NOTIFY: xdr_argument = xdr_stat_chge; xdr_result = xdr_void; - local = (char *(*)()) sm_notify_svc; + local = sm_notify_svc; break; default: |