From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754222AbdJRLfD (ORCPT ); Wed, 18 Oct 2017 07:35:03 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:51475 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753860AbdJRLfC (ORCPT ); Wed, 18 Oct 2017 07:35:02 -0400 X-Google-Smtp-Source: ABhQp+RmgB+Hary0iS6bPcSauPV9yXHkeB+KL9/9WRaK3BULmWpMg7/HFk0tn/OZ84HFhCODwPtymXcpNeNJzkvXdYM= MIME-Version: 1.0 In-Reply-To: <20171012080608.GA23077@outlook.office365.com> References: <20170924200620.GA24368@avx2> <20171010220804.GA30735@outlook.office365.com> <20171011181234.GB2119@avx2> <20171012080608.GA23077@outlook.office365.com> From: Alexey Dobriyan Date: Wed, 18 Oct 2017 13:35:00 +0200 Message-ID: Subject: Re: [1/2,v2] fdmap(2) To: Andrei Vagin Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, rdunlap@infradead.org, tglx@linutronix.de, tixxdz@gmail.com, gladkov.alexey@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/17, Andrei Vagin wrote: > I'm agree with your points, but I think you choose a wrong set of data > to make an example of a new approach. > > You are talking a lot about statx, but for me it is unclear how fdmap > follows the idea of statx. Let's imagine that I want to extend fdmap to > return mnt_id for each file descriptor? fdmap() is standalone thing. Next step is to design fdinfo(2) (?) which uses descriptors from fdmap(2). Extending structures is done as usual: but version, add new fields to the end. > Or it may be more complex case, when we decided to provide all data > from /proc/pid/fdinfo/X for each descriptor. A set of fields in fdinfo > depends on a type of a file descriptor, it is different for epoll, > signalfd, inotify, sockets, etc. > > For inotify file descriptors, there are information about all watches, > so it is not possible to use a fixed size struture to present this data. Now I didn't look closely at inotify watches but this is done with unions, zero-length trailing arrays, and other usual stuff. If OpenVZ/Virtuozzo is doing C/R of inotify then you already have all serializing code.