kernel - remove extra tsleep_interlock() calo
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 15 Apr 2011 15:27:19 +0000 (08:27 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 15 Apr 2011 15:27:19 +0000 (08:27 -0700)
* Remove an extra tsleep_interlock() call that slipped into the
  tsleep() code.

sys/kern/vfs_bio.c

index 862f823..1b22180 100644 (file)
@@ -928,6 +928,10 @@ breadcb(struct vnode *vp, off_t loffset, int size,
                BUF_KERNPROC(bp);
                vn_strategy(vp, &bp->b_bio1);
        } else if (func) {
+               /*
+                * Since we are issuing the callback synchronously it cannot
+                * race the BIO_DONE, so no need for atomic ops here.
+                */
                /*bp->b_bio1.bio_done = func;*/
                bp->b_bio1.bio_caller_info1.ptr = arg;
                bp->b_bio1.bio_flags |= BIO_DONE;
@@ -3602,7 +3606,6 @@ _biowait(struct bio *bio, const char *wmesg, int to)
                flags = bio->bio_flags;
                if (flags & BIO_DONE)
                        break;
-               tsleep_interlock(bio, 0);
                nflags = flags | BIO_WANT;
                tsleep_interlock(bio, 0);
                if (atomic_cmpset_int(&bio->bio_flags, flags, nflags)) {