From owner-dev-commits-src-all@freebsd.org Mon Jun 28 22:24:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6AB0465DB23; Mon, 28 Jun 2021 22:24:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GDMbH5p00z4jxN; Mon, 28 Jun 2021 22:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A76CB56F6; Mon, 28 Jun 2021 22:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 15SMOBxf048948; Mon, 28 Jun 2021 22:24:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15SMOBYn048947; Mon, 28 Jun 2021 22:24:11 GMT (envelope-from git) Date: Mon, 28 Jun 2021 22:24:11 GMT Message-Id: <202106282224.15SMOBYn048947@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 50aa1daf1468 - main - cam: change xpt_clone_path to return int MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50aa1daf14688a6f85f324a8efa8708a25b46a86 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 22:24:12 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=50aa1daf14688a6f85f324a8efa8708a25b46a86 commit 50aa1daf14688a6f85f324a8efa8708a25b46a86 Author: Warner Losh AuthorDate: 2021-06-28 22:04:02 +0000 Commit: Warner Losh CommitDate: 2021-06-28 22:13:03 +0000 cam: change xpt_clone_path to return int xpt_clone_path originally returned a cam_status, but it doesn't do I/O and should return an errno instead. I added it last year and it's only used in one place. It's not yet documented, so no doc changes are nneeded. Reviewed by: scottl@, mav@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30884 --- sys/cam/cam_xpt.c | 8 ++++---- sys/cam/cam_xpt.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 016f0e6a38be..b76d6f5adde7 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -3669,14 +3669,14 @@ xpt_compile_path(struct cam_path *new_path, struct cam_periph *perph, return (status); } -cam_status +int xpt_clone_path(struct cam_path **new_path_ptr, struct cam_path *path) { struct cam_path *new_path; new_path = (struct cam_path *)malloc(sizeof(*path), M_CAMPATH, M_NOWAIT); if (new_path == NULL) - return(CAM_RESRC_UNAVAIL); + return (ENOMEM); *new_path = *path; if (path->bus != NULL) xpt_acquire_bus(path->bus); @@ -3685,7 +3685,7 @@ xpt_clone_path(struct cam_path **new_path_ptr, struct cam_path *path) if (path->device != NULL) xpt_acquire_device(path->device); *new_path_ptr = new_path; - return (CAM_REQ_CMP); + return (0); } void @@ -4397,7 +4397,7 @@ xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg) return; } - if (xpt_clone_path(&ccb->ccb_h.path, path) != CAM_REQ_CMP) { + if (xpt_clone_path(&ccb->ccb_h.path, path) != 0) { xpt_print(path, "Can't allocate path to send %s\n", xpt_async_string(async_code)); xpt_free_ccb(ccb); diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index c8494d04234a..b75025dbd4d3 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -138,7 +138,7 @@ cam_status xpt_compile_path(struct cam_path *new_path, path_id_t path_id, target_id_t target_id, lun_id_t lun_id); -cam_status xpt_clone_path(struct cam_path **new_path, +int xpt_clone_path(struct cam_path **new_path, struct cam_path *path); void xpt_release_path(struct cam_path *path);