Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2024 05:13:29 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4eee292ab663 - main - Revert "cam: better ioctl compatibility for cd"
Message-ID:  <202407250513.46P5DTLp082673@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=4eee292ab66316c01bae887e6d5a3468e1c27e77

commit 4eee292ab66316c01bae887e6d5a3468e1c27e77
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2024-07-25 05:03:41 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-07-25 05:09:57 +0000

    Revert "cam: better ioctl compatibility for cd"
    
    This reverts commit 028b16e2088a682c1abfb74fa5eb7ff64405ffff.
    
    The wrong version wound up in my branch, revert while I find the right
    version.
    
    Sponsored by:           Netflix
---
 sys/cam/cam_compat.c |  6 ------
 sys/cam/cam_periph.c | 22 +---------------------
 2 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/sys/cam/cam_compat.c b/sys/cam/cam_compat.c
index 896b071f86dc..fdb4ee8717ec 100644
--- a/sys/cam/cam_compat.c
+++ b/sys/cam/cam_compat.c
@@ -49,12 +49,6 @@
 
 #include <cam/scsi/scsi_pass.h>
 
-/*
- * Note: struct cdev *dev parameter here is simply passed through. For cdioctl
- * we need to pass down a struct periph * which has been cast to a cdev and that
- * is cast back again in cdioctl_dev().
- */
-
 static int cam_compat_handle_0x17(struct cdev *dev, u_long cmd, caddr_t addr,
     int flag, struct thread *td, d_ioctl_t *cbfnp);
 static int cam_compat_handle_0x18(struct cdev *dev, u_long cmd, caddr_t addr,
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index ed90ef91abce..e957edee67f1 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -1122,20 +1122,6 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo)
 	return (error);
 }
 
-static int
-cam_periph_ioctl_compat(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
-{
-	struct cam_periph *periph;
-
-	/*
-	 * For compat, we need to cast struct periph * into struct cdev *dev and
-	 * then back again.
-	 */
-	periph = (struct cam_periph *)(void *)dev;
-	cam_periph_assert(periph, MA_OWNED);
-	return (cam_periph_ioctl(periph, cmd, addr, cderror));
-}
-
 int
 cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr,
 		 int (*error_routine)(union ccb *ccb, 
@@ -1192,13 +1178,7 @@ cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr,
 
 		break;
 	default:
-		/*
-		 * We assume that the compat layer doesn't care about
-		 * the dev parameter. It just passes it through, so
-		 * cheat a little.
-		 */
-		error = cam_compat_ioctl((struct cdev *)(void *)periph,
-		    cmd, addr, flag, td, cam_periph_ioctl_compat);
+		error = ENOTTY;
 		break;
 	}
 	return(error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407250513.46P5DTLp082673>