Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 177010 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/lib/libzpool/dbuf.c (-13 lines)
Lines 540-546 Link Here
540
{
540
{
541
	int err = 0;
541
	int err = 0;
542
	int havepzio = (zio != NULL);
542
	int havepzio = (zio != NULL);
543
	int prefetch;
544
543
545
	/*
544
	/*
546
	 * We don't have to hold the mutex to check db_state because it
545
	 * We don't have to hold the mutex to check db_state because it
Lines 551-565 Link Here
551
	if ((flags & DB_RF_HAVESTRUCT) == 0)
550
	if ((flags & DB_RF_HAVESTRUCT) == 0)
552
		rw_enter(&db->db_dnode->dn_struct_rwlock, RW_READER);
551
		rw_enter(&db->db_dnode->dn_struct_rwlock, RW_READER);
553
552
554
	prefetch = db->db_level == 0 && db->db_blkid != DB_BONUS_BLKID &&
555
	    (flags & DB_RF_NOPREFETCH) == 0 && db->db_dnode != NULL;
556
557
	mutex_enter(&db->db_mtx);
553
	mutex_enter(&db->db_mtx);
558
	if (db->db_state == DB_CACHED) {
554
	if (db->db_state == DB_CACHED) {
559
		mutex_exit(&db->db_mtx);
555
		mutex_exit(&db->db_mtx);
560
		if (prefetch)
561
			dmu_zfetch(&db->db_dnode->dn_zfetch, db->db.db_offset,
562
			    db->db.db_size, TRUE);
563
		if ((flags & DB_RF_HAVESTRUCT) == 0)
556
		if ((flags & DB_RF_HAVESTRUCT) == 0)
564
			rw_exit(&db->db_dnode->dn_struct_rwlock);
557
			rw_exit(&db->db_dnode->dn_struct_rwlock);
565
	} else if (db->db_state == DB_UNCACHED) {
558
	} else if (db->db_state == DB_UNCACHED) {
Lines 571-579 Link Here
571
564
572
		/* dbuf_read_impl has dropped db_mtx for us */
565
		/* dbuf_read_impl has dropped db_mtx for us */
573
566
574
		if (prefetch)
575
			dmu_zfetch(&db->db_dnode->dn_zfetch, db->db.db_offset,
576
			    db->db.db_size, flags & DB_RF_CACHED);
577
567
578
		if ((flags & DB_RF_HAVESTRUCT) == 0)
568
		if ((flags & DB_RF_HAVESTRUCT) == 0)
579
			rw_exit(&db->db_dnode->dn_struct_rwlock);
569
			rw_exit(&db->db_dnode->dn_struct_rwlock);
Lines 582-590 Link Here
582
			err = zio_wait(zio);
572
			err = zio_wait(zio);
583
	} else {
573
	} else {
584
		mutex_exit(&db->db_mtx);
574
		mutex_exit(&db->db_mtx);
585
		if (prefetch)
586
			dmu_zfetch(&db->db_dnode->dn_zfetch, db->db.db_offset,
587
			    db->db.db_size, TRUE);
588
		if ((flags & DB_RF_HAVESTRUCT) == 0)
575
		if ((flags & DB_RF_HAVESTRUCT) == 0)
589
			rw_exit(&db->db_dnode->dn_struct_rwlock);
576
			rw_exit(&db->db_dnode->dn_struct_rwlock);
590
577

Return to bug 177010