The first (second) loop of vnode_pager_undirty_pages() includes an if-test to test whether an iteration is the last (first). Move those if-tests out of their loops.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/vm/vnode_pager.c | ||
|---|---|---|
| 1529 | I don't like that the same parameter (written, lpos) sometimes represents a quantity measured in bytes and other times pages. Adding a variable to represent page counts would better. | |
| sys/vm/vnode_pager.c | ||
|---|---|---|
| 1543 | I suggest adding some comment after this point. In the previous organization of the function, it was more or less clear that we process two runs of the pages: first run from the start to the written position, and the second run from eof to the end. Now it is less clear IMO. Explaining this would be beneficial to the reader. In this place, it is useful to note that we skip touching pages between round_page(written) and trunc_page(eof). | |
Comment Actions
Add comments preceding each block of code that processes a range of consecutive pages. Reformat comment blocks.
| sys/vm/vnode_pager.c | ||
|---|---|---|
| 1541 | ||