57
58 #include <sys/ksynch.h>
59 #include <sys/kmem.h>
60 #include <sys/errno.h>
61 #include <sys/varargs.h>
62 #include <sys/file.h>
63 #include <sys/open.h>
64 #include <sys/conf.h>
65 #include <sys/cred.h>
66 #include <sys/buf.h>
67 #include <sys/uio.h>
68 #ifndef DS_DDICT
69 #include <sys/pathname.h>
70 #endif
71 #include <sys/aio_req.h>
72 #include <sys/dkio.h>
73 #include <sys/vtoc.h>
74 #include <sys/cmn_err.h>
75 #include <sys/modctl.h>
76 #include <sys/ddi.h>
77 #include <sys/sunddi.h>
78 #include <sys/sunldi.h>
79 #include <sys/nsctl/nsvers.h>
80
81 #include <sys/nsc_thread.h>
82 #include <sys/unistat/spcs_s.h>
83 #include <sys/unistat/spcs_s_k.h>
84 #include <sys/unistat/spcs_errors.h>
85
86 #ifdef DS_DDICT
87 #include "../contract.h"
88 #endif
89
90 #include "../nsctl.h"
91
92
93 #include <sys/sdt.h> /* dtrace is S10 or later */
94
95 #include "sv.h"
96 #include "sv_impl.h"
2398
2399 _sv_lyr_strategy(bp);
2400 sv_no_threads++;
2401 } else {
2402 nlive = nst_nlive(sv_tset);
2403 if (nlive > sv_max_nlive) {
2404 if (sv_debug > 0) {
2405 cmn_err(CE_CONT,
2406 "!sv_lyr_strategy: "
2407 "new max nlive %d (nthread %d)\n",
2408 nlive, nst_nthread(sv_tset));
2409 }
2410
2411 sv_max_nlive = nlive;
2412 }
2413 }
2414
2415 return (0);
2416 }
2417
2418
2419 #ifndef offsetof
2420 #define offsetof(s, m) ((size_t)(&((s *)0)->m))
2421 #endif
2422
2423 /*
2424 * re-write the size of the current partition
2425 */
2426 static int
2427 sv_fix_dkiocgvtoc(const intptr_t arg, const int mode, sv_dev_t *svp)
2428 {
2429 size_t offset;
2430 int ilp32;
2431 int pnum;
2432 int rc;
2433
2434 ilp32 = (ddi_model_convert_from((mode & FMODELS)) == DDI_MODEL_ILP32);
2435
2436 rc = nskern_partition(svp->sv_dev, &pnum);
2437 if (rc != 0) {
2438 return (rc);
2439 }
2440
2441 if (pnum < 0 || pnum >= V_NUMPAR) {
2442 cmn_err(CE_WARN,
|
57
58 #include <sys/ksynch.h>
59 #include <sys/kmem.h>
60 #include <sys/errno.h>
61 #include <sys/varargs.h>
62 #include <sys/file.h>
63 #include <sys/open.h>
64 #include <sys/conf.h>
65 #include <sys/cred.h>
66 #include <sys/buf.h>
67 #include <sys/uio.h>
68 #ifndef DS_DDICT
69 #include <sys/pathname.h>
70 #endif
71 #include <sys/aio_req.h>
72 #include <sys/dkio.h>
73 #include <sys/vtoc.h>
74 #include <sys/cmn_err.h>
75 #include <sys/modctl.h>
76 #include <sys/ddi.h>
77 #include <sys/sysmacros.h>
78 #include <sys/sunddi.h>
79 #include <sys/sunldi.h>
80 #include <sys/nsctl/nsvers.h>
81
82 #include <sys/nsc_thread.h>
83 #include <sys/unistat/spcs_s.h>
84 #include <sys/unistat/spcs_s_k.h>
85 #include <sys/unistat/spcs_errors.h>
86
87 #ifdef DS_DDICT
88 #include "../contract.h"
89 #endif
90
91 #include "../nsctl.h"
92
93
94 #include <sys/sdt.h> /* dtrace is S10 or later */
95
96 #include "sv.h"
97 #include "sv_impl.h"
2399
2400 _sv_lyr_strategy(bp);
2401 sv_no_threads++;
2402 } else {
2403 nlive = nst_nlive(sv_tset);
2404 if (nlive > sv_max_nlive) {
2405 if (sv_debug > 0) {
2406 cmn_err(CE_CONT,
2407 "!sv_lyr_strategy: "
2408 "new max nlive %d (nthread %d)\n",
2409 nlive, nst_nthread(sv_tset));
2410 }
2411
2412 sv_max_nlive = nlive;
2413 }
2414 }
2415
2416 return (0);
2417 }
2418
2419 /*
2420 * re-write the size of the current partition
2421 */
2422 static int
2423 sv_fix_dkiocgvtoc(const intptr_t arg, const int mode, sv_dev_t *svp)
2424 {
2425 size_t offset;
2426 int ilp32;
2427 int pnum;
2428 int rc;
2429
2430 ilp32 = (ddi_model_convert_from((mode & FMODELS)) == DDI_MODEL_ILP32);
2431
2432 rc = nskern_partition(svp->sv_dev, &pnum);
2433 if (rc != 0) {
2434 return (rc);
2435 }
2436
2437 if (pnum < 0 || pnum >= V_NUMPAR) {
2438 cmn_err(CE_WARN,
|