bpf: remove page size caching

get_pagesize() has a static cache anyway, no need to duplicate it.

* bpf.c (SYS_FUNC(bpf)): Remove static size_t page_size and its
initialisation, use get_pagesize() as the size of buf directly.
This commit is contained in:
Eugene Syromyatnikov 2018-03-05 10:17:44 +01:00 committed by Dmitry V. Levin
parent fcce81ed1a
commit 9ffdd1dfb6

7
bpf.c
View File

@ -409,13 +409,10 @@ SYS_FUNC(bpf)
int rc;
if (entering(tcp)) {
static size_t page_size;
static char *buf;
if (!buf) {
page_size = get_pagesize();
buf = xmalloc(page_size);
}
if (!buf)
buf = xmalloc(get_pagesize());
printxval(bpf_commands, cmd, "BPF_???");
tprints(", ");