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
1f172c75
Commit
1f172c75
authored
Sep 26, 2012
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Round to page sizes on signature syncs
parent
d49f707a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
storage_persistent.h
bin/varnishd/storage/storage_persistent.h
+1
-0
storage_persistent_subr.c
bin/varnishd/storage/storage_persistent_subr.c
+20
-7
No files found.
bin/varnishd/storage/storage_persistent.h
View file @
1f172c75
...
...
@@ -210,6 +210,7 @@ void smp_reset_signspace(struct smp_signspace *spc);
void
smp_copy_signspace
(
struct
smp_signspace
*
dst
,
const
struct
smp_signspace
*
src
);
void
smp_trunc_signspace
(
struct
smp_signspace
*
spc
,
uint32_t
len
);
void
smp_msync
(
void
*
addr
,
size_t
length
);
void
smp_newsilo
(
struct
smp_sc
*
sc
);
int
smp_valid_silo
(
struct
smp_sc
*
sc
);
...
...
bin/varnishd/storage/storage_persistent_subr.c
View file @
1f172c75
...
...
@@ -156,13 +156,7 @@ smp_reset_sign(struct smp_signctx *ctx)
void
smp_sync_sign
(
const
struct
smp_signctx
*
ctx
)
{
int
i
;
/* XXX: round to pages */
i
=
msync
((
void
*
)
ctx
->
ss
,
ctx
->
ss
->
length
+
SMP_SIGN_SPACE
,
MS_SYNC
);
if
(
i
&&
0
)
fprintf
(
stderr
,
"SyncSign(%p %s) = %d %s
\n
"
,
ctx
->
ss
,
ctx
->
id
,
i
,
strerror
(
errno
));
smp_msync
(
ctx
->
ss
,
SMP_SIGN_SPACE
+
ctx
->
ss
->
length
);
}
/*--------------------------------------------------------------------
...
...
@@ -267,6 +261,25 @@ smp_new_signspace(const struct smp_sc *sc, struct smp_signspace *spc,
spc
->
size
=
size
-
SMP_SIGN_SPACE
;
}
/*--------------------------------------------------------------------
* Force a write of a memory block (rounded to nearest pages) to
* the backing store.
*/
void
smp_msync
(
void
*
addr
,
size_t
length
)
{
uintptr_t
start
,
end
;
int
pagesize
;
pagesize
=
getpagesize
();
assert
(
pagesize
>
0
&&
PWR2
(
pagesize
));
start
=
RDN2
((
uintptr_t
)
addr
,
pagesize
);
end
=
RUP2
((
uintptr_t
)
addr
+
length
,
pagesize
);
assert
(
start
<
end
);
AZ
(
msync
((
void
*
)
start
,
end
-
start
,
MS_SYNC
));
}
/*--------------------------------------------------------------------
* Initialize a Silo with a valid but empty structure.
*
...
...
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