| 1114 | } |
| 1115 | |
| 1116 | static int |
| 1117 | cpuset_setproc_setthread(struct cpuset *tdset, struct cpuset *set, |
| 1118 | struct cpuset **nsetp, struct setlist *freelist, |
| 1119 | struct domainlist *domainlist) |
| 1120 | { |
| 1121 | struct domainset domain; |
| 1122 | cpuset_t mask; |
| 1123 | int error; |
| 1124 | |
| 1125 | /* |
| 1126 | * If we're replacing on a thread that has not constrained the |
| 1127 | * original set we can simply accept the new set. |
| 1128 | */ |
| 1129 | if (tdset->cs_id != CPUSET_INVALID) { |
| 1130 | *nsetp = cpuset_ref(set); |
| 1131 | return (0); |
| 1132 | } |
| 1133 | error = cpuset_setproc_setthread_mask(tdset, set, &mask, &domain); |
| 1134 | if (error) |
| 1135 | return (error); |
| 1136 | |
| 1137 | return cpuset_shadow(set, nsetp, &mask, &domain, freelist, |
| 1138 | domainlist); |
| 1139 | } |
| 1140 | |
| 1141 | static int |
| 1142 | cpuset_setproc_newbase(struct thread *td, struct cpuset *set, |
no test coverage detected