From nobody Mon Feb 9 13:00:15 2026 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E18633876A3 for ; Wed, 14 Jan 2026 21:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768427077; cv=none; b=JlODybXBytgcs5aF+sTDSUiLFnksyDddW16Td1HWNfsnp9O6uqXNy3R41L0JuY3a2l9i5ZnrbyDaHtkv62TZvvZwuAD+GPJnkuJh+dcaTmzvEQRAkdsBA3AB2GmTymA7sCXQON/EtRdPwNGE6NC3rCwTe4T/OX+5H8Lfzs1KmcE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768427077; c=relaxed/simple; bh=1w3TFMU+/vaY5sE0p34dspzPaMtaVRyYHuyJ2SCiYhE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RNxg+pbyZQ2RyBuHhoYsF+RSmqBRxNbBqLW4c7hSmQbkC7yPlRpaWo5zen3B014PprI+/J2OtdED5CgO6AGOJ5Ko7roOnv08KEgtigduT7sbafHMlWAWT2nEx5s74hORcwt3nkZAXShloNpPySkNVsUXaUwUoqVryCHHb10b9IA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=Groves.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Mccnpc0p; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=Groves.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Mccnpc0p" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-7cfd0f2ef93so134265a34.1 for ; Wed, 14 Jan 2026 13:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768427056; x=1769031856; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=mT0uh5MNFRoQeuCeqp5qm4knejXoLQDh1fSqDovZOWM=; b=Mccnpc0pVnLhNwDZQJrJ6mln4SCQM13N86i+Ev3J4ZMyAQkOGgUy7nk0v6IRWV8tfs 0hmi4MtFvYJljqi4Y3D3C/UpH9+TS1IphPUC97J1+UNeoo5OJOgXJ1RivfdhNYclGeqE J1vBk5dedT07Sw6inRNrMHKR61K5FuXn8gu99+UFlmakRZBLjhoszTbiwlJH8vhDZijW NzGbwqtdGJTgdPSW0Y3zzttHEHQppEqtWDVr0svXeP65sEcYLDm2ezpLhYkK99CPs3Tl lnXyeIiNutOXhzRgCR4iN5WSVwk7h8IJutlJTHvBkxVMj18hByWZ40oSWG5Wu4nRZi/L NXtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768427056; x=1769031856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mT0uh5MNFRoQeuCeqp5qm4knejXoLQDh1fSqDovZOWM=; b=gYEdJMTMyrPCmbonSHsRdvoKUdRhWU1VHhN2SR74BMcPcyRKikufMySRlYye+rFerJ c/de4ouqy5mkGi8oQMpaCV3C5omz+s1jODCPggyL4AEfzW08W/hR6bsA8PQkWdOs7k1t 4yyU/1M697Xp5NL8GKOkwTVbn/15z9DJQprbvb6bXqok4h0HsvObUW/VLsEBZAqE9N66 A6EoDm3qOaTotL/tzM7tx2p8GzrWKR6z0jfp7yfhmLB3Q9jw/viWMDnfWQHJRovCrVr9 MDN3PFZTt2l9S8P4pZPsXfY0ZjZuU8hdaNvh6HAw3IoA6xbchlLVurSNs8ivC+vYwzE7 MZxA== X-Forwarded-Encrypted: i=1; AJvYcCUxjQCa6KA2A6Tw4xSsW0Sd7NbegSdGXXWWP/dlbTjbOgQ3KLoDLAm6xRhiWSCc8sQHfFCW+h842XZu254=@vger.kernel.org X-Gm-Message-State: AOJu0YyVXOw+YZBdc74IESpK4pxFbXZybxTP3UvN2wWMac8LcMCVWEXH 5tO3eMMB/CxeEG64y2THbh1Y9EYF8qRFLNnd2yrI/vGvxetPyo88gvjX X-Gm-Gg: AY/fxX6t6CbKDZ0NJ+Flicy7OPeHHw/txo+kQR1t8DAax56gvIxlIIO8C7Lk8ZfSUjQ Ldyb1rzXmAd6IsNvbHX9avoaTbhCUbUPVD1YxzEylJ4j++r9qzHGkS8v5s1XuIf+AbeLD2Kx8e9 nszn0eZCT7tVDZhE3xRa2+ZUQwGzPb+r6TvAVh41J6WaWCSu8ZyOnfGrbpbeg+ZyzgtG8jorAVP IfXu5Fipb/htZmoSx26GnD0ymoMqcxmo75wl9+YuhLofYG5gUidrSC6YCho3EQXK7RxIStm1Nt7 G41EjCTpHVIHgenHxRrwAZ6J0zbNgMV7S5lvGCGna9WprsUQ1CJrNF0bgxlubjFkw+9MpIgTuNS xmTJYbkdbZTMvLJEJcgsWLuWkv84/mA3WdOWPU0gCJe4dgdzQHHByXJ0i8MCsiETnBQmeg/I/9E 2qRinDBHxN8KsJYrYW7jZjYIUztwo1e5GRCH6Yrsf93aeN X-Received: by 2002:a05:6830:8410:b0:7c7:65f4:1120 with SMTP id 46e09a7af769-7cfcb65e6efmr1926180a34.23.1768427056116; Wed, 14 Jan 2026 13:44:16 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:4c85:2962:e438:72c4]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7cfcd061ac6sm1958801a34.13.2026.01.14.13.44.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 14 Jan 2026 13:44:15 -0800 (PST) Sender: John Groves From: John Groves X-Google-Original-From: John Groves To: John Groves , Miklos Szeredi , Dan Williams , Bernd Schubert , Alison Schofield Cc: John Groves , Jonathan Corbet , Vishal Verma , Dave Jiang , Matthew Wilcox , Jan Kara , Alexander Viro , David Hildenbrand , Christian Brauner , "Darrick J . Wong" , Randy Dunlap , Jeff Layton , Amir Goldstein , Jonathan Cameron , Stefan Hajnoczi , Joanne Koong , Josef Bacik , Bagas Sanjaya , James Morse , Fuad Tabba , Sean Christopherson , Shivank Garg , Ackerley Tng , Gregory Price , Aravind Ramesh , Ajay Joshi , venkataravis@micron.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH V4 2/3] fuse_kernel.h: add famfs DAX fmap protocol definitions Date: Wed, 14 Jan 2026 15:43:06 -0600 Message-ID: <20260114214307.29893-3-john@groves.net> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114214307.29893-1-john@groves.net> References: <20260114153133.29420.compound@groves.net> <20260114214307.29893-1-john@groves.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add FUSE protocol version 7.46 definitions for famfs DAX file mapping: Capability flag: - FUSE_DAX_FMAP (bit 43): kernel supports DAX fmap operations New opcodes: - FUSE_GET_FMAP (54): retrieve file extent map for DAX mapping - FUSE_GET_DAXDEV (55): retrieve DAX device info by index New structures for GET_FMAP reply: - struct fuse_famfs_fmap_header: file map header with type and extent info - struct fuse_famfs_simple_ext: simple extent (device, offset, length) - struct fuse_famfs_iext: interleaved extent for striped allocations New structures for GET_DAXDEV: - struct fuse_get_daxdev_in: request DAX device by index - struct fuse_daxdev_out: DAX device name response Supporting definitions: - enum fuse_famfs_file_type: regular, superblock, or log file - enum famfs_ext_type: simple or interleaved extent type Signed-off-by: John Groves --- include/fuse_kernel.h | 88 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h index c13e1f9..7fdfc30 100644 --- a/include/fuse_kernel.h +++ b/include/fuse_kernel.h @@ -240,6 +240,19 @@ * - add FUSE_COPY_FILE_RANGE_64 * - add struct fuse_copy_file_range_out * - add FUSE_NOTIFY_PRUNE + * + * 7.46 + * - Add FUSE_DAX_FMAP capability - ability to handle in-kernel fsdax m= aps + * - Add the following structures for the GET_FMAP message reply compon= ents: + * - struct fuse_famfs_simple_ext + * - struct fuse_famfs_iext + * - struct fuse_famfs_fmap_header + * - Add the following structs for the GET_DAXDEV message and reply + * - struct fuse_get_daxdev_in + * - struct fuse_get_daxdev_out + * - Add the following enumerated types + * - enum fuse_famfs_file_type + * - enum famfs_ext_type */ =20 #ifndef _LINUX_FUSE_H @@ -448,6 +461,7 @@ struct fuse_file_lock { * FUSE_OVER_IO_URING: Indicate that client supports io-uring * FUSE_REQUEST_TIMEOUT: kernel supports timing out requests. * init_out.request_timeout contains the timeout (in secs) + * FUSE_DAX_FMAP: kernel supports dev_dax_iomap (aka famfs) fmaps */ #define FUSE_ASYNC_READ (1 << 0) #define FUSE_POSIX_LOCKS (1 << 1) @@ -495,6 +509,7 @@ struct fuse_file_lock { #define FUSE_ALLOW_IDMAP (1ULL << 40) #define FUSE_OVER_IO_URING (1ULL << 41) #define FUSE_REQUEST_TIMEOUT (1ULL << 42) +#define FUSE_DAX_FMAP (1ULL << 43) =20 /** * CUSE INIT request/reply flags @@ -664,6 +679,10 @@ enum fuse_opcode { FUSE_STATX =3D 52, FUSE_COPY_FILE_RANGE_64 =3D 53, =20 + /* Famfs / devdax opcodes */ + FUSE_GET_FMAP =3D 54, + FUSE_GET_DAXDEV =3D 55, + /* CUSE specific operations */ CUSE_INIT =3D 4096, =20 @@ -1308,4 +1327,73 @@ struct fuse_uring_cmd_req { uint8_t padding[6]; }; =20 +/* Famfs fmap message components */ + +#define FAMFS_FMAP_VERSION 1 + +#define FAMFS_FMAP_MAX 32768 /* Largest supported fmap message */ +#define FUSE_FAMFS_MAX_EXTENTS 32 +#define FUSE_FAMFS_MAX_STRIPS 32 + +enum fuse_famfs_file_type { + FUSE_FAMFS_FILE_REG, + FUSE_FAMFS_FILE_SUPERBLOCK, + FUSE_FAMFS_FILE_LOG, +}; + +enum famfs_ext_type { + FUSE_FAMFS_EXT_SIMPLE =3D 0, + FUSE_FAMFS_EXT_INTERLEAVE =3D 1, +}; + +struct fuse_famfs_simple_ext { + uint32_t se_devindex; + uint32_t reserved; + uint64_t se_offset; + uint64_t se_len; +}; + +struct fuse_famfs_iext { /* Interleaved extent */ + uint32_t ie_nstrips; + uint32_t ie_chunk_size; + uint64_t ie_nbytes; /* Total bytes for this interleaved_ext; + * sum of strips may be more + */ + uint64_t reserved; +}; + +struct fuse_famfs_fmap_header { + uint8_t file_type; /* enum famfs_file_type */ + uint8_t reserved; + uint16_t fmap_version; + uint32_t ext_type; /* enum famfs_log_ext_type */ + uint32_t nextents; + uint32_t reserved0; + uint64_t file_size; + uint64_t reserved1; +}; + +struct fuse_get_daxdev_in { + uint32_t daxdev_num; +}; + +#define DAXDEV_NAME_MAX 256 + +/* fuse_daxdev_out has enough space for a uuid if we need it */ +struct fuse_daxdev_out { + uint16_t index; + uint16_t reserved; + uint32_t reserved2; + uint64_t reserved3; + uint64_t reserved4; + char name[DAXDEV_NAME_MAX]; +}; + +static __inline__ int32_t fmap_msg_min_size(void) +{ + /* Smallest fmap message is a header plus one simple extent */ + return (sizeof(struct fuse_famfs_fmap_header) + + sizeof(struct fuse_famfs_simple_ext)); +} + #endif /* _LINUX_FUSE_H */ --=20 2.52.0