File: 53-coss-assert.dpatch

package info (click to toggle)
squid 2.6.5-6etch5
  • links: PTS
  • area: main
  • in suites: etch
  • size: 12,540 kB
  • ctags: 13,801
  • sloc: ansic: 105,278; sh: 6,083; makefile: 1,297; perl: 1,245; awk: 40
file content (263 lines) | stat: -rw-r--r-- 8,482 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#! /bin/sh /usr/share/dpatch/dpatch-run
## 53-coss-assert.dpatch by Luigi Gangitano <luigi@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad squid-2.6.5~/src/fs/aufs/store_dir_aufs.c squid-2.6.5/src/fs/aufs/store_dir_aufs.c
--- squid-2.6.5~/src/fs/aufs/store_dir_aufs.c	2006-09-15 22:13:02.000000000 +0200
+++ squid-2.6.5/src/fs/aufs/store_dir_aufs.c	2006-11-06 11:44:39.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_aufs.c,v 1.64 2006/09/15 20:13:02 serassio Exp $
+ * $Id: store_dir_aufs.c,v 1.65 2006/11/05 21:14:31 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -608,7 +608,6 @@
 		 * the cleanup procedure.
 		 */
 		storeRecycle(e);
-		rb->counts.objcount--;
 		rb->counts.cancelcount++;
 	    }
 	    continue;
@@ -759,7 +758,6 @@
 		 * the cleanup procedure.
 		 */
 		storeRecycle(e);
-		rb->counts.objcount--;
 		rb->counts.cancelcount++;
 	    }
 	    continue;
diff -urNad squid-2.6.5~/src/fs/aufs/store_io_aufs.c squid-2.6.5/src/fs/aufs/store_io_aufs.c
--- squid-2.6.5~/src/fs/aufs/store_io_aufs.c	2006-09-09 18:04:38.000000000 +0200
+++ squid-2.6.5/src/fs/aufs/store_io_aufs.c	2006-11-06 11:44:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_aufs.c,v 1.33 2006/09/09 16:04:38 serassio Exp $
+ * $Id: store_io_aufs.c,v 1.34 2006/11/05 21:14:31 hno Exp $
  *
  * DEBUG: section 79    Squid-side AUFS I/O functions.
  *
@@ -278,18 +278,15 @@
 void
 storeAufsRecycle(SwapDir * SD, StoreEntry * e)
 {
-    debug(79, 3) ("storeAufsUnlink: fileno %08X\n", e->swap_filen);
+    debug(79, 3) ("storeAufsRecycle: fileno %08X\n", e->swap_filen);
 
-    /* Release the object without releasing the underlying physical object */
-    storeExpireNow(e);
-    storeReleaseRequest(e);
+    /* detach from the underlying physical object */
     if (e->swap_filen > -1) {
 	storeAufsDirReplRemove(e);
 	storeAufsDirMapBitReset(SD, e->swap_filen);
 	e->swap_filen = -1;
 	e->swap_dirn = -1;
     }
-    storeRelease(e);
 }
 
 /*  === STATIC =========================================================== */
diff -urNad squid-2.6.5~/src/fs/coss/store_dir_coss.c squid-2.6.5/src/fs/coss/store_dir_coss.c
--- squid-2.6.5~/src/fs/coss/store_dir_coss.c	2006-10-26 22:00:21.000000000 +0200
+++ squid-2.6.5/src/fs/coss/store_dir_coss.c	2006-11-06 11:44:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.c,v 1.65 2006/10/26 20:00:21 serassio Exp $
+ * $Id: store_dir_coss.c,v 1.66 2006/11/05 21:14:32 hno Exp $
  *
  * DEBUG: section 47    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -1441,10 +1441,6 @@
 static void
 storeCoss_DeleteStoreEntry(RebuildState * rb, const cache_key * key, StoreEntry * e)
 {
-    assert(rb->counts.objcount >= 0);
-    /* XXX are these counters even correct, considering e could be a different storedir? */
-    rb->counts.objcount--;
-    assert(e->swap_dirn >= 0);
     storeRecycle(e);
 }
 
diff -urNad squid-2.6.5~/src/fs/coss/store_io_coss.c squid-2.6.5/src/fs/coss/store_io_coss.c
--- squid-2.6.5~/src/fs/coss/store_io_coss.c	2006-09-23 12:34:41.000000000 +0200
+++ squid-2.6.5/src/fs/coss/store_io_coss.c	2006-11-06 11:44:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_coss.c,v 1.34 2006/09/23 10:34:41 serassio Exp $
+ * $Id: store_io_coss.c,v 1.35 2006/11/05 21:14:32 hno Exp $
  *
  * DEBUG: section 79    Storage Manager COSS Interface
  * AUTHOR: Eric Stern
@@ -264,10 +264,6 @@
 {
     debug(79, 3) ("storeCossRecycle: %s: offset %d\n", stripePath(SD), e->swap_filen);
 
-    /* Expire the object */
-    storeExpireNow(e);
-    storeReleaseRequest(e);
-
     /* If there is a valid filen remove from COSS linked list */
     if (e->swap_filen > -1) {
 	storeCossUnlink(SD, e);
@@ -279,8 +275,6 @@
 	e->swap_filen = -1;
 	e->swap_dirn = -1;
     }
-    /* Finally make the store layer forget about this object */
-    storeRelease(e);
 }
 
 static int
