Lines 1363-1369
__zvol_create_minor(const char *name, boolean_t ignore_snapdev)
Link Here
|
1363 |
zv->zv_volsize = volsize; |
1363 |
zv->zv_volsize = volsize; |
1364 |
zv->zv_objset = os; |
1364 |
zv->zv_objset = os; |
1365 |
|
1365 |
|
1366 |
set_capacity(zv->zv_disk, zv->zv_volsize >> 9); |
1366 |
set_capacity(zv->zv_disk, 0); |
1367 |
|
1367 |
|
1368 |
blk_queue_max_hw_sectors(zv->zv_queue, UINT_MAX); |
1368 |
blk_queue_max_hw_sectors(zv->zv_queue, UINT_MAX); |
1369 |
blk_queue_max_segments(zv->zv_queue, UINT16_MAX); |
1369 |
blk_queue_max_segments(zv->zv_queue, UINT16_MAX); |
Lines 1397-1402
out:
Link Here
|
1397 |
if (error == 0) { |
1397 |
if (error == 0) { |
1398 |
zvol_insert(zv); |
1398 |
zvol_insert(zv); |
1399 |
add_disk(zv->zv_disk); |
1399 |
add_disk(zv->zv_disk); |
|
|
1400 |
/* You must set_capacity() to 0 unless calling setcapacity() *after* |
1401 |
you call add_disk(), according to these references: |
1402 |
http://osdir.com/ml/linux.enbd.general/2002-10/msg00176.html |
1403 |
http://osdir.com/ml/linux.enbd.general/2002-10/msg00177.html |
1404 |
http://stackoverflow.com/questions/13518404/add-disk-hangs-on-insmod */ |
1405 |
set_capacity(zv->zv_disk, zv->zv_volsize >> 9); |
1400 |
} |
1406 |
} |
1401 |
|
1407 |
|
1402 |
return (error); |
1408 |
return (error); |