Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755753AbcDKXiN (ORCPT ); Mon, 11 Apr 2016 19:38:13 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:32945 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755444AbcDKXgY (ORCPT ); Mon, 11 Apr 2016 19:36:24 -0400 From: Andrey Vagin To: linux-kernel@vger.kernel.org Cc: Andrey Vagin , Oleg Nesterov , Andrew Morton , Cyrill Gorcunov , Pavel Emelyanov , Roger Luethi , Arnd Bergmann , Arnaldo Carvalho de Melo , David Ahern , Andy Lutomirski , Pavel Odintsov Subject: [PATCH 09/15] task_diag: add a flag to mark incomplete messages Date: Mon, 11 Apr 2016 16:35:49 -0700 Message-Id: <1460417755-18201-10-git-send-email-avagin@openvz.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1460417755-18201-1-git-send-email-avagin@openvz.org> References: <1460417755-18201-1-git-send-email-avagin@openvz.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1297 Lines: 46 If all information about a process don't fit in a message, it's marked by the TASK_DIAG_FLAG_CONT flag and the next message will describe the same process. Signed-off-by: Andrey Vagin --- fs/proc/task_diag.c | 3 +++ include/uapi/linux/task_diag.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/fs/proc/task_diag.c b/fs/proc/task_diag.c index 00db32d..cd10374 100644 --- a/fs/proc/task_diag.c +++ b/fs/proc/task_diag.c @@ -415,6 +415,7 @@ static int task_diag_fill(struct task_struct *tsk, struct sk_buff *skb, msg = nlmsg_data(nlh); msg->pid = task_pid_nr_ns(tsk, pidns); msg->tgid = task_tgid_nr_ns(tsk, pidns); + msg->flags |= TASK_DIAG_FLAG_CONT; if (show_flags & TASK_DIAG_SHOW_BASE) { if (i >= n) @@ -450,6 +451,8 @@ static int task_diag_fill(struct task_struct *tsk, struct sk_buff *skb, i++; } + msg->flags &= ~TASK_DIAG_FLAG_CONT; + nlmsg_end(skb, nlh); if (cb) cb->attr = 0; diff --git a/include/uapi/linux/task_diag.h b/include/uapi/linux/task_diag.h index 8bccd02..e967c5b 100644 --- a/include/uapi/linux/task_diag.h +++ b/include/uapi/linux/task_diag.h @@ -13,6 +13,8 @@ struct task_diag_msg { __u32 flags; }; +#define TASK_DIAG_FLAG_CONT 0x00000001 + enum { TASK_DIAG_BASE = 0, TASK_DIAG_CRED, -- 2.5.5