Date: Fri, 5 Mar 2021 00:53:55 GMT From: Alexander Motin <mav@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 5ea5c72f5226 - stable/13 - Remove pointless lun->be_lun checks. Message-ID: <202103050053.1250rtTO024178@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea5c72f5226a5d06e6e994ab45f889030f35fa4 commit 5ea5c72f5226a5d06e6e994ab45f889030f35fa4 Author: Alexander Motin <mav@FreeBSD.org> AuthorDate: 2021-02-26 00:45:59 +0000 Commit: Alexander Motin <mav@FreeBSD.org> CommitDate: 2021-03-05 00:53:53 +0000 Remove pointless lun->be_lun checks. There is no such thing as LUN without backend, at least for years. MFC after: 1 week (cherry picked from commit a9bd22814f680ce87259d56155204f9294e684ce) --- sys/cam/ctl/ctl.c | 13 +++++-------- sys/cam/ctl/ctl_tpc.c | 6 +++--- sys/cam/ctl/ctl_tpc_local.c | 6 +++--- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 37962eb3522c..bb8fbf910857 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -11023,16 +11023,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: @@ -11276,8 +11275,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; @@ -13269,8 +13267,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; diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c index 456157749c89..d63435b38762 100644 --- a/sys/cam/ctl/ctl_tpc.c +++ b/sys/cam/ctl/ctl_tpc.c @@ -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); diff --git a/sys/cam/ctl/ctl_tpc_local.c b/sys/cam/ctl/ctl_tpc_local.c index 714240fe8228..c2d628033037 100644 --- a/sys/cam/ctl/ctl_tpc_local.c +++ b/sys/cam/ctl/ctl_tpc_local.c @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103050053.1250rtTO024178>