Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc remove mpool_getf



details:   https://anonhg.NetBSD.org/src/rev/a52860ac0fdc
branches:  trunk
changeset: 347948:a52860ac0fdc
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 24 21:31:25 2016 +0000

description:
remove mpool_getf

diffstat:

 lib/libc/db/btree/bt_close.c    |   6 +++---
 lib/libc/db/btree/bt_debug.c    |  12 ++++++------
 lib/libc/db/btree/bt_delete.c   |  30 +++++++++++++++---------------
 lib/libc/db/btree/bt_open.c     |   6 +++---
 lib/libc/db/btree/bt_overflow.c |  10 +++++-----
 lib/libc/db/btree/bt_page.c     |   6 +++---
 lib/libc/db/btree/bt_put.c      |   8 ++++----
 lib/libc/db/btree/bt_search.c   |  18 +++++++++---------
 lib/libc/db/btree/bt_seq.c      |  26 +++++++++++++-------------
 lib/libc/db/btree/bt_split.c    |  10 +++++-----
 lib/libc/db/mpool/mpool.c       |  13 +++----------
 lib/libc/db/recno/rec_open.c    |   6 +++---
 lib/libc/db/recno/rec_search.c  |   8 ++++----
 lib/libc/include/namespace.h    |   3 +--
 14 files changed, 77 insertions(+), 85 deletions(-)

diffs (truncated from 714 to 300 lines):

diff -r 5c70680c1641 -r a52860ac0fdc lib/libc/db/btree/bt_close.c
--- a/lib/libc/db/btree/bt_close.c      Sat Sep 24 21:18:09 2016 +0000
+++ b/lib/libc/db/btree/bt_close.c      Sat Sep 24 21:31:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_close.c,v 1.16 2016/09/24 20:11:12 christos Exp $   */
+/*     $NetBSD: bt_close.c,v 1.17 2016/09/24 21:31:25 christos Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_close.c,v 1.16 2016/09/24 20:11:12 christos Exp $");
+__RCSID("$NetBSD: bt_close.c,v 1.17 2016/09/24 21:31:25 christos Exp $");
 
 #include "namespace.h"
 
@@ -164,7 +164,7 @@
        BTMETA m;
        void *p;
 
-       if ((p = mpool_getf(t->bt_mp, P_META, 0)) == NULL)
+       if ((p = mpool_get(t->bt_mp, P_META, 0)) == NULL)
                return (RET_ERROR);
 
        /* Fill in metadata. */
