Sat Apr 11 02:33:16 2015 UTC ()
Reduce diff from upstream a little.


(riastradh)
diff -r1.2 -r1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c

cvs diff -r1.2 -r1.3 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c (expand / switch to unified diff)

--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c 2012/10/15 14:15:59 1.2
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c 2015/04/11 02:33:16 1.3
@@ -480,31 +480,30 @@ zfs_range_lock(znode_t *zp, uint64_t off @@ -480,31 +480,30 @@ zfs_range_lock(znode_t *zp, uint64_t off
480 new->r_type = type; 480 new->r_type = type;
481 new->r_proxy = B_FALSE; 481 new->r_proxy = B_FALSE;
482 cv_init(&new->r_wr_cv, NULL, CV_DEFAULT, NULL); 482 cv_init(&new->r_wr_cv, NULL, CV_DEFAULT, NULL);
483 cv_init(&new->r_rd_cv, NULL, CV_DEFAULT, NULL); 483 cv_init(&new->r_rd_cv, NULL, CV_DEFAULT, NULL);
484 new->r_write_wanted = B_FALSE; 484 new->r_write_wanted = B_FALSE;
485 new->r_read_wanted = B_FALSE; 485 new->r_read_wanted = B_FALSE;
486 new->r_refcnt = 1; 486 new->r_refcnt = 1;
487 487
488 mutex_enter(&zp->z_range_lock); 488 mutex_enter(&zp->z_range_lock);
489 if (type == RL_READER) { 489 if (type == RL_READER) {
490 /* 490 /*
491 * First check for the usual case of no locks 491 * First check for the usual case of no locks
492 */ 492 */
493 if (avl_numnodes(&zp->z_range_avl) == 0) { 493 if (avl_numnodes(&zp->z_range_avl) == 0)
494 avl_add(&zp->z_range_avl, new); 494 avl_add(&zp->z_range_avl, new);
495 } else { 495 else
496 zfs_range_lock_reader(zp, new); 496 zfs_range_lock_reader(zp, new);
497 } 
498 } else { 497 } else {
499 zfs_range_lock_writer(zp, new); /* RL_WRITER or RL_APPEND */ 498 zfs_range_lock_writer(zp, new); /* RL_WRITER or RL_APPEND */
500 } 499 }
501 mutex_exit(&zp->z_range_lock); 500 mutex_exit(&zp->z_range_lock);
502 return (new); 501 return (new);
503} 502}
504 503
505/* 504/*
506 * Unlock a reader lock 505 * Unlock a reader lock
507 */ 506 */
508static void 507static void
509zfs_range_unlock_reader(znode_t *zp, rl_t *remove) 508zfs_range_unlock_reader(znode_t *zp, rl_t *remove)
510{ 509{