]> granicus.if.org Git - zfs/commitdiff
Refresh gcc-uninit branch
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Dec 2008 17:13:58 +0000 (09:13 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Dec 2008 17:13:58 +0000 (09:13 -0800)
1  2 
zfs/lib/libzfs/libzfs_dataset.c
zfs/lib/libzpool/arc.c
zfs/lib/libzpool/dsl_dataset.c
zfs/lib/libzpool/lzjb.c
zfs/lib/libzpool/refcount.c
zfs/lib/libzpool/spa.c
zfs/lib/libzpool/vdev_raidz.c
zfs/lib/libzpool/zap_leaf.c
zfs/lib/libzpool/zfs_byteswap.c

Simple merge
index 2adfc2c8d11cbe93a9aca76043eb35d97074d7fa,73aecb2852d5282d1c1c9551ee0e51ba50a612b4..bd567c1c50f4198c01c10c18a237f9b251155589
@@@ -2386,14 -2422,38 +2422,38 @@@ arc_read_done(zio_t *zio
   *
   * arc_read_done() will invoke all the requested "done" functions
   * for readers of this block.
+  *
+  * Normal callers should use arc_read and pass the arc buffer and offset
+  * for the bp.  But if you know you don't need locking, you can use
+  * arc_read_bp.
   */
  int
- arc_read(zio_t *pio, spa_t *spa, blkptr_t *bp, arc_byteswap_func_t *swap,
-     arc_done_func_t *done, void *private, int priority, int flags,
-     uint32_t *arc_flags, zbookmark_t *zb)
+ arc_read(zio_t *pio, spa_t *spa, blkptr_t *bp, arc_buf_t *pbuf,
+     arc_done_func_t *done, void *private, int priority, int zio_flags,
+     uint32_t *arc_flags, const zbookmark_t *zb)
+ {
+       int err;
+       arc_buf_hdr_t *hdr = pbuf->b_hdr;
+       ASSERT(!refcount_is_zero(&pbuf->b_hdr->b_refcnt));
+       ASSERT3U((char *)bp - (char *)pbuf->b_data, <, pbuf->b_hdr->b_size);
+       rw_enter(&pbuf->b_lock, RW_READER);
+       err = arc_read_nolock(pio, spa, bp, done, private, priority,
+           zio_flags, arc_flags, zb);
+       ASSERT3P(hdr, ==, pbuf->b_hdr);
+       rw_exit(&pbuf->b_lock);
+       return (err);
+ }
+ int
+ arc_read_nolock(zio_t *pio, spa_t *spa, blkptr_t *bp,
+     arc_done_func_t *done, void *private, int priority, int zio_flags,
+     uint32_t *arc_flags, const zbookmark_t *zb)
  {
        arc_buf_hdr_t *hdr;
 -      arc_buf_t *buf;
 +      arc_buf_t *buf = NULL;
        kmutex_t *hash_lock;
        zio_t *rzio;
  
@@@ -2764,13 -2833,17 +2833,17 @@@ arc_buf_evict(arc_buf_t *buf
  void
  arc_release(arc_buf_t *buf, void *tag)
  {
-       arc_buf_hdr_t *hdr = buf->b_hdr;
-       kmutex_t *hash_lock = HDR_LOCK(hdr);
-       l2arc_buf_hdr_t *l2hdr = NULL;
+       arc_buf_hdr_t *hdr;
+       kmutex_t *hash_lock;
+       l2arc_buf_hdr_t *l2hdr;
 -      uint64_t buf_size;
 +      uint64_t buf_size = 0;
  
+       rw_enter(&buf->b_lock, RW_WRITER);
+       hdr = buf->b_hdr;
        /* this buffer is not on any list */
        ASSERT(refcount_count(&hdr->b_refcnt) > 0);
+       ASSERT(!(hdr->b_flags & ARC_STORED));
  
        if (hdr->b_state == arc_anon) {
                /* this buffer is already released */
@@@ -3856,17 -4050,13 +4050,14 @@@ l2arc_write_buffers(spa_t *spa, l2arc_d
        arc_buf_hdr_t *ab, *ab_prev, *head;
        l2arc_buf_hdr_t *hdrl2;
        list_t *list;
-       uint64_t passed_sz, write_sz, buf_sz;
-       uint64_t target_sz = dev->l2ad_write;
-       uint64_t headroom = dev->l2ad_write * l2arc_headroom;
+       uint64_t passed_sz, write_sz, buf_sz, headroom;
        void *buf_data;
 -      kmutex_t *hash_lock, *list_lock;
 +      kmutex_t *hash_lock, *list_lock = NULL;
        boolean_t have_lock, full;
        l2arc_write_callback_t *cb;
        zio_t *pio, *wzio;
 +      int try;
  
-       ASSERT(MUTEX_HELD(&l2arc_dev_mtx));
        ASSERT(dev->l2ad_vdev != NULL);
  
        pio = NULL;
Simple merge
Simple merge
Simple merge
index 136d0874eac4670cf3ea9912b453398fc7a11c06,fb1b96f8b811754e4f4d524977a629ce9f7834f3..a24c281e22fca174421247fac77a4ca7d5a35e01
@@@ -799,10 -816,12 +816,12 @@@ spa_load_l2cache(spa_t *spa
        nvlist_t **l2cache;
        uint_t nl2cache;
        int i, j, oldnvdevs;
-       uint64_t guid;
+       uint64_t guid, size;
 -      vdev_t *vd, **oldvdevs, **newvdevs;
 +      vdev_t *vd, **oldvdevs, **newvdevs = NULL;
        spa_aux_vdev_t *sav = &spa->spa_l2cache;
  
+       ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL);
        if (sav->sav_config != NULL) {
                VERIFY(nvlist_lookup_nvlist_array(sav->sav_config,
                    ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0);
@@@ -2827,7 -3006,8 +3006,8 @@@ spa_vdev_detach(spa_t *spa, uint64_t gu
        vdev_t *rvd = spa->spa_root_vdev;
        vdev_t *vd, *pvd, *cvd, *tvd;
        boolean_t unspare = B_FALSE;
 -      uint64_t unspare_guid;
 +      uint64_t unspare_guid = 0;
+       size_t len;
  
        txg = spa_vdev_enter(spa);
  
Simple merge
Simple merge
Simple merge