| .. | .. |
|---|
| 212 | 212 | subtract_lebs += 1; |
|---|
| 213 | 213 | |
|---|
| 214 | 214 | /* |
|---|
| 215 | | - * The GC journal head LEB is not really accessible. And since |
|---|
| 216 | | - * different write types go to different heads, we may count only on |
|---|
| 217 | | - * one head's space. |
|---|
| 215 | + * Since different write types go to different heads, we should |
|---|
| 216 | + * reserve one leb for each head. |
|---|
| 218 | 217 | */ |
|---|
| 219 | | - subtract_lebs += c->jhead_cnt - 1; |
|---|
| 218 | + subtract_lebs += c->jhead_cnt; |
|---|
| 220 | 219 | |
|---|
| 221 | 220 | /* We also reserve one LEB for deletions, which bypass budgeting */ |
|---|
| 222 | 221 | subtract_lebs += 1; |
|---|
| .. | .. |
|---|
| 403 | 402 | dd_growth = req->dirtied_page ? c->bi.page_budget : 0; |
|---|
| 404 | 403 | |
|---|
| 405 | 404 | if (req->dirtied_ino) |
|---|
| 406 | | - dd_growth += c->bi.inode_budget << (req->dirtied_ino - 1); |
|---|
| 405 | + dd_growth += c->bi.inode_budget * req->dirtied_ino; |
|---|
| 407 | 406 | if (req->mod_dent) |
|---|
| 408 | 407 | dd_growth += c->bi.dent_budget; |
|---|
| 409 | 408 | dd_growth += req->dirtied_ino_d; |
|---|