Remove pointless lun->be_lun checks.

There is no such thing as LUN without backend, at least for years.

MFC after:	1 week
This commit is contained in:
Alexander Motin 2021-02-25 19:45:59 -05:00
parent aac25e2225
commit a9bd22814f
3 changed files with 11 additions and 14 deletions

View File

@ -11022,16 +11022,15 @@ ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io,
return (CTL_ACTION_BLOCK);
case CTL_SER_EXTENT:
return (ctl_extent_check(ooa_io, pending_io,
(lun->be_lun && lun->be_lun->serseq == CTL_LUN_SERSEQ_ON)));
(lun->be_lun->serseq == CTL_LUN_SERSEQ_ON)));
case CTL_SER_EXTENTOPT:
if ((lun->MODE_CTRL.queue_flags & SCP_QUEUE_ALG_MASK) !=
SCP_QUEUE_ALG_UNRESTRICTED)
return (ctl_extent_check(ooa_io, pending_io,
(lun->be_lun &&
lun->be_lun->serseq == CTL_LUN_SERSEQ_ON)));
(lun->be_lun->serseq == CTL_LUN_SERSEQ_ON)));
return (CTL_ACTION_PASS);
case CTL_SER_EXTENTSEQ:
if (lun->be_lun && lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF)
if (lun->be_lun->serseq != CTL_LUN_SERSEQ_OFF)
return (ctl_extent_check_seq(ooa_io, pending_io));
return (CTL_ACTION_PASS);
case CTL_SER_PASS:
@ -11273,8 +11272,7 @@ ctl_scsiio_lun_check(struct ctl_lun *lun,
}
if (entry->pattern & CTL_LUN_PAT_WRITE) {
if (lun->be_lun &&
lun->be_lun->flags & CTL_LUN_FLAG_READONLY) {
if (lun->be_lun->flags & CTL_LUN_FLAG_READONLY) {
ctl_set_hw_write_protected(ctsio);
retval = 1;
goto bailout;
@ -13303,8 +13301,7 @@ ctl_serseq_done(union ctl_io *io)
{
struct ctl_lun *lun = CTL_LUN(io);
if (lun->be_lun == NULL ||
lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF)
if (lun->be_lun->serseq == CTL_LUN_SERSEQ_OFF)
return;
mtx_lock(&lun->lun_lock);
io->io_hdr.flags |= CTL_FLAG_SERSEQ_DONE;

View File

@ -759,12 +759,12 @@ tpc_resolve(struct tpc_list *list, uint16_t idx, uint32_t *ss,
{
if (idx == 0xffff) {
if (ss && list->lun->be_lun)
if (ss)
*ss = list->lun->be_lun->blocksize;
if (pb && list->lun->be_lun)
if (pb)
*pb = list->lun->be_lun->blocksize <<
list->lun->be_lun->pblockexp;
if (pbo && list->lun->be_lun)
if (pbo)
*pbo = list->lun->be_lun->blocksize *
list->lun->be_lun->pblockoff;
return (list->lun->lun);

View File

@ -294,12 +294,12 @@ tpcl_resolve(struct ctl_softc *softc, int init_port,
lun->lun_devid->len, &cscdid->codeset,
cscdid->length + 4) == 0) {
lunid = lun->lun;
if (ss && lun->be_lun)
if (ss)
*ss = lun->be_lun->blocksize;
if (ps && lun->be_lun)
if (ps)
*ps = lun->be_lun->blocksize <<
lun->be_lun->pblockexp;
if (pso && lun->be_lun)
if (pso)
*pso = lun->be_lun->blocksize *
lun->be_lun->pblockoff;
break;