/* seq_file methods for the tasks/procs files. The seq_file position is the next pid to display; the seq_file iterator is a pointer to the pid in the cgroup->l->list array.  */
static void* cgroup_pidlist_start(struct seq_file *s, loff_t *pos)
/* seq_file methods for the tasks/procs files. The seq_file position is the next pid to display; the seq_file iterator is a pointer to the pid in the cgroup->l->list array.  */
static void* cgroup_pidlist_start(struct seq_file *s, loff_t *pos)
{
	struct cgroup_pidlist *l = s->private;
	int index = 0, pid = *pos;
	int *iter;
	down_read(&l->mutex);
	if (pid) {
		int end = l->length;
		while (index < end) {
			int mid = (index + end) / 2;
			if (l->list[mid] == pid) {
				index = mid;
				break;
			} else if (l->list[mid] <= pid)
				index = mid + 1;
			else
				end = mid;
		}
	}
	if (index >= l->length)
		return NULL;
	iter = l->list + index;
	*pos = *iter;
	return iter;
}