diff -r 5c70680c1641 -r a52860ac0fdc lib/libc/db/btree/bt_debug.c
--- a/lib/libc/db/btree/bt_debug.c      Sat Sep 24 21:18:09 2016 +0000
+++ b/lib/libc/db/btree/bt_debug.c      Sat Sep 24 21:31:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_debug.c,v 1.17 2016/09/24 20:11:12 christos Exp $   */
+/*     $NetBSD: bt_debug.c,v 1.18 2016/09/24 21:31:25 christos Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_debug.c,v 1.17 2016/09/24 20:11:12 christos Exp $");
+__RCSID("$NetBSD: bt_debug.c,v 1.18 2016/09/24 21:31:25 christos Exp $");
 
 #include <assert.h>
 #include <stdio.h>
@@ -111,7 +111,7 @@
 #undef X
 
        for (i = P_ROOT; i < t->bt_mp->npages &&
-           (h = mpool_getf(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
+           (h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
                __bt_dpage(h);
 
        (void)fflush(tracefp);
@@ -183,7 +183,7 @@
        __bt_dinit();
 
        t = dbp->internal;
-       if ((h = mpool_getf(t->bt_mp, pgno, MPOOL_IGNOREPIN)) != NULL) {
+       if ((h = mpool_get(t->bt_mp, pgno, MPOOL_IGNOREPIN)) != NULL) {
                __bt_dpage(h);
                (void)mpool_put(t->bt_mp, h, 0);
        }
@@ -312,7 +312,7 @@
        pcont = pinternal = pleaf = 0;
        nkeys = ifree = lfree = 0;
        for (i = P_ROOT; i < t->bt_mp->npages &&
-           (h = mpool_getf(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
+           (h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN)) != NULL; ++i)
                switch (h->flags & P_TYPE) {
                case P_BINTERNAL:
                case P_RINTERNAL:
@@ -334,7 +334,7 @@
 
        /* Count the levels of the tree. */
        for (i = P_ROOT, levels = 0 ;; ++levels) {
-               h = mpool_getf(t->bt_mp, i, MPOOL_IGNOREPIN);
+               h = mpool_get(t->bt_mp, i, MPOOL_IGNOREPIN);
                if (h->flags & (P_BLEAF|P_RLEAF)) {
                        if (levels == 0)
                                levels = 1;
diff -r 5c70680c1641 -r a52860ac0fdc lib/libc/db/btree/bt_delete.c
--- a/lib/libc/db/btree/bt_delete.c     Sat Sep 24 21:18:09 2016 +0000
+++ b/lib/libc/db/btree/bt_delete.c     Sat Sep 24 21:31:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_delete.c,v 1.18 2016/09/24 20:11:12 christos Exp $  */
+/*     $NetBSD: bt_delete.c,v 1.19 2016/09/24 21:31:25 christos Exp $  */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_delete.c,v 1.18 2016/09/24 20:11:12 christos Exp $");
+__RCSID("$NetBSD: bt_delete.c,v 1.19 2016/09/24 21:31:25 christos Exp $");
 
 #include "namespace.h"
 #include <sys/types.h>
@@ -96,7 +96,7 @@
                if (F_ISSET(c, CURS_INIT)) {
                        if (F_ISSET(c, CURS_ACQUIRE | CURS_AFTER | CURS_BEFORE))
                                return (RET_SPECIAL);
-                       if ((h = mpool_getf(t->bt_mp, c->pg.pgno, 0)) == NULL)
+                       if ((h = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL)
                                return (RET_ERROR);
 
                        /*
@@ -180,7 +180,7 @@
                /* Move up the stack. */
                for (level = 0; (parent = BT_POP(t)) != NULL; ++level) {
                        /* Get the parent page. */
-                       if ((h = mpool_getf(t->bt_mp, parent->pgno, 0)) == NULL)
+                       if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL)
                                return (1);
 
                        /* Move to the next index. */
@@ -203,12 +203,12 @@
                        mpool_put(t->bt_mp, h, 0);
 
                        /* Get the next level down. */
-                       if ((h = mpool_getf(t->bt_mp, pgno, 0)) == NULL)
+                       if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
                                return (1);
                        idx = 0;
                }
                mpool_put(t->bt_mp, h, 0);
-               if ((h = mpool_getf(t->bt_mp, nextpg, 0)) == NULL)
+               if ((h = mpool_get(t->bt_mp, nextpg, 0)) == NULL)
                        return (1);
        }
 
@@ -235,7 +235,7 @@
                /* Move up the stack. */
                for (level = 0; (parent = BT_POP(t)) != NULL; ++level) {
                        /* Get the parent page. */
-                       if ((h = mpool_getf(t->bt_mp, parent->pgno, 0)) == NULL)
+                       if ((h = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL)
                                return (1);
 
                        /* Move to the next index. */
@@ -257,20 +257,20 @@
                        mpool_put(t->bt_mp, h, 0);
 
                        /* Get the next level down. */
-                       if ((h = mpool_getf(t->bt_mp, pgno, 0)) == NULL)
+                       if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
                                return (1);
 
                        idx = NEXTINDEX(h) - 1;
                        BT_PUSH(t, pgno, idx);
                }
                mpool_put(t->bt_mp, h, 0);
-               if ((h = mpool_getf(t->bt_mp, prevpg, 0)) == NULL)
+               if ((h = mpool_get(t->bt_mp, prevpg, 0)) == NULL)
                        return (1);
        }
        
 
 ret:   mpool_put(t->bt_mp, h, 0);
-       return ((*hp = mpool_getf(t->bt_mp, c->pg.pgno, 0)) == NULL);
+       return ((*hp = mpool_get(t->bt_mp, c->pg.pgno, 0)) == NULL);
 }
 
 /*
@@ -393,7 +393,7 @@
         */
        while ((parent = BT_POP(t)) != NULL) {
                /* Get the parent page. */
-               if ((pg = mpool_getf(t->bt_mp, parent->pgno, 0)) == NULL)
+               if ((pg = mpool_get(t->bt_mp, parent->pgno, 0)) == NULL)
                        return (RET_ERROR);
                
                idx = parent->index;
@@ -576,7 +576,7 @@
                }
                /* Check previous key if at the beginning of the page. */
                if (idx == 0 && h->prevpg != P_INVALID) {
-                       if ((pg = mpool_getf(t->bt_mp, h->prevpg, 0)) == NULL)
+                       if ((pg = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL)
                                return (RET_ERROR);
                        e.page = pg;
                        e.index = NEXTINDEX(pg) - 1;
@@ -588,7 +588,7 @@
                }
                /* Check next key if at the end of the page. */
                if (idx == (unsigned)(NEXTINDEX(h) - 1) && h->nextpg != P_INVALID) {
-                       if ((pg = mpool_getf(t->bt_mp, h->nextpg, 0)) == NULL)
+                       if ((pg = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL)
                                return (RET_ERROR);
                        e.page = pg;
                        e.index = 0;
@@ -626,13 +626,13 @@
        PAGE *pg;
 
        if (h->nextpg != P_INVALID) {
-               if ((pg = mpool_getf(t->bt_mp, h->nextpg, 0)) == NULL)
+               if ((pg = mpool_get(t->bt_mp, h->nextpg, 0)) == NULL)
                        return (RET_ERROR);
                pg->prevpg = h->prevpg;
                mpool_put(t->bt_mp, pg, MPOOL_DIRTY);
        }
        if (h->prevpg != P_INVALID) {
-               if ((pg = mpool_getf(t->bt_mp, h->prevpg, 0)) == NULL)
+               if ((pg = mpool_get(t->bt_mp, h->prevpg, 0)) == NULL)
                        return (RET_ERROR);
                pg->nextpg = h->nextpg;
                mpool_put(t->bt_mp, pg, MPOOL_DIRTY);
diff -r 5c70680c1641 -r a52860ac0fdc lib/libc/db/btree/bt_open.c
--- a/lib/libc/db/btree/bt_open.c       Sat Sep 24 21:18:09 2016 +0000
+++ b/lib/libc/db/btree/bt_open.c       Sat Sep 24 21:31:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_open.c,v 1.28 2016/09/24 20:11:12 christos Exp $    */
+/*     $NetBSD: bt_open.c,v 1.29 2016/09/24 21:31:25 christos Exp $    */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_open.c,v 1.28 2016/09/24 20:11:12 christos Exp $");
+__RCSID("$NetBSD: bt_open.c,v 1.29 2016/09/24 21:31:25 christos Exp $");
 
 /*
  * Implementation of btree access method for 4.4BSD.
@@ -354,7 +354,7 @@
        PAGE *meta, *root;
        pgno_t npg;
 
-       if ((root = mpool_getf(t->bt_mp, 1, 0)) != NULL) {
+       if ((root = mpool_get(t->bt_mp, 1, 0)) != NULL) {
                if (root->lower == 0 &&
                    root->pgno == 0 &&
                    root->linp[0] == 0) {
diff -r 5c70680c1641 -r a52860ac0fdc lib/libc/db/btree/bt_overflow.c
--- a/lib/libc/db/btree/bt_overflow.c   Sat Sep 24 21:18:09 2016 +0000
+++ b/lib/libc/db/btree/bt_overflow.c   Sat Sep 24 21:31:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_overflow.c,v 1.21 2016/09/24 20:11:12 christos Exp $        */
+/*     $NetBSD: bt_overflow.c,v 1.22 2016/09/24 21:31:25 christos Exp $        */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -37,7 +37,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_overflow.c,v 1.21 2016/09/24 20:11:12 christos Exp $");
+__RCSID("$NetBSD: bt_overflow.c,v 1.22 2016/09/24 21:31:25 christos Exp $");
 
 #include "namespace.h"
 #include <sys/param.h>
@@ -112,7 +112,7 @@
        _DBFIT(temp, uint32_t);
        plen = (uint32_t)temp;
        for (p = *buf;; p = (char *)p + nb, pg = h->nextpg) {
-               if ((h = mpool_getf(t->bt_mp, pg, 0)) == NULL)
+               if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
                        return (RET_ERROR);
 
                nb = MIN(sz, plen);
@@ -208,7 +208,7 @@
        if (pg == P_INVALID || sz == 0)
                abort();
 #endif
-       if ((h = mpool_getf(t->bt_mp, pg, 0)) == NULL)
+       if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
                return (RET_ERROR);
 
        /* Don't delete chains used by internal pages. */
@@ -226,7 +226,7 @@
                __bt_free(t, h);
                if (sz <= plen)
                        break;
-               if ((h = mpool_getf(t->bt_mp, pg, 0)) == NULL)
+               if ((h = mpool_get(t->bt_mp, pg, 0)) == NULL)
                        return (RET_ERROR);
        }
        return (RET_SUCCESS);
diff -r 5c70680c1641 -r a52860ac0fdc lib/libc/db/btree/bt_page.c
--- a/lib/libc/db/btree/bt_page.c       Sat Sep 24 21:18:09 2016 +0000
+++ b/lib/libc/db/btree/bt_page.c       Sat Sep 24 21:31:25 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bt_page.c,v 1.14 2016/09/24 20:11:12 christos Exp $    */
+/*     $NetBSD: bt_page.c,v 1.15 2016/09/24 21:31:25 christos Exp $    */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: bt_page.c,v 1.14 2016/09/24 20:11:12 christos Exp $");
+__RCSID("$NetBSD: bt_page.c,v 1.15 2016/09/24 21:31:25 christos Exp $");
 
 #include "namespace.h"
 #include <sys/types.h>
@@ -89,7 +89,7 @@
        PAGE *h;



Home | Main Index | Thread Index | Old Index