]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sun, 12 Sep 2004 10:10:48 +0000 (10:10 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 12 Sep 2004 10:10:48 +0000 (10:10 +0000)
2004-09-12  Ulrich Drepper  <drepper@redhat.com>

* nscd/pwdcache.c (cache_addpw): Sync also negative results to disk.
* nscd/grpcache.c (cache_addgr): Likewise.
* nscd/hstcache.c (cache_addhst): Likewise.

ChangeLog
nscd/grpcache.c
nscd/pwdcache.c

index 682a38b354685871c546a4f644ac6c052189dbea..8fcfae681ae7e147134300e7e3ddcf9e423c7c56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-12  Ulrich Drepper  <drepper@redhat.com>
+
+       * nscd/pwdcache.c (cache_addpw): Sync also negative results to disk.
+       * nscd/grpcache.c (cache_addgr): Likewise.
+       * nscd/hstcache.c (cache_addhst): Likewise.
+
 2004-09-11  Roland McGrath  <roland@frob.com>
 
        * sysdeps/mach/hurd/i386/init-first.c (init1) [! SHARED]:
index d07693f1a43ec7d57f33f40860097914352914fb..bf4a225edd1257029c7b3374171454a3e5810a7a 100644 (file)
@@ -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);
 
index 2354b6d78a551dff584554c65ac8472b6cb8e362..93049bab120f47ecd1628b023f3e311dcf930d00 100644 (file)
@@ -135,6 +135,16 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
              /* Copy the key data.  */
              char *key_copy = 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);
 
@@ -245,7 +255,7 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
              && memcmp (&dataset->resp, dh->data,
                         dh->allocsize - offsetof (struct dataset, resp)) == 0)
            {
-             /* The sata has not changed.  We will just bump the
+             /* The data has not changed.  We will just bump the
                 timeout value.  Note that the new record has been
                 allocated on the stack and need not be freed.  */
              dh->timeout = dataset->head.timeout;