diff options
author | gd78059 <none@none> | 2008-06-10 21:52:10 -0700 |
---|---|---|
committer | gd78059 <none@none> | 2008-06-10 21:52:10 -0700 |
commit | 5d6f713392c74cdb8e14540e84814ee02f403a3c (patch) | |
tree | 9b05ec66ef5dbb4d9edb862545b94817ce87ae24 | |
parent | 900dc3b320eec007f1b55658b4ba98c3cf5d3736 (diff) | |
download | illumos-gate-5d6f713392c74cdb8e14540e84814ee02f403a3c.tar.gz |
PSARC 2008/348 Widening IOCPARM_MASK
PSARC 2008/367 Remove MAXIOCBSZ
6711665 Widen IOCPARM_MASK to 0x1fff
6711691 Remove MAXIOCBSZ logic
-rw-r--r-- | usr/src/uts/common/os/strsubr.c | 28 | ||||
-rw-r--r-- | usr/src/uts/common/sys/ioccom.h | 13 | ||||
-rw-r--r-- | usr/src/uts/common/sys/stream.h | 5 |
3 files changed, 17 insertions, 29 deletions
diff --git a/usr/src/uts/common/os/strsubr.c b/usr/src/uts/common/os/strsubr.c index a7750e2ec3..cd8a0a2a62 100644 --- a/usr/src/uts/common/os/strsubr.c +++ b/usr/src/uts/common/os/strsubr.c @@ -1450,7 +1450,6 @@ putiocd(mblk_t *bp, char *arg, int flag, cred_t *cr) { mblk_t *tmp; ssize_t count; - size_t n; int error = 0; ASSERT((flag & (U_TO_K | K_TO_K)) == U_TO_K || @@ -1468,23 +1467,18 @@ putiocd(mblk_t *bp, char *arg, int flag, cred_t *cr) */ ASSERT(count >= 0); - while (count > 0) { - n = MIN(MAXIOCBSZ, count); - if ((tmp = allocb_cred_wait(n, (flag & STR_NOSIG), &error, - cr)) == NULL) { - return (error); - } - error = strcopyin(arg, tmp->b_wptr, n, flag & (U_TO_K|K_TO_K)); - if (error != 0) { - freeb(tmp); - return (error); - } - arg += n; - DB_CPID(tmp) = curproc->p_pid; - tmp->b_wptr += n; - count -= n; - bp = (bp->b_cont = tmp); + if ((tmp = allocb_cred_wait(count, (flag & STR_NOSIG), &error, cr)) == + NULL) { + return (error); + } + error = strcopyin(arg, tmp->b_wptr, count, flag & (U_TO_K|K_TO_K)); + if (error != 0) { + freeb(tmp); + return (error); } + DB_CPID(tmp) = curproc->p_pid; + tmp->b_wptr += count; + bp->b_cont = tmp; return (0); } diff --git a/usr/src/uts/common/sys/ioccom.h b/usr/src/uts/common/sys/ioccom.h index ffd4563c25..14321f0587 100644 --- a/usr/src/uts/common/sys/ioccom.h +++ b/usr/src/uts/common/sys/ioccom.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 1997 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -50,10 +49,10 @@ extern "C" { * Ioctl's have the command encoded in the lower word, * and the size of any in or out parameters in the upper * word. The high 2 bits of the upper word are used - * to encode the in/out status of the parameter; for now - * we restrict parameters to at most 255 bytes. + * to encode the in/out status of the parameter; + * parameters are restricted to at most 8191 bytes. */ -#define IOCPARM_MASK 0xff /* parameters must be < 256 bytes */ +#define IOCPARM_MASK 0x1fff /* parameters must be < 8K bytes */ #define IOC_VOID 0x20000000 /* no parameters */ #define IOC_OUT 0x40000000 /* copy out parameters */ #define IOC_IN 0x80000000 /* copy in parameters */ diff --git a/usr/src/uts/common/sys/stream.h b/usr/src/uts/common/sys/stream.h index 30a2870552..6436c5a0cc 100644 --- a/usr/src/uts/common/sys/stream.h +++ b/usr/src/uts/common/sys/stream.h @@ -721,11 +721,6 @@ typedef struct cmdblk { #define STRLOW 1024 /* - * Block allocation parameters - */ -#define MAXIOCBSZ 1024 /* max ioctl data block size */ - -/* * qwriter perimeter types */ #define PERIM_INNER 1 /* The inner perimeter */ |