[master] cdcaade Remove unused worker arguments to VDI/close/recycle

Poul-Henning Kamp phk at varnish-cache.org
Mon Feb 20 12:10:23 CET 2012


commit cdcaade761df7c804c42817aa8947d3c037c0f98
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Feb 20 11:10:08 2012 +0000

    Remove unused worker arguments to VDI/close/recycle

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 45f36f2..bdc3659 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -677,8 +677,8 @@ void VBE_UseHealth(const struct director *vdi);
 
 struct vbc *VDI_GetFd(const struct director *, struct sess *sp);
 int VDI_Healthy(const struct director *, const struct sess *sp);
-void VDI_CloseFd(struct worker *wrk, struct vbc **vbp);
-void VDI_RecycleFd(struct worker *wrk, struct vbc **vbp);
+void VDI_CloseFd(struct vbc **vbp);
+void VDI_RecycleFd(struct vbc **vbp);
 void VDI_AddHostHeader(struct http *to, const struct vbc *vbc);
 void VBE_Poll(void);
 void VDI_Init(void);
diff --git a/bin/varnishd/cache/cache_center.c b/bin/varnishd/cache/cache_center.c
index 57a7e05..b6ee5a5 100644
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@ -287,7 +287,7 @@ cnt_prepresp(struct sess *sp, struct worker *wrk, struct req *req)
 			break;
 		if (bo != NULL) {
 			AN(bo->do_stream);
-			VDI_CloseFd(wrk, &bo->vbc);
+			VDI_CloseFd(&bo->vbc);
 			HSH_Drop(wrk, &sp->req->obj);
 			VBO_DerefBusyObj(wrk, &bo);
 		} else {
@@ -635,7 +635,7 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
 		}
 
 		/* We are not going to fetch the body, Close the connection */
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 	}
 
 	/* Clean up partial fetch */
@@ -814,7 +814,7 @@ cnt_prepfetch(struct sess *sp, struct worker *wrk, struct req *req)
 	if (req->obj == NULL) {
 		req->err_code = 503;
 		sp->step = STP_ERROR;
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 		VBO_DerefBusyObj(wrk, &req->busyobj);
 		return (0);
 	}
diff --git a/bin/varnishd/cache/cache_dir.c b/bin/varnishd/cache/cache_dir.c
index 6554b18..6dda80d 100644
--- a/bin/varnishd/cache/cache_dir.c
+++ b/bin/varnishd/cache/cache_dir.c
@@ -40,12 +40,11 @@
 /* Close a connection ------------------------------------------------*/
 
 void
-VDI_CloseFd(struct worker *wrk, struct vbc **vbp)
+VDI_CloseFd(struct vbc **vbp)
 {
 	struct backend *bp;
 	struct vbc *vc;
 
-	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	AN(vbp);
 	vc = *vbp;
 	*vbp = NULL;
@@ -75,12 +74,11 @@ VDI_CloseFd(struct worker *wrk, struct vbc **vbp)
 /* Recycle a connection ----------------------------------------------*/
 
 void
-VDI_RecycleFd(struct worker *wrk, struct vbc **vbp)
+VDI_RecycleFd(struct vbc **vbp)
 {
 	struct backend *bp;
 	struct vbc *vc;
 
-	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	AN(vbp);
 	vc = *vbp;
 	*vbp = NULL;
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 8f76c24..bb725a2 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -437,7 +437,7 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
 		VSLb(req->vsl, SLT_FetchError,
 		    "backend write error: %d (%s)",
 		    errno, strerror(errno));
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 		/* XXX: other cleanup ? */
 		return (retry);
 	}
@@ -459,7 +459,7 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
 		VSLb(req->vsl, SLT_FetchError,
 		    "http first read error: %d %d (%s)",
 		    i, errno, strerror(errno));
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 		/* XXX: other cleanup ? */
 		/* Retryable if we never received anything */
 		return (i == -1 ? retry : -1);
@@ -473,7 +473,7 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
 			VSLb(req->vsl, SLT_FetchError,
 			    "http first read error: %d %d (%s)",
 			    i, errno, strerror(errno));
-			VDI_CloseFd(wrk, &bo->vbc);
+			VDI_CloseFd(&bo->vbc);
 			/* XXX: other cleanup ? */
 			return (-1);
 		}
@@ -483,7 +483,7 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
 
 	if (http_DissectResponse(hp, htc)) {
 		VSLb(req->vsl, SLT_FetchError, "http format error");
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 		/* XXX: other cleanup ? */
 		return (-1);
 	}
@@ -585,14 +585,14 @@ FetchBody(struct worker *wrk, struct busyobj *bo, struct object *obj)
 	    cls, mklen);
 
 	if (bo->body_status == BS_ERROR) {
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 		bo->stats = NULL;
 		return (__LINE__);
 	}
 
 	if (cls < 0) {
 		wrk->stats.fetch_failed++;
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 		obj->len = 0;
 		bo->stats = NULL;
 		return (__LINE__);
@@ -625,9 +625,9 @@ FetchBody(struct worker *wrk, struct busyobj *bo, struct object *obj)
 	}
 
 	if (cls)
-		VDI_CloseFd(wrk, &bo->vbc);
+		VDI_CloseFd(&bo->vbc);
 	else
-		VDI_RecycleFd(wrk, &bo->vbc);
+		VDI_RecycleFd(&bo->vbc);
 
 	bo->stats = NULL;
 	return (0);
diff --git a/bin/varnishd/cache/cache_pipe.c b/bin/varnishd/cache/cache_pipe.c
index 8815c68..c486a23 100644
--- a/bin/varnishd/cache/cache_pipe.c
+++ b/bin/varnishd/cache/cache_pipe.c
@@ -93,7 +93,7 @@ PipeSession(struct sess *sp)
 
 	if (i) {
 		SES_Close(sp, "pipe");
-		VDI_CloseFd(sp->wrk, &vc);
+		VDI_CloseFd(&vc);
 		return;
 	}
 
@@ -133,6 +133,6 @@ PipeSession(struct sess *sp)
 		}
 	}
 	SES_Close(sp, "pipe");
-	VDI_CloseFd(sp->wrk, &vc);
+	VDI_CloseFd(&vc);
 	bo->vbc = NULL;
 }



More information about the varnish-commit mailing list