Print this page
patch as-lock-macro-simplification

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/syscall/utssys.c
          +++ new/usr/src/uts/common/syscall/utssys.c
↓ open down ↓ 526 lines elided ↑ open up ↑
 527  527  
 528  528                  /*
 529  529                   * now we want to walk a processes memory mappings.
 530  530                   * to do this we need to grab the prp->p_as lock.  (you
 531  531                   * can't hold p_lock when grabbing the prp->p_as lock.)
 532  532                   */
 533  533                  if (prp->p_as != &kas) {
 534  534                          struct seg      *seg;
 535  535                          struct as       *as = prp->p_as;
 536  536  
 537      -                        AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
      537 +                        AS_LOCK_ENTER(as, RW_READER);
 538  538                          for (seg = AS_SEGFIRST(as); seg;
 539  539                              seg = AS_SEGNEXT(as, seg)) {
 540  540                                  /*
 541  541                                   * if we can't get a backing vnode for this
 542  542                                   * segment then skip it
 543  543                                   */
 544  544                                  vp = NULL;
 545  545                                  if ((SEGOP_GETVP(seg, seg->s_base, &vp)) ||
 546  546                                      (vp == NULL))
 547  547                                          continue;
↓ open down ↓ 43 lines elided ↑ open up ↑
 591  591                                   * usage, then check if the vnode backing
 592  592                                   * this segment (vp) maps to the same device
 593  593                                   * instance as the target device (fvp).
 594  594                                   */
 595  595                                  if (dip_usage &&
 596  596                                      (VTOCS(fvp)->s_dip == VTOCS(vp)->s_dip)) {
 597  597                                          use_flag |= F_MAP;
 598  598                                          break;
 599  599                                  }
 600  600                          }
 601      -                        AS_LOCK_EXIT(as, &as->a_lock);
      601 +                        AS_LOCK_EXIT(as);
 602  602                  }
 603  603  
 604  604                  if (use_flag) {
 605  605                          ASSERT(pcnt < fu_data->fud_user_max);
 606  606                          fu_data->fud_user[pcnt].fu_flags = use_flag;
 607  607                          fu_data->fud_user[pcnt].fu_pid = pid;
 608  608                          fu_data->fud_user[pcnt].fu_uid = uid;
 609  609                          pcnt++;
 610  610                  }
 611  611  
↓ open down ↓ 343 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX