From 248a38a252587175039fac16549a0a535fbf51fe Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 2 Aug 2011 17:11:15 +0200 Subject: [PATCH] Adapt tagcache ramcache hibernation to buflib. --- apps/tagcache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/tagcache.c b/apps/tagcache.c index 8556c3cbb..78405f7ac 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -3845,7 +3845,7 @@ static bool tagcache_dumpload(void) struct statefile_header shdr; int fd, rc; long offpos; - int i; + int i, handle; fd = open(TAGCACHE_STATEFILE, O_RDONLY); if (fd < 0) @@ -3855,7 +3855,6 @@ static bool tagcache_dumpload(void) } /* Check the statefile memory placement */ - ramcache_hdr = buffer_alloc(0); rc = read(fd, &shdr, sizeof(struct statefile_header)); if (rc != sizeof(struct statefile_header) || shdr.magic != TAGCACHE_STATEFILE_MAGIC @@ -3867,13 +3866,14 @@ static bool tagcache_dumpload(void) return false; } - offpos = (long)ramcache_hdr - (long)shdr.hdr; /* Lets allocate real memory and load it */ - ramcache_hdr = buffer_alloc(shdr.tc_stat.ramcache_allocated); + handle = core_alloc("tc ramcache", shdr.tc_stat.ramcache_allocated); + ramcache_hdr = core_get_data(handle); rc = read(fd, ramcache_hdr, shdr.tc_stat.ramcache_allocated); close(fd); + offpos = (long)ramcache_hdr - (long)shdr.hdr; if (rc != shdr.tc_stat.ramcache_allocated) { logf("read failure!"); -- 2.11.4.GIT