Print this page
5513 KM_NORMALPRI should be documented in kmem_alloc(9f) and kmem_cache_create(9f) man pages
14465 Present KM_NOSLEEP_LAZY as documented interface
Change-Id: I002ec28ddf390650f1fcba1ca94f6abfdb241439

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/nfs/nfs_auth.c
          +++ new/usr/src/uts/common/fs/nfs/nfs_auth.c
↓ open down ↓ 914 lines elided ↑ open up ↑
 915  915          tree = exi->exi_cache[hash(&addr)];
 916  916  
 917  917          rw_enter(&exi->exi_cache_lock, RW_READER);
 918  918          c = (struct auth_cache_clnt *)avl_find(tree, &acc, NULL);
 919  919  
 920  920          if (c == NULL) {
 921  921                  struct auth_cache_clnt *nc;
 922  922  
 923  923                  rw_exit(&exi->exi_cache_lock);
 924  924  
 925      -                nc = kmem_alloc(sizeof (*nc), KM_NOSLEEP | KM_NORMALPRI);
      925 +                nc = kmem_alloc(sizeof (*nc), KM_NOSLEEP_LAZY);
 926  926                  if (nc == NULL)
 927  927                          goto retrieve;
 928  928  
 929  929                  /*
 930  930                   * Initialize the new auth_cache_clnt
 931  931                   */
 932  932                  nc->authc_addr = addr;
 933      -                nc->authc_addr.buf = kmem_alloc(addr.maxlen,
 934      -                    KM_NOSLEEP | KM_NORMALPRI);
      933 +                nc->authc_addr.buf = kmem_alloc(addr.maxlen, KM_NOSLEEP_LAZY);
 935  934                  if (addr.maxlen != 0 && nc->authc_addr.buf == NULL) {
 936  935                          kmem_free(nc, sizeof (*nc));
 937  936                          goto retrieve;
 938  937                  }
 939  938                  bcopy(addr.buf, nc->authc_addr.buf, addr.len);
 940  939                  rw_init(&nc->authc_lock, NULL, RW_DEFAULT, NULL);
 941  940                  avl_create(&nc->authc_tree, nfsauth_cache_compar,
 942  941                      sizeof (struct auth_cache),
 943  942                      offsetof(struct auth_cache, auth_link));
 944  943  
↓ open down ↓ 20 lines elided ↑ open up ↑
 965  964          ac.auth_flavor = flavor;
 966  965          ac.auth_clnt_cred = cr;
 967  966  
 968  967          p = (struct auth_cache *)avl_find(&c->authc_tree, &ac, NULL);
 969  968  
 970  969          if (p == NULL) {
 971  970                  struct auth_cache *np;
 972  971  
 973  972                  rw_exit(&c->authc_lock);
 974  973  
 975      -                np = kmem_cache_alloc(exi_cache_handle,
 976      -                    KM_NOSLEEP | KM_NORMALPRI);
      974 +                np = kmem_cache_alloc(exi_cache_handle, KM_NOSLEEP_LAZY);
 977  975                  if (np == NULL) {
 978  976                          rw_exit(&exi->exi_cache_lock);
 979  977                          goto retrieve;
 980  978                  }
 981  979  
 982  980                  /*
 983  981                   * Initialize the new auth_cache
 984  982                   */
 985  983                  np->auth_clnt = c;
 986  984                  np->auth_flavor = flavor;
↓ open down ↓ 77 lines elided ↑ open up ↑
1064 1062                                  *gid = tmpgid;
1065 1063                          if (ngids != NULL && gids != NULL) {
1066 1064                                  *ngids = tmpngids;
1067 1065                                  *gids = tmpgids;
1068 1066  
1069 1067                                  /*
1070 1068                                   * We need a copy of gids for the
1071 1069                                   * auth_cache entry
1072 1070                                   */
1073 1071                                  tmpgids = kmem_alloc(tmpngids * sizeof (gid_t),
1074      -                                    KM_NOSLEEP | KM_NORMALPRI);
     1072 +                                    KM_NOSLEEP_LAZY);
1075 1073                                  if (tmpgids != NULL)
1076 1074                                          bcopy(*gids, tmpgids,
1077 1075                                              tmpngids * sizeof (gid_t));
1078 1076                          }
1079 1077  
1080 1078                          if (tmpgids != NULL || tmpngids == 0) {
1081 1079                                  p->auth_srv_uid = tmpuid;
1082 1080                                  p->auth_srv_gid = tmpgid;
1083 1081                                  p->auth_srv_ngids = tmpngids;
1084 1082                                  p->auth_srv_gids = tmpgids;
↓ open down ↓ 529 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX