[LU-5774] lu_object_find_at() should NOT test conditional that doesn't change inside a loop Created: 21/Oct/14 Updated: 23/Dec/15 Resolved: 05/Jan/15 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.7.0 |
| Fix Version/s: | Lustre 2.7.0 |
| Type: | Improvement | Priority: | Trivial |
| Reporter: | Isaac Huang (Inactive) | Assignee: | Isaac Huang (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 16208 | ||||||||
| Description |
|
In lu_object_find_at(): while (1) {
if (conf != NULL && conf->loc_flags & LOC_F_NOWAIT) {
obj = lu_object_find_try(env, dev, f, conf, NULL);
return obj;
......
}
If I haven't missed something, it doesn't make sense to have the 'if' conditional inside the while loop - conf is a const struct lu_object_conf *, i.e. it doesn't change, so the conditional would always evaluate the same. When I first read the code, I was misled to believe that the conditional may change so it had to be tested at each iteration. |
| Comments |
| Comment by Isaac Huang (Inactive) [ 21/Oct/14 ] |
| Comment by James A Simmons [ 16/Dec/14 ] |
|
This enhancement was included in the patch http://review.whamcloud.com/#/c/12741 for |