From nobody Sun Feb 8 05:29:08 2026 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (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 C51FE38F93A for ; Wed, 14 Jan 2026 21:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768427039; cv=none; b=Ta4xwUoUzukWc8zEuQ6atuR1YBZNKe7VyGCwKr7mh5nDw+IWd5FqMlzqtJGxZq6XqFqae0M9uy7bOcF6VtlvbWjZnVZrJdEHFiOiWjnVWNEtO1A4rhYAvmxr/lxhg+/tDRW9tPVqS0cSSHDoXUl/AcBkorwOoFnG30BcvS96FsY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768427039; c=relaxed/simple; bh=6IXyikUrXXga0w+XTOVh8PGo9rM6Mf6O+h0Sd4yHab4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CK/ZgE7OoRLoYuubd2DnLkdgcFQo5OatouDKQ8X5LcAu96cSY7ijB18L4XzSkONp3XvGvZAuIcHaSvqkiyF705ZXisu2rfYIJhf+pTXsgYLz9avB4H/1UAwzu8slLqcVwk6NbxkG8qbsqGWCQsNN3YG+xNG1WbMpstVnGdQ5+gg= 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=DwAksuye; arc=none smtp.client-ip=209.85.210.50 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="DwAksuye" Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-7c75fc222c3so164607a34.0 for ; Wed, 14 Jan 2026 13:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768427023; x=1769031823; 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=KokXwqCF3cjj7h8MwPrV07VxZRdfFYCa5Cm5tvCoTf0=; b=DwAksuyem4fEXByAYX/OKg/0P0/Ha1dtdmlvYZE+UKXX7YyZhN6fgvtGrdB1rdORUR JYGbLkRMbFZiHz2y/aRbCY+WLcRwNL7CXT0eUHAYgo6HV+q8lpX1KviYMFS/BE7mNHGk uyH986y0xx/kzFtWryKbAN9a5V1E+Jl3Mm7y5ym+XXz5kbjSeR2t3iwG40PFZZElLFHn 26IlsFBc5TWc/7ZiOL422nsR/U8knSTp40kFKtyt2oAWo9N5sNTgSgPA/2ieckJvpcJD yQ70eaExuqB3Xs/c0UplQHbP9DgRJGwkfpx2CiMo0vveGX7b6miuFZlcKRl1iwukA1KD ZCuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768427023; x=1769031823; 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=KokXwqCF3cjj7h8MwPrV07VxZRdfFYCa5Cm5tvCoTf0=; b=l5FJyy8gw6imyDHdHNqeyTXzH92UHpc5WgJrO7Q5WOWUvp0l0v7VGW2npWdPbopEOY MCrMp/01UBa6sr4M4j7+5RP24HpD8j1QfJuXmOHe9bnf6/wBOXlI6AMZ9AB59e1jz7Qv jKq0n8MVNvI6KEGWDuASjVIq3xi0VSSFOWJRSMMXC9IDy2nmFE0/072+qtH7bpo0VdSE AgUGe8CSb3BxNaU6jRse3TrpwZY7ML2NI+v8wjqHX7bFCMeXI1KTBzIP1+M6krhWzlBR KUZMI2JSCZIe5xEqTGyXgeKUGrgYppiuz/obyJPVT5S9grbk7ZZBr0wg6/ZTEKDmL/ga uiRQ== X-Forwarded-Encrypted: i=1; AJvYcCU5Sr04hqJgCxudHXrXw1UKWsDOcSauA2F2amdlJLq0qfwHbWE0CIQ31UOO+MYffKYs6lF+2EwY8iYOq50=@vger.kernel.org X-Gm-Message-State: AOJu0YxwljYtYixFkPc4OuUhr42P6H9ewbLkGWdMG2eqH7iR/sxwjDYT 89BXH7kXgjwC9sqYrXvB0Zz7CY0TFJg7izteWGg0czyIdxS43rFbP0sm X-Gm-Gg: AY/fxX6zL9sUVOp1T1IUCcRbjLudGsH1QztOa9/FOhpk06rIo9sTmo4ArUxjpgdmWLJ h6RCtLvS0lCe5M+I/3/wLJTT2/jJY5DEN8puQRCSGSljxynLY8GmSivU7UrBiwx/7CISTCn5ZsD RU9HDdtredLDwMfOaMFyg2Ou/9hENJVz92ybpFZUMk3pbXpkt8GZ4NbLHsnRpo/uDs9QBJ5Y6Ck YVJcRhgBumACIvAOO91R5ZGq90F4lD1FmwPa77ulYKz1TU07LJCYyJUTJqgKhUS8bRirppErt2/ QYZsCFGI2JMlbgQHdvTh1JylC+Hj0yAvHgcFglt2IJJ8Q5nZw2EUsyIpxaZYKTa2Z4ZUxjACQHw D7Wz7Yfsxi5zEFcovPrhY+Ce+q9Z2HG+is7VukMyuW9rWbs4qiJoG6WICUjC8xOCZ9kGJXhW2/b JQRHOYLAiNRAry+kdENZ4RGCn/WNTFivlLsqEfRV901cla X-Received: by 2002:a05:6808:229f:b0:450:ad22:f9ee with SMTP id 5614622812f47-45c712da165mr2717268b6e.10.1768427023109; Wed, 14 Jan 2026 13:43:43 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:4c85:2962:e438:72c4]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-3ffa515f4dasm17619569fac.21.2026.01.14.13.43.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 14 Jan 2026 13:43:42 -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 1/3] fuse_kernel.h: bring up to baseline 6.19 Date: Wed, 14 Jan 2026 15:43:05 -0600 Message-ID: <20260114214307.29893-2-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" This is copied from include/uapi/linux/fuse.h in 6.19 with no changes. Signed-off-by: John Groves --- include/fuse_kernel.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h index 94621f6..c13e1f9 100644 --- a/include/fuse_kernel.h +++ b/include/fuse_kernel.h @@ -239,6 +239,7 @@ * 7.45 * - add FUSE_COPY_FILE_RANGE_64 * - add struct fuse_copy_file_range_out + * - add FUSE_NOTIFY_PRUNE */ =20 #ifndef _LINUX_FUSE_H @@ -680,7 +681,7 @@ enum fuse_notify_code { FUSE_NOTIFY_DELETE =3D 6, FUSE_NOTIFY_RESEND =3D 7, FUSE_NOTIFY_INC_EPOCH =3D 8, - FUSE_NOTIFY_CODE_MAX, + FUSE_NOTIFY_PRUNE =3D 9, }; =20 /* The read buffer is required to be at least 8k, but may be much larger */ @@ -1119,6 +1120,12 @@ struct fuse_notify_retrieve_in { uint64_t dummy4; }; =20 +struct fuse_notify_prune_out { + uint32_t count; + uint32_t padding; + uint64_t spare; +}; + struct fuse_backing_map { int32_t fd; uint32_t flags; @@ -1131,6 +1138,7 @@ struct fuse_backing_map { #define FUSE_DEV_IOC_BACKING_OPEN _IOW(FUSE_DEV_IOC_MAGIC, 1, \ struct fuse_backing_map) #define FUSE_DEV_IOC_BACKING_CLOSE _IOW(FUSE_DEV_IOC_MAGIC, 2, uint32_t) +#define FUSE_DEV_IOC_SYNC_INIT _IO(FUSE_DEV_IOC_MAGIC, 3) =20 struct fuse_lseek_in { uint64_t fh; --=20 2.52.0 From nobody Sun Feb 8 05:29:08 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 From nobody Sun Feb 8 05:29:08 2026 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (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 0782B38E11A for ; Wed, 14 Jan 2026 21:44:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768427113; cv=none; b=UlTnVfLzGTLgLOB+idDgZHRd1UI9ZDC9J5W4csSw7yAd1HyB/r7roBFQLeC1SwqWdz/Y26iErDWx7gOnvjYYJd581g6pt8EjZXrHmFM/740Yy+wRSOFF4sQmEIF6I+NcswhrY46xJouidkCijrPhsoXh7iWPbfGymilvzD80EgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768427113; c=relaxed/simple; bh=64imX2M1jBYG4Gju+wyYxzFrGS9hKawBE1V6rd+WCwk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xu4Zj5rywEbIw/baub+1LHgFlvYQLc7h7JUGL7amAJgUsHTx/Yu8yNvqzvmJb+4YXXrpEw1mswb1CJYDGcKhLNg90bjgJBtwHSEgGxaMXrrm9efgKoDoRTvGrCNl+22ecnUMfORv55y0YDdttHIwssMCqukW6TOovQij9CdqK9s= 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=MbGKgdOT; arc=none smtp.client-ip=209.85.210.48 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="MbGKgdOT" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-7cfd2be567bso185282a34.2 for ; Wed, 14 Jan 2026 13:44:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768427089; x=1769031889; 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=zCMfzYseGdgpcfKs/nbqdFGXhkfjkf3otWuk3WOoJPo=; b=MbGKgdOTyaVzus5T0n2oCJF2FlfdxZERuQaae79BIw6gj3XXzAM4w6zlDlvLrtdIRB eqO5gZV3uw49rpkISrFHcaTJa70piad/3Pp5T2/JzhkwtmjY4K7eajAcbOZQvNHlbLWZ UEUPYHgYo893UBPoZeFXkX91sTuhuMbLAW6FGEfcgLFPbZd19vOVg/tIWSDTVVn3iKuI q8eDgy2cfYoRk+WA4yuoA3jXcH5+p6NroPUikQwdJsDFNs57GMRmGzWc2XPlb3De9UoT 8TGPzi3wkqLOkLOMDRf4x5+p9B4DHDAi3S1QYaqI26YbU4g8+cYPZuXXfem5i3arczz8 lgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768427089; x=1769031889; 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=zCMfzYseGdgpcfKs/nbqdFGXhkfjkf3otWuk3WOoJPo=; b=WMvD1Zi3YrAmgdT8+APZS/VsekmC76GEY7ewSC8AGucRlL01IpRKioL6lKSRzjGiv5 ZxyrCUN3mX1z53TWLAfliKd24uaXXSafr+4qJBBdvHbJspa7JwcVCsWecdam15y3/UCE 7/k1gJNdSKAt/twSGcV6HilQKKZ3ENXtM1Lc0rUEnbV2fZOg+6w59RjYnL5F07/D7PvC ceVubFJ4heBXxo91jQBXwidizxK/cK/deQAuserqpszFxRhvs9zpGqM/RZxRve5lmS0l ZTTljc9/6baORU6qV653l8RGXCdb1FVlBr1jgrOv+NXNwDtOYTUwCNHw8dqZRFBzYFCQ rexQ== X-Forwarded-Encrypted: i=1; AJvYcCX/62aa3WPXaGQjTUjyW5NHsvgTcr4OySr1NB71eML/YtWbC90Ye2mnWWQEgUUSPJyrqnyaK9YVTFxdDMc=@vger.kernel.org X-Gm-Message-State: AOJu0YyOELbOTE5uY/FZP1MPzFhJ2g58GuK/NW0cOn04q6aO1JbvisSy nqpkrSSE4IZAoNxcLVhrkKjjGSpqTgBzfiFyQXqr8zsTtRBQ9YLUr0HS X-Gm-Gg: AY/fxX5EOBETEcgzphqHP8RYRGYlI9njiYq9bE6hAdAIVXAMrBMYiqkRlBi7SR9DwBZ /s4lGts3YM1Db9ot8E6AdZN7vzFQ4YFALnwaSwhTjbxKba2GVIrMJhqbBL+yk6N+w53OEiE2ZLh KwnTOCkQf/2Fe8zB9N8CMbvv/Q0a7NHRovk/KLK3zEN6+fhL+PDWBk9BE22spE8tenVxyKEHQ8L jywAwPlWs63dzSfIQo/3bXzul8DRav2ZuoZh7K/7FhRY4wWN6aHjKs/0UDpPkTWqYsr49iXLUb4 PsvXufdlFfIsENr5FWjojopyDGZcPpz/DrGlnGXnbDh7IImBiSh07R3HG/XJ84rqu+jY9Mpm5lm otXT4kut3kEJ0CI/mR+O0l8H2V5AjH/9bevXRTPnPrViex5FeqtaUylSnvGC7gr1MlstRKvK6sU A9fQK8yHKZxqpNWWtiBZA6COl55pym9WuF7/cq/Wyrj1kY X-Received: by 2002:a05:6808:158f:b0:45a:8cdc:102e with SMTP id 5614622812f47-45c714aa671mr2464387b6e.23.1768427088755; Wed, 14 Jan 2026 13:44:48 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:4c85:2962:e438:72c4]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e17cd0esm11964602b6e.3.2026.01.14.13.44.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 14 Jan 2026 13:44:48 -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 3/3] fuse: add famfs DAX fmap support Date: Wed, 14 Jan 2026 15:43:07 -0600 Message-ID: <20260114214307.29893-4-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 new FUSE operations and capability for famfs DAX file mapping: - FUSE_CAP_DAX_FMAP: New capability flag at bit 32 (using want_ext/capable_= ext fields) to indicate kernel and userspace support for DAX fmaps - GET_FMAP: New operation to retrieve a file map for DAX-mapped files. Returns a fuse_famfs_fmap_header followed by simple or interleaved extent descriptors. The kernel passes the file size as an argument. - GET_DAXDEV: New operation to retrieve DAX device info by index. Called when GET_FMAP returns an fmap referencing a previously unknown DAX device. These operations enable FUSE filesystems to provide direct access mappings to persistent memory, allowing the kernel to map files directly to DAX devices without page cache intermediation. Signed-off-by: John Groves --- include/fuse_common.h | 5 +++++ include/fuse_lowlevel.h | 37 +++++++++++++++++++++++++++++++++++++ lib/fuse_lowlevel.c | 31 ++++++++++++++++++++++++++++++- patch/maintainers.txt | 0 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 patch/maintainers.txt diff --git a/include/fuse_common.h b/include/fuse_common.h index 041188e..23b24e8 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -512,6 +512,11 @@ struct fuse_loop_config_v1 { */ #define FUSE_CAP_OVER_IO_URING (1UL << 31) =20 +/** + * handle files that use famfs dax fmaps + */ +#define FUSE_CAP_DAX_FMAP (1UL << 32) + /** * Ioctl flags * diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 016f831..a94436a 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -1341,6 +1341,43 @@ struct fuse_lowlevel_ops { */ void (*statx)(fuse_req_t req, fuse_ino_t ino, int flags, int mask, struct fuse_file_info *fi); + + /** + * Get a famfs/devdax/fsdax fmap + * + * Retrieve a file map (aka fmap) for a previously looked-up file. + * The fmap is serialized into the buffer, anchored by + * struct fuse_famfs_fmap_header, followed by one or more + * structs fuse_famfs_simple_ext, or fuse_famfs_iext (which itself + * is followed by one or more fuse_famfs_simple_ext... + * + * Valid replies: + * fuse_reply_buf (TODO: variable-size reply) + * fuse_reply_err + * + * @param req request handle + * @param ino the inode number + */ + void (*get_fmap) (fuse_req_t req, fuse_ino_t ino, size_t size); + + /** + * Get a daxdev by index + * + * Retrieve info on a daxdev by index. This will be called any time + * GET_FMAP has returned a file map that references a previously + * unused daxdev. struct famfs_simple_ext, which is used for all + * resolutions to daxdev offsets, references daxdevs by index. + * In user space we maintain a master list of all referenced daxdevs + * by index, which is queried by get_daxdev. + * + * Valid replies: + * fuse_reply_buf + * fuse_reply_err + * + * @param req request handle + * @param ino the index of the daxdev + */ + void (*get_daxdev) (fuse_req_t req, int daxdev_index); }; =20 /** diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 0cde3d4..ac78233 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2769,7 +2769,8 @@ _do_init(fuse_req_t req, const fuse_ino_t nodeid, con= st void *op_in, se->conn.capable_ext |=3D FUSE_CAP_NO_EXPORT_SUPPORT; if (inargflags & FUSE_OVER_IO_URING) se->conn.capable_ext |=3D FUSE_CAP_OVER_IO_URING; - + if (inargflags & FUSE_DAX_FMAP) + se->conn.capable_ext |=3D FUSE_CAP_DAX_FMAP; } else { se->conn.max_readahead =3D 0; } @@ -2932,6 +2933,8 @@ _do_init(fuse_req_t req, const fuse_ino_t nodeid, con= st void *op_in, outargflags |=3D FUSE_REQUEST_TIMEOUT; outarg.request_timeout =3D se->conn.request_timeout; } + if (se->conn.want_ext & FUSE_CAP_DAX_FMAP) + outargflags |=3D FUSE_DAX_FMAP; =20 outarg.max_readahead =3D se->conn.max_readahead; outarg.max_write =3D se->conn.max_write; @@ -3035,6 +3038,30 @@ static void do_destroy(fuse_req_t req, fuse_ino_t no= deid, const void *inarg) _do_destroy(req, nodeid, inarg, NULL); } =20 +static void +do_get_fmap(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) +{ + struct fuse_session *se =3D req->se; + struct fuse_getxattr_in *arg =3D (struct fuse_getxattr_in *) inarg; + + if (se->op.get_fmap) + se->op.get_fmap(req, nodeid, arg->size); + else + fuse_reply_err(req, -EOPNOTSUPP); +} + +static void +do_get_daxdev(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) +{ + struct fuse_session *se =3D req->se; + (void)inarg; + + if (se->op.get_daxdev) + se->op.get_daxdev(req, nodeid); /* Use nodeid as daxdev_index */ + else + fuse_reply_err(req, -EOPNOTSUPP); +} + static void list_del_nreq(struct fuse_notify_req *nreq) { struct fuse_notify_req *prev =3D nreq->prev; @@ -3470,6 +3497,8 @@ static struct { [FUSE_LSEEK] =3D { do_lseek, "LSEEK" }, [FUSE_STATX] =3D { do_statx, "STATX" }, [CUSE_INIT] =3D { cuse_lowlevel_init, "CUSE_INIT" }, + [FUSE_GET_FMAP] =3D { do_get_fmap, "GET_FMAP" }, + [FUSE_GET_DAXDEV] =3D { do_get_daxdev, "GET_DAXDEV" }, }; =20 static struct { diff --git a/patch/maintainers.txt b/patch/maintainers.txt new file mode 100644 index 0000000..e69de29 --=20 2.52.0