]> git.pld-linux.org Git - packages/db.git/blob - db-rpm.patch
- db.spec... there can be only one
[packages/db.git] / db-rpm.patch
1 Index: db/hash/hash_dup.c
2 ===================================================================
3 RCS file: /cvs/devel/rpm/db/hash/hash_dup.c,v
4 retrieving revision 1.1.1.2.2.3
5 retrieving revision 1.1.1.2.2.4
6 diff -u -1 -0 -r1.1.1.2.2.3 -r1.1.1.2.2.4
7 --- db/hash/hash_dup.c  2002/01/08 04:07:30     1.1.1.2.2.3
8 +++ db/hash/hash_dup.c  2002/02/13 23:22:52     1.1.1.2.2.4
9 @@ -606,20 +606,25 @@
10             PGNO(next_pagep), NUM_ENT(next_pagep) - 2)) != 0)
11                 goto out;
12  
13         /* Now delete the pair from the current page. */
14         ret = __ham_del_pair(dbc, 0);
15  
16         /*
17          * __ham_del_pair decremented nelem.  This is incorrect;  we
18          * manually copied the element elsewhere, so the total number
19          * of elements hasn't changed.  Increment it again.
20 +        *
21 +        * !!!
22 +        * Note that we still have the metadata page pinned, and
23 +        * __ham_del_pair dirtied it, so we don't need to set the dirty
24 +        * flag again.
25          */
26         if (!STD_LOCKING(dbc))
27                 hcp->hdr->nelem++;
28  
29  out:
30         (void)mpf->put(mpf, hcp->page, DB_MPOOL_DIRTY);
31         hcp->page = next_pagep;
32         hcp->pgno = PGNO(hcp->page);
33         hcp->indx = NUM_ENT(hcp->page) - 2;
34         F_SET(hcp, H_EXPAND);
35 Index: db/hash/hash_page.c
36 ===================================================================
37 RCS file: /cvs/devel/rpm/db/hash/hash_page.c,v
38 retrieving revision 1.1.1.2.2.3
39 retrieving revision 1.1.1.2.2.4
40 diff -u -1 -0 -r1.1.1.2.2.3 -r1.1.1.2.2.4
41 --- db/hash/hash_page.c 2002/01/08 04:07:30     1.1.1.2.2.3
42 +++ db/hash/hash_page.c 2002/02/13 23:22:52     1.1.1.2.2.4
43 @@ -636,22 +636,25 @@
44         if ((ret = __ham_c_update(dbc, 0, 0, 0)) != 0)
45                 return (ret);
46  
47         /*
48          * If we are locking, we will not maintain this, because it is
49          * a hot spot.
50          *
51          * XXX
52          * Perhaps we can retain incremental numbers and apply them later.
53          */
54 -       if (!STD_LOCKING(dbc))
55 +       if (!STD_LOCKING(dbc)) {
56                 --hcp->hdr->nelem;
57 +               if ((ret = __ham_dirty_meta(dbc)) != 0)
58 +                       return (ret);
59 +       }
60  
61         /*
62          * If we need to reclaim the page, then check if the page is empty.
63          * There are two cases.  If it's empty and it's not the first page
64          * in the bucket (i.e., the bucket page) then we can simply remove
65          * it. If it is the first chain in the bucket, then we need to copy
66          * the second page into it and remove the second page.
67          * If its the only page in the bucket we leave it alone.
68          */
69         if (!reclaim_page ||
70 @@ -1407,22 +1410,25 @@
71          * next time we come in here.  For other operations, this shouldn't
72          * matter, since odds are this is the last thing that happens before
73          * we return to the user program.
74          */
75         hcp->pgno = PGNO(hcp->page);
76  
77         /*
78          * XXX
79          * Maybe keep incremental numbers here.
80          */
81 -       if (!STD_LOCKING(dbc))
82 +       if (!STD_LOCKING(dbc)) {
83                 hcp->hdr->nelem++;
84 +               if ((ret = __ham_dirty_meta(dbc)) != 0)
85 +                       return (ret);
86 +       }
87  
88         if (do_expand || (hcp->hdr->ffactor != 0 &&
89             (u_int32_t)H_NUMPAIRS(hcp->page) > hcp->hdr->ffactor))
90                 F_SET(hcp, H_EXPAND);
91         return (0);
92  }
93  
94  /*
95   * Special __putitem call used in splitting -- copies one entry to
96   * another.  Works for all types of hash entries (H_OFFPAGE, H_KEYDATA,
This page took 0.077929 seconds and 3 git commands to generate.