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
eb1ca9d7
Commit
eb1ca9d7
authored
Oct 07, 2014
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use VFIL_allocate in -sfile
parent
0a556c7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
storage_file.c
bin/varnishd/storage/storage_file.c
+4
-12
No files found.
bin/varnishd/storage/storage_file.c
View file @
eb1ca9d7
...
...
@@ -40,6 +40,7 @@
#include "storage/storage.h"
#include "vnum.h"
#include "vfil.h"
#ifndef MAP_NOCORE
#define MAP_NOCORE 0
/* XXX Linux */
...
...
@@ -98,16 +99,6 @@ struct smf_sc {
/*--------------------------------------------------------------------*/
static
void
smf_initfile
(
struct
smf_sc
*
sc
,
const
char
*
size
)
{
sc
->
filesize
=
STV_FileSize
(
sc
->
fd
,
size
,
&
sc
->
pagesize
,
"-sfile"
);
AZ
(
ftruncate
(
sc
->
fd
,
(
off_t
)
sc
->
filesize
));
/* XXX: force block allocation here or in open ? */
}
static
void
smf_init
(
struct
stevedore
*
parent
,
int
ac
,
char
*
const
*
av
)
{
...
...
@@ -149,9 +140,10 @@ smf_init(struct stevedore *parent, int ac, char * const *av)
parent
->
priv
=
sc
;
(
void
)
STV_GetFile
(
fn
,
&
sc
->
fd
,
&
sc
->
filename
,
"-sfile"
);
mgt_child_inherit
(
sc
->
fd
,
"storage_file"
);
smf_initfile
(
sc
,
size
);
sc
->
filesize
=
STV_FileSize
(
sc
->
fd
,
size
,
&
sc
->
pagesize
,
"-sfile"
);
if
(
VFIL_allocate
(
sc
->
fd
,
(
off_t
)
sc
->
filesize
,
0
))
ARGV_ERR
(
"(-sfile) allocation error: %s
\n
"
,
strerror
(
errno
));
}
/*--------------------------------------------------------------------
...
...
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