Use a switch, for better enumeration of the possible values. This is
non-functional change, but IMO it makes the logic a little easier to
follow.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 54337 Build 51227: arc lint + arc unit
Event Timeline
sys/vm/vm_page.c | ||
---|---|---|
4453 | Suppose that advise is MADV_WILLNEED. Before the patch, the page is dirtied if pmap thinks it is modified. |
sys/vm/vm_page.c | ||
---|---|---|
4453 | If advise is MADV_WILLNEED, we don't get to this point. We return on line 4450. |
sys/vm/vm_page.c | ||
---|---|---|
4459 | This change simplifies the control flow, but I don't know that the code is really clearer. The handling the dirty bits for MADV_FREE/DONTNEED above is connected to the rest of the function below, but that's not obvious. I think this would be the easiest to follow: if (advice != MADV_DONTNEED && advice != MADV_FREE) { if (advice == MADV_WILLNEED) vm_page_activate(m); return; } if (advice == MADV_FREE) vm_page_undirty(m); else if (m->dirty == 0 && pmap_is_modified(m)) vm_page_dirty(m); ... |