Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
f7b57f54
Commit
f7b57f54
authored
Feb 08, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ObjSnipe() and ObjKill() to HSH_ditto since they don't actually
call into the stevedores methods.
parent
f583b81f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
52 deletions
+53
-52
cache.h
bin/varnishd/cache/cache.h
+0
-2
cache_expire.c
bin/varnishd/cache/cache_expire.c
+1
-1
cache_hash.c
bin/varnishd/cache/cache_hash.c
+47
-0
cache_obj.c
bin/varnishd/cache/cache_obj.c
+2
-48
hash_slinger.h
bin/varnishd/hash/hash_slinger.h
+2
-0
storage_lru.c
bin/varnishd/storage/storage_lru.c
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
f7b57f54
...
...
@@ -882,8 +882,6 @@ void ObjSetState(const struct objcore *, enum boc_state_e next);
void
ObjWaitState
(
const
struct
objcore
*
,
enum
boc_state_e
want
);
void
ObjTrimStore
(
struct
worker
*
,
struct
objcore
*
);
void
ObjTouch
(
struct
worker
*
,
struct
objcore
*
,
double
now
);
int
ObjSnipe
(
const
struct
worker
*
,
struct
objcore
*
);
void
ObjKill
(
struct
objcore
*
);
unsigned
ObjGetXID
(
struct
worker
*
,
struct
objcore
*
);
uint64_t
ObjGetLen
(
struct
worker
*
,
struct
objcore
*
);
void
ObjUpdateMeta
(
struct
worker
*
,
struct
objcore
*
);
...
...
bin/varnishd/cache/cache_expire.c
View file @
f7b57f54
...
...
@@ -311,7 +311,7 @@ exp_expire(struct exp_priv *ep, double now)
VSC_C_main
->
n_expired
++
;
if
(
!
(
oc
->
flags
&
OC_F_DYING
))
Obj
Kill
(
oc
);
HSH_
Kill
(
oc
);
/* Remove from binheap */
assert
(
oc
->
timer_idx
!=
BINHEAP_NOIDX
);
...
...
bin/varnishd/cache/cache_hash.c
View file @
f7b57f54
...
...
@@ -671,6 +671,53 @@ HSH_Unbusy(struct worker *wrk, struct objcore *oc)
Lck_Unlock
(
&
oh
->
mtx
);
}
/*====================================================================
* HSH_Kill()
*
* It's dead Jim, kick it...
*/
void
HSH_Kill
(
struct
objcore
*
oc
)
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
->
objhead
,
OBJHEAD_MAGIC
);
Lck_Lock
(
&
oc
->
objhead
->
mtx
);
oc
->
flags
|=
OC_F_DYING
;
Lck_Unlock
(
&
oc
->
objhead
->
mtx
);
}
/*====================================================================
* HSH_Snipe()
*
* If objcore is idle, gain a ref and mark it dead.
*/
int
HSH_Snipe
(
const
struct
worker
*
wrk
,
struct
objcore
*
oc
)
{
int
retval
=
0
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
->
objhead
,
OBJHEAD_MAGIC
);
AZ
(
oc
->
flags
&
OC_F_DYING
);
if
(
oc
->
refcnt
==
1
&&
!
Lck_Trylock
(
&
oc
->
objhead
->
mtx
))
{
if
(
oc
->
refcnt
==
1
)
{
oc
->
flags
|=
OC_F_DYING
;
oc
->
refcnt
++
;
retval
=
1
;
}
Lck_Unlock
(
&
oc
->
objhead
->
mtx
);
}
return
(
retval
);
}
/*---------------------------------------------------------------------
* Gain a reference on an objcore
*/
...
...
bin/varnishd/cache/cache_obj.c
View file @
f7b57f54
...
...
@@ -71,8 +71,8 @@
*
* 23 ObjUpdateMeta() ban/ttl/grace/keep changed
*
* 3->4
Obj
Snipe() kill if not in use
* 3->4
Obj
Kill() make unavailable
* 3->4
HSH_
Snipe() kill if not in use
* 3->4
HSH_
Kill() make unavailable
*
* 234 ObjSlim() Release body storage (but retain attribute storage)
*
...
...
@@ -427,52 +427,6 @@ ObjTouch(struct worker *wrk, struct objcore *oc, double now)
om
->
objtouch
(
wrk
,
oc
,
now
);
}
/*====================================================================
* ObjKill()
*
* It's dead Jim, kick it...
*/
void
ObjKill
(
struct
objcore
*
oc
)
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
->
objhead
,
OBJHEAD_MAGIC
);
Lck_Lock
(
&
oc
->
objhead
->
mtx
);
oc
->
flags
|=
OC_F_DYING
;
Lck_Unlock
(
&
oc
->
objhead
->
mtx
);
}
/*====================================================================
* ObjSnipe()
*
* If objcore is idle, gain a ref and mark it dead.
*/
int
ObjSnipe
(
const
struct
worker
*
wrk
,
struct
objcore
*
oc
)
{
int
retval
=
0
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
->
objhead
,
OBJHEAD_MAGIC
);
AZ
(
oc
->
flags
&
OC_F_DYING
);
if
(
oc
->
refcnt
==
1
&&
!
Lck_Trylock
(
&
oc
->
objhead
->
mtx
))
{
if
(
oc
->
refcnt
==
1
)
{
oc
->
flags
|=
OC_F_DYING
;
oc
->
refcnt
++
;
retval
=
1
;
}
Lck_Unlock
(
&
oc
->
objhead
->
mtx
);
}
return
(
retval
);
}
/*====================================================================
* Utility functions which work on top of the previous ones
*/
...
...
bin/varnishd/hash/hash_slinger.h
View file @
f7b57f54
...
...
@@ -75,6 +75,8 @@ struct boc *HSH_RefBoc(const struct objcore *);
void
HSH_DerefBoc
(
struct
worker
*
wrk
,
struct
objcore
*
);
struct
objcore
*
HSH_Private
(
struct
worker
*
wrk
);
void
HSH_Abandon
(
struct
objcore
*
oc
);
int
HSH_Snipe
(
const
struct
worker
*
,
struct
objcore
*
);
void
HSH_Kill
(
struct
objcore
*
);
#ifdef VARNISH_CACHE_CHILD
...
...
bin/varnishd/storage/storage_lru.c
View file @
f7b57f54
...
...
@@ -175,7 +175,7 @@ LRU_NukeOne(struct worker *wrk, struct lru *lru)
VSLb
(
wrk
->
vsl
,
SLT_ExpKill
,
"LRU_Cand p=%p f=0x%x r=%d"
,
oc
,
oc
->
flags
,
oc
->
refcnt
);
if
(
Obj
Snipe
(
wrk
,
oc
))
{
if
(
HSH_
Snipe
(
wrk
,
oc
))
{
VSC_C_main
->
n_lru_nuked
++
;
// XXX per lru ?
VTAILQ_REMOVE
(
&
lru
->
lru_head
,
oc
,
lru_list
);
VTAILQ_INSERT_TAIL
(
&
lru
->
lru_head
,
oc
,
lru_list
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment