1198
1199 if (!rfs_write_async) {
1200 rfs_write_sync(wa, ns, exi, req, cr, ro);
1201 return;
1202 }
1203
1204 /*
1205 * Initialize status to RFSWRITE_INITVAL instead of 0, since value of 0
1206 * is considered an OK.
1207 */
1208 ns->ns_status = RFSWRITE_INITVAL;
1209
1210 nrp = &nrpsp;
1211 nrp->wa = wa;
1212 nrp->ns = ns;
1213 nrp->req = req;
1214 nrp->cr = cr;
1215 nrp->ro = ro;
1216 nrp->thread = curthread;
1217
1218 ASSERT(curthread->t_schedflag & TS_DONT_SWAP);
1219
1220 /*
1221 * Look to see if there is already a cluster started
1222 * for this file.
1223 */
1224 mutex_enter(&rfs_async_write_lock);
1225 for (lp = rfs_async_write_head; lp != NULL; lp = lp->next) {
1226 if (bcmp(&wa->wa_fhandle, lp->fhp,
1227 sizeof (fhandle_t)) == 0)
1228 break;
1229 }
1230
1231 /*
1232 * If lp is non-NULL, then there is already a cluster
1233 * started. We need to place ourselves in the cluster
1234 * list in the right place as determined by starting
1235 * offset. Conflicts with non-blocking mandatory locked
1236 * regions will be checked when the cluster is processed.
1237 */
1238 if (lp != NULL) {
1239 rp = lp->list;
|
1198
1199 if (!rfs_write_async) {
1200 rfs_write_sync(wa, ns, exi, req, cr, ro);
1201 return;
1202 }
1203
1204 /*
1205 * Initialize status to RFSWRITE_INITVAL instead of 0, since value of 0
1206 * is considered an OK.
1207 */
1208 ns->ns_status = RFSWRITE_INITVAL;
1209
1210 nrp = &nrpsp;
1211 nrp->wa = wa;
1212 nrp->ns = ns;
1213 nrp->req = req;
1214 nrp->cr = cr;
1215 nrp->ro = ro;
1216 nrp->thread = curthread;
1217
1218 /*
1219 * Look to see if there is already a cluster started
1220 * for this file.
1221 */
1222 mutex_enter(&rfs_async_write_lock);
1223 for (lp = rfs_async_write_head; lp != NULL; lp = lp->next) {
1224 if (bcmp(&wa->wa_fhandle, lp->fhp,
1225 sizeof (fhandle_t)) == 0)
1226 break;
1227 }
1228
1229 /*
1230 * If lp is non-NULL, then there is already a cluster
1231 * started. We need to place ourselves in the cluster
1232 * list in the right place as determined by starting
1233 * offset. Conflicts with non-blocking mandatory locked
1234 * regions will be checked when the cluster is processed.
1235 */
1236 if (lp != NULL) {
1237 rp = lp->list;
|