Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752771AbbGNSEU (ORCPT ); Tue, 14 Jul 2015 14:04:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47431 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084AbbGNSES (ORCPT ); Tue, 14 Jul 2015 14:04:18 -0400 Date: Tue, 14 Jul 2015 20:02:35 +0200 From: Oleg Nesterov To: Andrey Vagin Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Andrew Morton , Cyrill Gorcunov , Pavel Emelyanov , Roger Luethi , Arnd Bergmann , Arnaldo Carvalho de Melo , David Ahern , Andy Lutomirski , Pavel Odintsov Subject: Re: [PATCH 08/24] proc: pick out a function to iterate task children Message-ID: <20150714180235.GB8088@redhat.com> References: <1436172445-6979-1-git-send-email-avagin@openvz.org> <1436172445-6979-9-git-send-email-avagin@openvz.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436172445-6979-9-git-send-email-avagin@openvz.org> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 24 On 07/06, Andrey Vagin wrote: > > -static struct pid * > -get_children_pid(struct inode *inode, struct pid *pid_prev, loff_t pos) > +static struct task_struct * > +task_next_child(struct task_struct *parent, struct task_struct *prev, unsigned int pos) > { I won't really argue, just a question... So this patch changes it to accept/return task_struct rather pid. Why? it is better to get/put "struct pid" only, not the whole task_struct. If another caller want task_struct, the necessary conversion is simple. But again, I won't argue if you think this will complicate the non-proc users of this helper. Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/