- task_active_pid_ns(current)->last_pid);
+ task_active_pid_ns(current)->idr.idr_next-1);
I think we want a well documented helper for this pattern instead
of poking into the internals.
Also is last - 1 always the correct answer? Even with
idr_alloc_cyclic
we could wrap around, couldn't we?
On Sun, Oct 1, 2017 at 2:45 PM, Christoph Hellwig <hch@infradead.org>
wrote:
- task_active_pid_ns(current)->last_pid); + task_active_pid_ns(current)->idr.idr_next-1);
I think we want a well documented helper for this pattern instead
of poking into the internals.
idr_get_cursor() get can be used instead of idr.idr_next, so that we
do not
expose the internals.
Also is last - 1 always the correct answer? Even with
idr_alloc_cyclic
we could wrap around, couldn't we?
-1 will be incorrect when the pids wrap around. Should we go back to
setting up last_pid as it was done before? Or should we use
idr_get_cursor
and determine if pid was rolled over and then perform necessary
action?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 286 |
Nodes: | 16 (2 / 14) |
Uptime: | 85:23:15 |
Calls: | 6,495 |
Calls today: | 6 |
Files: | 12,099 |
Messages: | 5,276,971 |