diff -urNad squid-2.6.5~/src/fs/diskd/store_dir_diskd.c squid-2.6.5/src/fs/diskd/store_dir_diskd.c
--- squid-2.6.5~/src/fs/diskd/store_dir_diskd.c	2006-09-22 02:51:43.000000000 +0200
+++ squid-2.6.5/src/fs/diskd/store_dir_diskd.c	2006-11-06 11:44:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.c,v 1.85 2006/09/22 00:51:43 adrian Exp $
+ * $Id: store_dir_diskd.c,v 1.86 2006/11/05 21:14:36 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -799,7 +799,6 @@
 		 * the cleanup procedure.
 		 */
 		storeRecycle(e);
-		rb->counts.objcount--;
 		rb->counts.cancelcount++;
 	    }
 	    continue;
@@ -975,7 +974,6 @@
 		 * the cleanup procedure.
 		 */
 		storeRecycle(e);
-		rb->counts.objcount--;
 		rb->counts.cancelcount++;
 	    }
 	    continue;
diff -urNad squid-2.6.5~/src/fs/diskd/store_io_diskd.c squid-2.6.5/src/fs/diskd/store_io_diskd.c
--- squid-2.6.5~/src/fs/diskd/store_io_diskd.c	2006-07-05 08:52:13.000000000 +0200
+++ squid-2.6.5/src/fs/diskd/store_io_diskd.c	2006-11-06 11:44:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_diskd.c,v 1.32 2006/07/05 06:52:13 adrian Exp $
+ * $Id: store_io_diskd.c,v 1.33 2006/11/05 21:14:36 hno Exp $
  *
  * DEBUG: section 79    Squid-side DISKD I/O functions.
  * AUTHOR: Duane Wessels
@@ -304,16 +304,13 @@
 {
     debug(79, 3) ("storeDiskdUnlink: fileno %08X\n", e->swap_filen);
 
-    /* Release the object without releasing the underlying physical object */
-    storeExpireNow(e);
-    storeReleaseRequest(e);
+    /* Detach from the underlying physical object */
     if (e->swap_filen > -1) {
 	storeDiskdDirReplRemove(e);
 	storeDiskdDirMapBitReset(SD, e->swap_filen);
 	e->swap_filen = -1;
 	e->swap_dirn = -1;
     }
-    storeRelease(e);
 }
 
 
diff -urNad squid-2.6.5~/src/fs/ufs/store_dir_ufs.c squid-2.6.5/src/fs/ufs/store_dir_ufs.c
--- squid-2.6.5~/src/fs/ufs/store_dir_ufs.c	2006-08-03 04:31:13.000000000 +0200
+++ squid-2.6.5/src/fs/ufs/store_dir_ufs.c	2006-11-06 11:44:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_ufs.c,v 1.61 2006/08/03 02:31:13 adrian Exp $
+ * $Id: store_dir_ufs.c,v 1.62 2006/11/05 21:14:37 hno Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -613,11 +613,6 @@
 		 * the cleanup procedure.
 		 */
 		storeRecycle(e);
-		/*
-		 * XXX considering we might've canceled an object from another store;
-		 * XXX what should happen with these stats?
-		 */
-		rb->counts.objcount--;
 		rb->counts.cancelcount++;
 	    }
 	    continue;
@@ -768,8 +763,6 @@
 		 * the cleanup procedure.
 		 */
 		storeRecycle(e);
-		/* XXX are these counters valid since e could be from another swapfs? */
-		rb->counts.objcount--;
 		rb->counts.cancelcount++;
 	    }
 	    continue;
diff -urNad squid-2.6.5~/src/fs/ufs/store_io_ufs.c squid-2.6.5/src/fs/ufs/store_io_ufs.c
--- squid-2.6.5~/src/fs/ufs/store_io_ufs.c	2006-07-05 08:52:14.000000000 +0200
+++ squid-2.6.5/src/fs/ufs/store_io_ufs.c	2006-11-06 11:44:40.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_ufs.c,v 1.15 2006/07/05 06:52:14 adrian Exp $
+ * $Id: store_io_ufs.c,v 1.16 2006/11/05 21:14:37 hno Exp $
  *
  * DEBUG: section 79    Storage Manager UFS Interface
  * AUTHOR: Duane Wessels
@@ -200,16 +200,13 @@
 {
     debug(79, 3) ("storeUfsUnlink: fileno %08X\n", e->swap_filen);
 
-    /* Release the object without releasing the underlying physical object */
-    storeExpireNow(e);
-    storeReleaseRequest(e);
+    /* Detach from underlying physical object */
     if (e->swap_filen > -1) {
 	storeUfsDirReplRemove(e);
 	storeUfsDirMapBitReset(SD, e->swap_filen);
 	e->swap_filen = -1;
 	e->swap_dirn = -1;
     }
-    storeRelease(e);
 }
 
 /*  === STATIC =========================================================== */
diff -urNad squid-2.6.5~/src/store_io.c squid-2.6.5/src/store_io.c
--- squid-2.6.5~/src/store_io.c	2006-07-05 08:52:12.000000000 +0200
+++ squid-2.6.5/src/store_io.c	2006-11-06 11:44:39.000000000 +0100
@@ -122,10 +122,21 @@
 void
 storeRecycle(StoreEntry * e)
 {
-    SwapDir *SD = INDEXSD(e->swap_dirn);
-    SD->obj.recycle(SD, e);
+    if (e->swap_dirn >= 0 && !storeEntryLocked(e)) {
+	SwapDir *SD = INDEXSD(e->swap_dirn);
+
+	/* Expire the object */
+	storeExpireNow(e);
+	storeReleaseRequest(e);
+
+	/* Make the cache_dir forget about it */
+	SD->obj.recycle(SD, e);
+    }
+    /* Finally make the store layer forget about this object */
+    storeRelease(e);
 }
 
+
 squid_off_t
 storeOffset(storeIOState * sio)
 {