Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1139683ybi; Wed, 3 Jul 2019 10:09:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzA2LiH10SA9drA7OvrDU/Pni+V85Fd5K9SEHRoaPaA0lII9DhH4M1sjoqbLdDCPp5m8Kdg X-Received: by 2002:a17:902:aa95:: with SMTP id d21mr41945836plr.185.1562173782327; Wed, 03 Jul 2019 10:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562173782; cv=none; d=google.com; s=arc-20160816; b=VvuggSmt6wnAACTu64vEcpDPLLEJmoNrGyPhrUMuFmqy0HpxjkwtxzgyFPbRTwZ003 GxcZQ3wpJ73sizFWHMHCZCFXgXchNrCtcGxPAUdF+nSVtZs1WJ/A3zV0bifuNVNmPtou nlxqQlW12qqdcShoCT3XtVEsyKD2OzTA89YLGFOlGwxhT8oUzn9c0LICOQ3sn0CKrW60 6YL532F8Sbi7arySbiMmyhWT7EX7g7VfDezPf9Rs+QkjF6xXZP1LqmfrrGerNPZ79XqO c22z0n52rCbiA7izqvztVInY2/IrPKgemQYZuaLTJv7Mu1giRVmMTONGPDnLnqh2oA1f zvzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QknJwj7+dLhOw9snx4meBE0NOCv7q0OvfLJWYOG5xhI=; b=0GQWBE9OD6OF/gilXmxKiKsf9ZMIKsQuRMHXzAnSTdqBLmTUl4Z7/qNLWw1EIuG9JB pdGU++4UItWz6oi5jjnQ7yybWx0d+N/R9/4FqpEdMfDX0O9Hje45n9Aa3gdU9eaPe35R o04yPIjCamjlmpSx2ReW3fQcyPiL0wOjqtGWCNdVjqiZwyfIs8U9J/ICFcLtqtFbI44a O2D3U6VSaMPny1Ri91ru9sTnmqpFok2CEzCf9WwfMzNpJmMcP+NUqO6fe3nRXl39k9g6 LSsn7Aokl6shqZQJT1vFcO00TSzWuZLonoLBlr4suTD++zLyWdDKNwMYToJi65ma59mr kSKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gJ0o71u9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si2826101pff.250.2019.07.03.10.09.27; Wed, 03 Jul 2019 10:09:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gJ0o71u9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727140AbfGCRIN (ORCPT + 99 others); Wed, 3 Jul 2019 13:08:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:33902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbfGCRIN (ORCPT ); Wed, 3 Jul 2019 13:08:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE6EE2080C; Wed, 3 Jul 2019 17:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562173692; bh=0ouf0Y73C+G8kK8V/y9ZdKcbKz2QNfNH9xVkkqZP1JA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gJ0o71u9D8lYdXoiiMKqqplUcWvoc5CoTLCEvXJliqmrj/bLCD4U7ZquS4QjDfQ5S y6bAUovvtz1ELtv2hiWjY7X3gqzzZwKjN1wdiZhn6duk1o19EUlj0mUvmKXPY6BMpf chEbpSaJjWxWVemuFC7cZlw0f5molzIeYgqrlTLE= Date: Wed, 3 Jul 2019 19:08:10 +0200 From: Greg Kroah-Hartman To: David Howells Cc: viro@zeniv.linux.org.uk, Casey Schaufler , Stephen Smalley , nicolas.dichtel@6wind.com, raven@themaw.net, Christian Brauner , keyrings@vger.kernel.org, linux-usb@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/9] uapi: General notification ring definitions [ver #5] Message-ID: <20190703170810.GB24672@kroah.com> References: <156173690158.15137.3985163001079120218.stgit@warthog.procyon.org.uk> <156173691411.15137.2073887155273175167.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <156173691411.15137.2073887155273175167.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 28, 2019 at 04:48:34PM +0100, David Howells wrote: > Add UAPI definitions for the general notification ring, including the > following pieces: > > (1) struct watch_notification. > > This is the metadata header for each entry in the ring. It includes a > type and subtype that indicate the source of the message > (eg. WATCH_TYPE_MOUNT_NOTIFY) and the kind of the message > (eg. NOTIFY_MOUNT_NEW_MOUNT). > > The header also contains an information field that conveys the > following information: > > - WATCH_INFO_LENGTH. The size of the entry (entries are variable > length). > > - WATCH_INFO_ID. The watch ID specified when the watchpoint was > set. > > - WATCH_INFO_TYPE_INFO. (Sub)type-specific information. > > - WATCH_INFO_FLAG_*. Flag bits overlain on the type-specific > information. For use by the type. > > All the information in the header can be used in filtering messages at > the point of writing into the buffer. > > (2) struct watch_queue_buffer. > > This describes the layout of the ring. Note that the first slots in > the ring contain a special metadata entry that contains the ring > pointers. The producer in the kernel knows to skip this and it has a > proper header (WATCH_TYPE_META, WATCH_META_SKIP_NOTIFICATION) that > indicates the size so that the ring consumer can handle it the same as > any other record and just skip it. > > Note that this means that ring entries can never be split over the end > of the ring, so if an entry would need to be split, a skip record is > inserted to wrap the ring first; this is also WATCH_TYPE_META, > WATCH_META_SKIP_NOTIFICATION. > > (3) WATCH_INFO_NOTIFICATIONS_LOST. > > This is a flag that can be set in the metadata header by the kernel to > indicate that at least one message was lost since it was last cleared > by userspace. > > Signed-off-by: David Howells Reviewed-by: Greg Kroah-Hartman