Print this page
XXXX give me a better summary

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
          +++ new/usr/src/uts/common/fs/tmpfs/tmp_vnops.c
↓ open down ↓ 2018 lines elided ↑ open up ↑
2019 2019                  /*NOTREACHED*/
2020 2020          }
2021 2021  out:
2022 2022          if ((curproc == proc_pageout) || dolock)
2023 2023                  rw_exit(&tp->tn_contents);
2024 2024          /*
2025 2025           * Only reason putapage is going to give us SE_NOSWAP as error
2026 2026           * is when we ask a page to be written to physical backing store
2027 2027           * and there is none. Ignore this because we might be dealing
2028 2028           * with a swap page which does not have any backing store
2029      -         * on disk. In any other case we won't get this error over here.
     2029 +         * on disk, though the newer SE_NODEV error should cover that.
     2030 +         * In any other case we won't get this error over here.
2030 2031           */
2031      -        if (err == SE_NOSWAP)
     2032 +        if (err == SE_NOSWAP || err == SE_NODEV)
2032 2033                  err = 0;
2033 2034          return (err);
2034 2035  }
2035 2036  
2036 2037  long tmp_putpagecnt, tmp_pagespushed;
2037 2038  
2038 2039  /*
2039 2040   * Write out a single page.
2040 2041   * For tmpfs this means choose a physical swap slot and write the page
2041 2042   * out using VOP_PAGEIO. For performance, we attempt to kluster; i.e.,
↓ open down ↓ 42 lines elided ↑ open up ↑
2084 2085  
2085 2086          /*
2086 2087           * Get a cluster of physical offsets for the pages; the amount we
2087 2088           * get may be some subrange of what we ask for (io_off, io_len).
2088 2089           */
2089 2090          io_off = pp_off;
2090 2091          io_len = pp_len;
2091 2092          err = swap_newphysname(vp, offset, &io_off, &io_len, &pvp, &pstart);
2092 2093          ASSERT(err != SE_NOANON); /* anon slot must have been filled */
2093 2094          if (err) {
2094      -                pvn_write_done(pplist, B_ERROR | B_WRITE | flags);
     2095 +                ASSERT(err == SE_NOSWAP || err == SE_NODEV);
     2096 +                pvn_write_done(pplist, (err == SE_NODEV ? 0 : B_ERROR) |
     2097 +                    B_WRITE | flags);
2095 2098                  /*
2096 2099                   * If this routine is called as a result of segvn_sync
2097 2100                   * operation and we have no physical swap then we can get an
2098 2101                   * error here. In such case we would return SE_NOSWAP as error.
2099      -                 * At this point, we expect only SE_NOSWAP.
2100 2102                   */
2101      -                ASSERT(err == SE_NOSWAP);
2102      -                if (flags & B_INVAL)
     2103 +                if ((flags & B_INVAL) && err == SE_NOSWAP)
2103 2104                          err = ENOMEM;
2104 2105                  goto out;
2105 2106          }
2106 2107          ASSERT(pp_off <= io_off && io_off + io_len <= pp_off + pp_len);
2107 2108          ASSERT(io_off <= offset && offset < io_off + io_len);
2108 2109  
2109 2110          /* Toss pages at front/rear that we couldn't get physical backing for */
2110 2111          if (io_off != pp_off) {
2111 2112                  npplist = NULL;
2112 2113                  page_list_break(&pplist, &npplist, btop(io_off - pp_off));
↓ open down ↓ 23 lines elided ↑ open up ↑
2136 2137          }
2137 2138  out:
2138 2139          if (!err) {
2139 2140                  if (offp)
2140 2141                          *offp = io_off;
2141 2142                  if (lenp)
2142 2143                          *lenp = io_len;
2143 2144                  tmp_putpagecnt++;
2144 2145                  tmp_pagespushed += btop(io_len);
2145 2146          }
2146      -        if (err && err != ENOMEM && err != SE_NOSWAP)
     2147 +        if (err && err != ENOMEM && err != SE_NOSWAP && err != SE_NODEV)
2147 2148                  cmn_err(CE_WARN, "tmp_putapage: err %d\n", err);
2148 2149          return (err);
2149 2150  }
2150 2151  
2151 2152  /* ARGSUSED */
2152 2153  static int
2153 2154  tmp_map(
2154 2155          struct vnode *vp,
2155 2156          offset_t off,
2156 2157          struct as *as,
↓ open down ↓ 298 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX