~yolanda.robla/ubuntu/trusty/memcached/add_distribution

« back to all changes in this revision

Viewing changes to items.c

  • Committer: Bazaar Package Importer
  • Author(s): David Martínez Moreno
  • Date: 2010-05-12 11:41:22 UTC
  • mfrom: (1.1.7 upstream) (3.3.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100512114122-e2dphwiezevuny1t
Tags: 1.4.5-1
* New upstream release.  Main changes since 1.4.2 are:
  New features:
  - Support for SASL authentication.
  - New script damemtop - a memcached top.
  - Slab optimizations.
  - New stats, for reclaimed memory and SASL events.
  Bugs fixed:
  - Malicious input can crash server (CVE-2010-1152).  Closes: #579913.
  - Fixed several problems with slab handling and growth.
  - Provide better error reporting.
  - Fix get stats accounting.
  - Fixed backwards compatibility with delete 0.
  - Documentation fixes.
  - Various build fixes, among others, fixed FTBFS with gcc-4.5 (closes:
    #565033).
* Refreshed and renamed 01_init_script_compliant_with_LSB.patch.
* Fixed lintian warnings by adding $remote_fs to init.d script.
* Removed non-existent document (doc/memory_management.txt).
* debian/control: Bumped Standards-Version to 3.8.4 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    unsigned int evicted;
30
30
    unsigned int evicted_nonzero;
31
31
    rel_time_t evicted_time;
 
32
    unsigned int reclaimed;
32
33
    unsigned int outofmemory;
33
34
    unsigned int tailrepairs;
34
35
} itemstats_t;
108
109
            /* I don't want to actually free the object, just steal
109
110
             * the item to avoid to grab the slab mutex twice ;-)
110
111
             */
 
112
            STATS_LOCK();
 
113
            stats.reclaimed++;
 
114
            STATS_UNLOCK();
 
115
            itemstats[id].reclaimed++;
111
116
            it->refcount = 1;
112
117
            do_item_unlink(it);
113
118
            /* Initialize the item block: */
155
160
                    STATS_LOCK();
156
161
                    stats.evictions++;
157
162
                    STATS_UNLOCK();
 
163
                } else {
 
164
                    itemstats[id].reclaimed++;
 
165
                    STATS_LOCK();
 
166
                    stats.reclaimed++;
 
167
                    STATS_UNLOCK();
158
168
                }
159
169
                do_item_unlink(search);
160
170
                break;
277
287
int do_item_link(item *it) {
278
288
    MEMCACHED_ITEM_LINK(ITEM_key(it), it->nkey, it->nbytes);
279
289
    assert((it->it_flags & (ITEM_LINKED|ITEM_SLABBED)) == 0);
280
 
    assert(it->nbytes < (1024 * 1024));  /* 1MB max size */
281
290
    it->it_flags |= ITEM_LINKED;
282
291
    it->time = current_time;
283
292
    assoc_insert(it);
405
414
                                "%u", itemstats[i].outofmemory);
406
415
            APPEND_NUM_FMT_STAT(fmt, i, "tailrepairs",
407
416
                                "%u", itemstats[i].tailrepairs);;
 
417
            APPEND_NUM_FMT_STAT(fmt, i, "reclaimed",
 
418
                                "%u", itemstats[i].reclaimed);;
408
419
        }
409
420
    }
410
421