From cf244b74a04435b6954d5499a09fa97a628bc3ab Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 12 Sep 2004 10:10:48 +0000 Subject: Update. 2004-09-12 Ulrich Drepper * nscd/pwdcache.c (cache_addpw): Sync also negative results to disk. * nscd/grpcache.c (cache_addgr): Likewise. * nscd/hstcache.c (cache_addhst): Likewise. --- nscd/grpcache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'nscd/grpcache.c') diff --git a/nscd/grpcache.c b/nscd/grpcache.c index d07693f..bf4a225 100644 --- a/nscd/grpcache.c +++ b/nscd/grpcache.c @@ -128,6 +128,16 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, /* Copy the key data. */ memcpy (dataset->strdata, key, req->key_len); + /* If necessary, we also propagate the data to disk. */ + if (db->persistent) + { + // XXX async OK? + uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1; + msync ((void *) pval, + ((uintptr_t) dataset & pagesize_m1) + + sizeof (struct dataset) + req->key_len, MS_ASYNC); + } + /* Now get the lock to safely insert the records. */ pthread_rwlock_rdlock (&db->lock); -- cgit v1.1