FBSD: warning cleanups
authorBen Kaduk <kaduk@mit.edu>
Sat, 30 Oct 2010 06:23:24 +0000 (02:23 -0400)
committerDerrick Brashear <shadow@dementia.org>
Thu, 25 Nov 2010 21:23:59 +0000 (13:23 -0800)
Only declare 'p' if it will be used; other unused variables;
signedness mismatches.

Kill spl with fire.

Change-Id: I03ada8b358f64342bc61bdef03df9dfecc550a6b
Reviewed-on: http://gerrit.openafs.org/3200
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/FBSD/osi_file.c
src/afs/FBSD/osi_machdep.h
src/afs/FBSD/osi_vcache.c
src/afs/FBSD/osi_vm.c
src/afs/FBSD/osi_vnodeops.c
src/rx/FBSD/rx_knet.c

index ecd5837..02fe253 100644 (file)
@@ -158,7 +158,7 @@ int
 afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
             afs_int32 asize)
 {
-    unsigned int resid;
+    int resid;
     afs_int32 code;
     AFS_STATCNT(osi_Read);
 
index 86f1bdb..134f482 100644 (file)
@@ -143,11 +143,11 @@ extern struct thread *afs_global_owner;
 # endif
 
 #undef SPLVAR
-#define SPLVAR int splvar
+#define SPLVAR
 #undef NETPRI
-#define NETPRI splvar=splnet()
+#define NETPRI
 #undef USERPRI
-#define USERPRI splx(splvar)
+#define USERPRI
 
 #define osi_procname(procname, size) strncpy(procname, curproc->p_comm, size)
 
index d00ba68..6530bb0 100644 (file)
@@ -15,7 +15,6 @@
 
 int
 osi_TryEvictVCache(struct vcache *avc, int *slept) {
-    struct vnode *vp = AFSTOV(avc);
 
     /*
      * essentially all we want to do here is check that the
index 571fb67..438ec92 100644 (file)
@@ -80,7 +80,6 @@
 int
 osi_VM_FlushVCache(struct vcache *avc, int *slept)
 {
-    struct vm_object *obj;
     struct vnode *vp = AFSTOV(avc);
 
     if (!VI_TRYLOCK(vp)) /* need interlock to check usecount */
@@ -186,14 +185,11 @@ osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred, int sync)
     int tries, code;
     int islocked;
 
-    SPLVAR;
-
     vp = AFSTOV(avc);
 
     VI_LOCK(vp);
     if (vp->v_iflag & VI_DOOMED) {
        VI_UNLOCK(vp);
-       USERPRI;
        return;
     }
     VI_UNLOCK(vp);
@@ -238,7 +234,6 @@ osi_VM_TryToSmush(struct vcache *avc, afs_ucred_t *acred, int sync)
        vn_lock(vp, LK_DOWNGRADE);
     else if (!islocked)
        VOP_UNLOCK(vp, 0);
-    USERPRI;
 }
 
 /* Purge VM for a file when its callback is revoked.
index 5215642..5a9811b 100644 (file)
@@ -481,7 +481,9 @@ afs_vop_lookup(ap)
     int flags = ap->a_cnp->cn_flags;
     int lockparent;            /* 1 => lockparent flag is set */
     int wantparent;            /* 1 => wantparent or lockparent flag */
+#ifndef AFS_FBSD80_ENV
     struct thread *p = ap->a_cnp->cn_thread;
+#endif
 
     dvp = ap->a_dvp;
     if (dvp->v_type != VDIR) {
@@ -575,7 +577,9 @@ afs_vop_create(ap)
     int error = 0;
     struct vcache *vcp;
     struct vnode *dvp = ap->a_dvp;
+#ifndef AFS_FBSD80_ENV
     struct thread *p = ap->a_cnp->cn_thread;
+#endif
     GETNAME();
 
     AFS_GLOCK();
@@ -1153,7 +1157,9 @@ afs_vop_link(ap)
     int error = 0;
     struct vnode *dvp = ap->a_tdvp;
     struct vnode *vp = ap->a_vp;
+#ifndef AFS_FBSD80_ENV
     struct thread *p = ap->a_cnp->cn_thread;
+#endif
 
     GETNAME();
     if (dvp->v_mount != vp->v_mount) {
@@ -1197,7 +1203,9 @@ afs_vop_rename(ap)
     struct vnode *tdvp = ap->a_tdvp;
     struct vnode *fvp = ap->a_fvp;
     struct vnode *fdvp = ap->a_fdvp;
+#ifndef AFS_FBSD80_ENV
     struct thread *p = fcnp->cn_thread;
+#endif
 
     /*
      * Check for cross-device rename.
@@ -1299,7 +1307,9 @@ afs_vop_mkdir(ap)
     struct vattr *vap = ap->a_vap;
     int error = 0;
     struct vcache *vcp;
+#ifndef AFS_FBSD80_ENV
     struct thread *p = ap->a_cnp->cn_thread;
+#end
 
     GETNAME();
 #ifdef DIAGNOSTIC
index 1170410..cbc6deb 100644 (file)
@@ -88,11 +88,13 @@ osi_StopListener(void)
        AFS_GUNLOCK();
     soshutdown(rx_socket, SHUT_RDWR);
     p = pfind(rxk_ListenerPid);
-    afs_warn("osi_StopListener: rxk_ListenerPid %lx\n", p);
     if (p) {
+       afs_warn("osi_StopListener: rxk_ListenerPid %u\n", rxk_ListenerPid);
        psignal(p, SIGUSR1);
        PROC_UNLOCK(p);
-    }
+    } else
+       afs_warn("osi_StopListener: rxk_Listener not found (pid %u)\n",
+           rxk_ListenerPid);
 #ifdef AFS_FBSD70_ENV
     {
       /* Avoid destroying socket until osi_NetReceive has