Skip to content

Commit

Permalink
Remove wholedisk check from vdev_disk_open()
Browse files Browse the repository at this point in the history
As described by the comment and enforced the by assertion the
v->vdev_wholedisk will never be -1.  The wholedisk handling
is performed by the user space utilities.  To prevent confusion
this dead code is being removed.

Signed-off-by: Brian Behlendorf <[email protected]>
  • Loading branch information
behlendorf committed Feb 28, 2013
1 parent 0d8103d commit bd99a75
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions module/zfs/vdev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,20 +294,6 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize,
/* Determine the physical block size */
block_size = vdev_bdev_block_size(vd->vd_bdev);

/* We think the wholedisk property should always be set when this
* function is called. ASSERT here so if any legitimate cases exist
* where it's not set, we'll find them during debugging. If we never
* hit the ASSERT, this and the following conditional statement can be
* removed. */
ASSERT3S(v->vdev_wholedisk, !=, -1ULL);

/* The wholedisk property was initialized to -1 in vdev_alloc() if it
* was unspecified. In that case, check if this is a whole device.
* When bdev->bd_contains == bdev we have a whole device and not simply
* a partition. */
if (v->vdev_wholedisk == -1ULL)
v->vdev_wholedisk = (bdev->bd_contains == bdev);

/* Clear the nowritecache bit, causes vdev_reopen() to try again. */
v->vdev_nowritecache = B_FALSE;

Expand Down

0 comments on commit bd99a75

Please sign in to comment.