Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp300617rbb; Sat, 24 Feb 2024 00:46:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWI10wzkRNkLrxSEs5jm+oQ9UaIL2hMH+Zc54vBWbpcc+hKh4ukf2aXSyIphlm86AMJC07blkIB5wOg50zkJ/PjI9HuAy5aOwza0ZuKXw== X-Google-Smtp-Source: AGHT+IHC1RGP1r8fFq8nbUjH8AX6RNMQ/m5JLeqXE4lFbE+3EzxDfriwAlM7qxn/QyOVbiZ9ivFv X-Received: by 2002:a05:6402:7c5:b0:565:92b:ae77 with SMTP id u5-20020a05640207c500b00565092bae77mr1343895edy.12.1708764399241; Sat, 24 Feb 2024 00:46:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708764399; cv=pass; d=google.com; s=arc-20160816; b=qhzd+c+wUwV+DqCyySAR6agkZmTmVWfvQgs8lvgJzKCEq1Kci8yPPkP2Aw8LUigUfl otL/cHG1LnHIJQeV5PIrJDKoQ4vvyjrI07VWMcwsWxY/X0NO46tnhIES46Bok6yNRWSk y8tHiqiWIBq8uLL7suTYs+gmffnMvRCvm/mBeUDV/JAyhgsAHPZ8tQ7kvx1NfLX14rgm 840jCrKAoidNtTLf7R7GAu+Ah0pNpAmkozNUnfQYZgjvt5t5OKrITbk6WkSTLf43/mjT gJRwlWCn3Int1jbQhBAJn+QsyjrbfxhJqbFgIudW1HKspQpHrVogvXBNLvHSy1QTDBpF dMdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1PQkgMOAg6e8eTu59zqEMoNNkn6K/4X8IH67/pQAy/U=; fh=/4PJNbluUFMdOO8Nu6OIIL5UQR0g5IRWWKYr2xFGHE8=; b=VOsqtitjBMmctxWxqPgWFVlOR/i3HT2sFQ4vvj8oG4InSpqEFEkGRq1J1geN5SgFNx 5ub+yNAO6QimBJZq2JqcFl2W46LcNCx2Xs39fFbFztXMM5r8MbQa/TI3AQzen6g9dAso oNhwh0SPTwE6dBzVcBbkSavGujyNLbERS5+DKDTQhPFM63JlKuu7gf4h/q8SI/uQ/FD+ XwVrnw1BE5MgwABCFaiq14MoyJi2FOHT6RcTvqvv59VTEvnPe9PEAcckNeXU669QWvWQ fngdP910Sy2Uyt89sZclIR3sHfcuROWKOZ6JDtcVXNjzEmVRxfkrObSvuzHRFy/+3Yn8 JqDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=BGPoinDl; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-79425-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79425-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n25-20020aa7d059000000b00564fa2bed7fsi334759edo.278.2024.02.24.00.46.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 00:46:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79425-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=BGPoinDl; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-79425-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79425-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4B8FA1F24FEC for ; Sat, 24 Feb 2024 01:39:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73BC46ABF; Sat, 24 Feb 2024 01:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BGPoinDl" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E75B4691; Sat, 24 Feb 2024 01:39:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708738772; cv=none; b=mZ9nvgih6BpHXS80mXZhHRmQwWbYBoFnDl9pEWHLgxet0IYHnS0q+KuabPDeG+sGjLc96rJQyk5WZ7Yf5Mo2AKhKkhOlzvIy+nFRtpe0jqUf0Reg0BocxFT4nA4vQ+oQroTpbAxYOLKqmjY4441CkeV3pRFaNPSMVpOr0rVyO7k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708738772; c=relaxed/simple; bh=grmqTGtQG9fq4CPhxxcq8kJy2UzulKY7x/6Pg9ONvnM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YveVGlPlyXpv+1SJjxLtlXHHhWAcpWSBqFvV6EMHRsDSHvA99bnpwDBL2UK4wg45GsHdDwNFJ3617xBP9E8lJaH/oaavZ8ueo+kbCTJQY58CNf8LdFxEXkcnMfIY343BRNb84znhjKwAyyx8FAz5QN27NjBniyKJxNqEV2xkR6A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=BGPoinDl; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=1PQkgMOAg6e8eTu59zqEMoNNkn6K/4X8IH67/pQAy/U=; b=BGPoinDluaiJF6D2vgIjksRoEi EGPOmrVD8c1/7zjT288XvYtD2u02gttPLPx5bqlaamxkRtQXVtwcAeGFb+Wb7W0ex0f0bvb/MMojE T+EYgKVVDHZnxczc/XoDBX2Y/l2sIwygIOFW3sSccxT4j1azU4+OF1mFOd3vwoDCyBaleT1UgR7rk Vl6Xe26wsYxkqEm4i5Ey1ex9eagaLhRaeF+ofuRX9vwgmGF/8M3h47gpG9fZ3cDAztLbJZgzq1TE/ 1FbK4ga7kiurfiPB8XXA+xGjKiPiNS7Jnzou+Xl6yRTtZiAnQvVmFe+IZ4wa2G64oHTm8GlqzdkhL CRgI0hVQ==; Received: from [50.53.50.0] (helo=[192.168.254.15]) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdh0d-0000000BoWv-1wgB; Sat, 24 Feb 2024 01:39:23 +0000 Message-ID: <8f62b688-6c14-4eab-b039-7d9a112893f8@infradead.org> Date: Fri, 23 Feb 2024 17:39:22 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 07/20] famfs: Add include/linux/famfs_ioctl.h Content-Language: en-US To: John Groves , John Groves , Jonathan Corbet , Dan Williams , Vishal Verma , Dave Jiang , Alexander Viro , Christian Brauner , Jan Kara , Matthew Wilcox , linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev Cc: john@jagalactic.com, Dave Chinner , Christoph Hellwig , dave.hansen@linux.intel.com, gregory.price@memverge.com References: From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi-- On 2/23/24 09:41, John Groves wrote: > Add uapi include file for famfs. The famfs user space uses ioctl on > individual files to pass in mapping information and file size. This > would be hard to do via sysfs or other means, since it's > file-specific. > > Signed-off-by: John Groves > --- > include/uapi/linux/famfs_ioctl.h | 56 ++++++++++++++++++++++++++++++++ > 1 file changed, 56 insertions(+) > create mode 100644 include/uapi/linux/famfs_ioctl.h > > diff --git a/include/uapi/linux/famfs_ioctl.h b/include/uapi/linux/famfs_ioctl.h > new file mode 100644 > index 000000000000..6b3e6452d02f > --- /dev/null > +++ b/include/uapi/linux/famfs_ioctl.h > @@ -0,0 +1,56 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > +/* > + * famfs - dax file system for shared fabric-attached memory > + * > + * Copyright 2023-2024 Micron Technology, Inc. > + * > + * This file system, originally based on ramfs the dax support from xfs, This is confusing to me. Is it just me? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > + * is intended to allow multiple host systems to mount a common file system > + * view of dax files that map to shared memory. > + */ > +#ifndef FAMFS_IOCTL_H > +#define FAMFS_IOCTL_H > + > +#include > +#include > + > +#define FAMFS_MAX_EXTENTS 2 > + > +enum extent_type { > + SIMPLE_DAX_EXTENT = 13, > + INVALID_EXTENT_TYPE, > +}; > + > +struct famfs_extent { > + __u64 offset; > + __u64 len; > +}; > + > +enum famfs_file_type { > + FAMFS_REG, > + FAMFS_SUPERBLOCK, > + FAMFS_LOG, > +}; > + > +/** "/**" is used to begin kernel-doc comments, but this comment block is missing a few entries to make it be kernel-doc compatible. Please either add them or just use "/*" to begin the comment. > + * struct famfs_ioc_map > + * > + * This is the metadata that indicates where the memory is for a famfs file > + */ > +struct famfs_ioc_map { > + enum extent_type extent_type; > + enum famfs_file_type file_type; > + __u64 file_size; > + __u64 ext_list_count; > + struct famfs_extent ext_list[FAMFS_MAX_EXTENTS]; > +}; > + > +#define FAMFSIOC_MAGIC 'u' This 'u' value should be documented in Documentation/userspace-api/ioctl/ioctl-number.rst. and if possible, you might want to use values like 0x5x or 0x8x that don't conflict with the ioctl numbers that are already used in the 'u' space. > + > +/* famfs file ioctl opcodes */ > +#define FAMFSIOC_MAP_CREATE _IOW(FAMFSIOC_MAGIC, 1, struct famfs_ioc_map) > +#define FAMFSIOC_MAP_GET _IOR(FAMFSIOC_MAGIC, 2, struct famfs_ioc_map) > +#define FAMFSIOC_MAP_GETEXT _IOR(FAMFSIOC_MAGIC, 3, struct famfs_extent) > +#define FAMFSIOC_NOP _IO(FAMFSIOC_MAGIC, 4) > + > +#endif /* FAMFS_IOCTL_H */ -- #Randy