From nobody Sat Feb 7 18:21:28 2026 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (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 9BBA23986E9 for ; Wed, 7 Jan 2026 15:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800094; cv=none; b=nBUFUrxSfe6jJ0cTrezNxsL1iRSg6Txu3wVGEnaHG0UEjoNU4ukdKh2PVAgQ/6rO/Xmj+/et2kZREoJe1Q2q6XhawK1u523veQufsNsxTw5kXnJeJLwy6JdSW21f0HJD3ApAtI+i2gsjkivqXTkiSJqeNmsJSN9QwT0f+xDdQGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800094; c=relaxed/simple; bh=rKi3IJhFbcB0WLwepeKv+pU0rou+ccXKzIoDaJEyXMs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QvMS/KkbothvQ0K3tZSSvQGt8dCGfuDtmRagQHxl/FbbEhhHNOuDbLsVKihcKMr2dn7j7Zkib7ZlJ57vccfKawe0u8PNERQDVt98+VZeH1QNwfgXdP8nrvD86VfiqxD46U316772eIaQgfYDI1/LnEMz7wp5mBiQsIlrCq7mDDg= 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=ly49VzPY; arc=none smtp.client-ip=209.85.167.180 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="ly49VzPY" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-45358572a11so1326573b6e.3 for ; Wed, 07 Jan 2026 07:34:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767800091; x=1768404891; 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=kBCgapkD0tMSytl4lZx+vzryyZ4HeCqXI7xZ8qhc6V8=; b=ly49VzPYANUzc4j6Fa74Vb7c8LJg8YOCWp9nko3fCKp8W7fEHEMbGvhTSjW1LR+91X MPKNfX4LhmaWLjxEhiVbt+gtbC/AvwLZrnL5jSaOeNuYtNtEtIXolqUBy3UnPYYdRi0/ krsjGYCO+5Cjf6dYggYiSyDdbDeLMRM7zsd3X/4Wzha8YOfEx9iwPbdFqCahL/XxYiSZ xNebf/mo50lKjtx9lHy6PlZIVTlI90bqAsNVXmKOzY4GlDoAhs9meIRJuqRu8p5JLjbA lkg0IDKgVc/n8XUmGFX3PnUnIh2dbXh5JkslWJ4p6mfhplkTrAy/+QjrGXz/7EA8XKxf v9LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767800091; x=1768404891; 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=kBCgapkD0tMSytl4lZx+vzryyZ4HeCqXI7xZ8qhc6V8=; b=goNYCoBH5/Dv9qdxKVW14op+rwodzECDaTKnfL9TMo4/n6AmxfU0RF8Z8mGiyX4gzB sWdaT47vmJK6ZyvfyYBUoFt1EKbrBN1yo6ziwHHYN3G9ZTHeY+XOFpLExCe/CMdJB/6l K2WsZhTB+uN4rDCTNEM5+ug3jY21jdYUW77VNOaXA0CP4Wl3SEQ9zd9XazOwBAtnukZA u0RLbSojm9c01mHhwgovL6DED91qa49wNPdoWu9ix4sRX9fBPuYW+jmXl+9QRC1nZ95b 0hHJOmi3yX0LxLOLkS3rwpYE7sq8Wa3lxRr9ukU0rL6Csr2vypXQPwRQa4sGOxRFsoyi bCUA== X-Forwarded-Encrypted: i=1; AJvYcCVQH4BPl/QTrKvsprH6rjBg3ai3/Jaiml4/2YOXT8mJgGGlYC1OhuH79h/zQ8sTIjbKIvO2onAC8YBop0Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yzy1hTdlBdBDXTjsl/GfgNs4DaxIigH1UywMbDJ7i7E68lWuhTJ UQD/JsFC3TDUMAGyfI+buvugL0vrMyOUGzrq8IS9FEdxQdhGhR/RTN02 X-Gm-Gg: AY/fxX52dqr5GzSFMWuP5vpBSJ9cQbOls9KhXjXDOEKTXw6r3oM4mfIAuBLms0ZALhF kOSahiTs5JB6iiU85rmuqMKJcTzJ9M0k0LTSb6Y9LHNu6bqUJyYt6VhdW8ZaKocFDs88/4LtgvN CsTZRg2eeshuAoZVPP5/cWczWD8KDKcW04OKQSBYFG8lPe5/oqVAhO2bBu1TrOPeXONlDAGtdt0 CKLnbUYMKonIKhemOWefaI7t/K2dWytGUY894DCudhWIzaC1F0o6RG4FW29zYvyKf1rw2wR07i5 6UXe+izbc7/ne901DIIjbIGji6qLmWqvrNKauk6uEhihXzZ2CqLrklMybIf/BuA6sWhirERKryy 0TGE0S0JdN3WUgQbptX4UZSFM3VB4bN7qYuLJJk6oWtx31CQ5DkG02o5DenFS3rAe22iSOj8/R1 HxplV9pQuhZLnESuFguyMNPZB5BlqXlMkgMfnsFHK/IG9Z X-Google-Smtp-Source: AGHT+IHcdywbJhWbPofmdnwqwy3siWxMKS2ZL8FYrwKJtzA3ot5XniZZCZFcJRodTSEL4vBFeFPTwA== X-Received: by 2002:a05:6808:4a52:20b0:45a:76c9:303c with SMTP id 5614622812f47-45a76c9325cmr272281b6e.32.1767800091392; Wed, 07 Jan 2026 07:34:51 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:a917:5124:7300:7cef]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e183ac3sm2398424b6e.4.2026.01.07.07.34.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Jan 2026 07:34:50 -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 , Chen Linxuan , 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, John Groves Subject: [PATCH V3 1/4] fuse_kernel.h: bring up to baseline 6.19 Date: Wed, 7 Jan 2026 09:34:40 -0600 Message-ID: <20260107153443.64794-2-john@groves.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260107153443.64794-1-john@groves.net> References: <20260107153244.64703-1-john@groves.net> <20260107153443.64794-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.49.0 From nobody Sat Feb 7 18:21:28 2026 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (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 8AE803986ED for ; Wed, 7 Jan 2026 15:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800098; cv=none; b=Co7VKMN7UxfjKW8pzel2pHbIwZWT6+4LZpPwlfyKgRVzefJsZ9QRcpEJqKmq2w8dKbRA9fKdw7r5RpiGXJuD+2h3yITUpqMjWy1KzAPNs2mQFAsv/og/ZjB6t3pR1LLB1bkGRbzmCqqbPRo2l4vFFKwMgIxrADvj0iFiTURDzPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800098; c=relaxed/simple; bh=vRum9MOJIbnk5V10fy2a3HtDPMHvk45XsqC1Kt9gTgQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nYMf9w9uu5TZ9tc5hkTGaODr7y/6RtRfml+nuQyM6O5yFR0tHIgKT0z6PgwCBCncwRINhbwqAwELhGh8djbgObazLQAfIx2F6PqthDBcRx5KLlkEDJZ++gS+BB5IZLktWXDqBjJGrqovz/H9gL9igAwMtPr0KpHwq2XLyYBsYCo= 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=BjFzTIUj; arc=none smtp.client-ip=209.85.167.174 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="BjFzTIUj" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-450063be247so996508b6e.2 for ; Wed, 07 Jan 2026 07:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767800094; x=1768404894; 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=AgHZ9K8s1Kd63AAlsULJaWt5wwYk3G9jV8eBPFKbz1s=; b=BjFzTIUjkYpx6wOsG9e0FAo2iFBu0Uh4VZwYzEjZbSko/1UaFMXNZ8CKe0I231aUDI Sz4QOoQ+WR1prTMm257yO/NB2prFPiMo7wDBbj9HhPtbM9wyxHtPpbB1oRLwlEmXsOnh obavnCzloKMJ0QN3m3IRWq/4afbVbYeE7jerw3gCzG1KQs+40NfyyJ6OGyS7dSBGdz8U cHAym38Ysnj5iG1tTIorWb4Do6iE5X3vYOvwBRM9MtePaeXepf9ei8q40DKnVuQwZ+4P rMwHXdx/LxJ64Q692IGXt3gvZ22cTs4FdG0N0TMv/yfhREBu3JBtmSep8RU+61H6cGsX IgrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767800094; x=1768404894; 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=AgHZ9K8s1Kd63AAlsULJaWt5wwYk3G9jV8eBPFKbz1s=; b=fpwjvatUgkHby4Qj0hdjZSuGNV0AvqXpLI0XBiej93ui2qO9s0Z336AclTyL80dzSL 3BPBu4urRjCJwX8bkLiRz6XFqfY3YNjtIvaxZRgIGyWkHwJMhPD53yoHFdnlVvbzodPh aTyAR4MNMfsnMHuynCOmly8scFFrlM/rGqUyoF4MRlfhBlB4HMfQBcD1qS4C1fyEUeb/ lnkjTK0/+esxaM+0eL+4eBLFuYE56kaX5o0R6NHCM8wwLxcJc6DdtD1XVGOwHHCYjlgE xwHNTW+nHtjl9Mewgc7J8waPkzzKBnz3ytigm4ESBEy5hVPU7EvUBAlAd0+OjkWeIlU7 yC1g== X-Forwarded-Encrypted: i=1; AJvYcCXhehLXHzZwjmSdmKluHmfFEY9k3rxbqY2ESUMiLlWMogG0mxfGLP3QoZVPc5riobgDlxRNb9Lf7tfFzj4=@vger.kernel.org X-Gm-Message-State: AOJu0YwiEcTOWtQJhYf2jMtopXYjV96qugE8IA7ieqn9jHMlZNuJ5/Ih XQqnO+ZDGT60AFyJ7rCdXI/iLLeVe6REjAZJk4/7RA+yf/Au//IFGPoR X-Gm-Gg: AY/fxX5g5NA4UlNi0ZrYcH4m/fzxgSaiIIyTsByCyVrjacc2D4zpF9giG3Qshb7/+8j jcHZcJq3lH5oUeQU4V/+al/EsJJ9tvAc3v+e56lJYE7ohJ+q8gdO6R2KI89zk4YIXqwjCEgfMVL NHQNSXgqCTis/0kotXYY+Kf+tcIQWjtCTHJCCQXUaaSrnzth8MZVHDSq9BsSeqw7rDG2/sbcesY GdXz0P6rgntoievz/9dBkhYhS7dSElHvfHSli31bURSvY9fAw2WNKHDcq8MKBTOjpBAiiY+tEoX VRloRAKZlDsTwZqDfbkpkZhwrccaeCX9hILfKRQdBBASiKvhcObOgcqwSM4BM6gKDE9tSgfyT5F bH0J2cOj4SC6R6mUM/xVclGfjB4GwcMf+lBDNuuAGViKjZJJ5IbsEWUoUo+HEidQ56hrI/QZYlJ fttokisjmlwxAYQplqgurtlr9fatHZL6TcndO4OUpd48dFJkdkNqI+UPA= X-Google-Smtp-Source: AGHT+IEctONtJN8X6RkDy3vlMMfCQL9fRHlA6U9Vq5ZhSHzcHAHtRbTqbeZMB15NbJe9BeCbtXIxAQ== X-Received: by 2002:a05:6808:16a2:b0:450:340:2693 with SMTP id 5614622812f47-45a6bee4000mr1183862b6e.42.1767800094073; Wed, 07 Jan 2026 07:34:54 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:a917:5124:7300:7cef]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e183ac3sm2398424b6e.4.2026.01.07.07.34.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Jan 2026 07:34:53 -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 , Chen Linxuan , 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, John Groves Subject: [PATCH V3 2/4] fuse_kernel.h: add famfs DAX fmap protocol definitions Date: Wed, 7 Jan 2026 09:34:41 -0600 Message-ID: <20260107153443.64794-3-john@groves.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260107153443.64794-1-john@groves.net> References: <20260107153244.64703-1-john@groves.net> <20260107153443.64794-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.49.0 From nobody Sat Feb 7 18:21:28 2026 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 09362398702 for ; Wed, 7 Jan 2026 15:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800099; cv=none; b=IsDndFIJ+qk62OSXmF3XdeWaNSUl3xQ89v1hyumM77ZkZ/EgKMeUbB3FT7gcFFlVLl0a6Tlmlr1wLR85zWCtVEFJXnhjdLewCMvLQHAFWFiLbeMzoQ91ZyMVH+XJtEgq23qUpNM3pPKIeqR/lkQoafDNhxElXA7tzcuVuYgTggs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800099; c=relaxed/simple; bh=3CO44iNrPAkdfYLxe1mcSvtJfmua9dBTiPyw/Zw6zgo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vEmmLkVqJWgw0E4bWKJAl2yPaIv6RvlcajhuLg1jtyz1iCWMJkvetJElGVU/sfDcWTMcoEFtLaFFwx4EizLZyk2dvjel7thSmMG6PeZcvhViUUTrD2jBpbtXBoqFr9UqDHR1Oc6PTpIuiwlsktOMRodQIzxiOpy7E5eBpe2Bz6s= 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=UlyzrF/X; arc=none smtp.client-ip=209.85.167.173 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="UlyzrF/X" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-4510974a6bbso901928b6e.3 for ; Wed, 07 Jan 2026 07:34:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767800097; x=1768404897; 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=3n8Kb47Rl130Byxu0ad+8SvRWtkqSvh8ZeidUsu8Q2I=; b=UlyzrF/XmN05HA8PEjpbuqMKIxx6O8wSt2fCFJoABez6wlizZ79QjgpsYRx/PagwSv aFSZzo0XW7wjrLvKNUbPNWYGGdtU0/YPxOJbWREdy1/XecdFZNmiL85RnhW+HvdjT4uI WGo8FT0h1ziCxDr0ibrUqSNq9TnHnncITTFvgYI3O3d9nZhM9BB/0KvupT6d5TlNYykt 5auxcqE3iDkoH2Btc7JA9ecrgsh/VNTLoNfp3hFq1IQb70zhvXL2ixaTfkQr+/DMuhVj yl981S+hkIE3mf2MImnTIMl8GzQ0akcPzC+l5xu8jUWWIXH9OYGdiSLi8l8JOVvbY+cE P3Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767800097; x=1768404897; 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=3n8Kb47Rl130Byxu0ad+8SvRWtkqSvh8ZeidUsu8Q2I=; b=q/4tP3HkYGAy77R9OFZG2dM7GzAUZNWFt6K9Osp/AHSHzuYyQLDd02kZ2d3DwYUHjG Ggzn7xPs/mfnbKqvEjFB2Nqg8wH8Dc7bDB95R8oBX3T91v4G6eh43FUOwLbA0Xj5TCPf 1B5rpk2tgphkVppheqZ40V/1bpTU2Bw2siEomeBBpzt/QcsxSLAYXsposJ9nMFV8blHD QBTwe00/VKxyjx7eUSsRolNbAZGH/Wl+cVYrng6VYOaQGGoGITqk5DpxFtYyoAsb+ur7 yMv2kloekUwoa5649X/yz68tJX07v6kICA6Vc7h87t/2lpAsI8+wi/dXZkHOxcQA5LGt WDmQ== X-Forwarded-Encrypted: i=1; AJvYcCXLI1QnuRIa5JdJktyKCQChZq2xR4EKRq+mEeWchy+B74lScXgDTYb9yn57NGriXpvH0Su0fRe2qnEsatw=@vger.kernel.org X-Gm-Message-State: AOJu0YzwA/UpZcg+RkH83BdsxiTyMjY4IkI9nKTnXiPvJjeVJ4rFMWdX N9YA/YYE1TEANBUfomS/XFFoUX02tilMcp2t1TKOwh5W0ayY4aNJ+DV9 X-Gm-Gg: AY/fxX7lVKqfCUPAVPw1DFWHUk3m5M/bfTkOuLxZOKhFr/1bgUN+iij4n6x2thLmKR8 oFbH27aNFAQTOx5u3ae4DqTxfB/+Grj5ozPkZhCZxqJ4oFZ5WeZvTi5mS3f07cV9Po4TyRHCd1U P+q4cX1NJmWpmsh0nHt1QG/HfvomaT4AfzCGEh7avotqu6jzPioP3nWM75D3ZFO4CojRqF7Fgc4 5H2TiLDT+L4MEzglumPxBRoiKAID3nVXyLSl0ULBBMm1ocJJanQKRiWDdJB1WOks/Q/iDz7b7IL kzMlH98PsLfGPKgMDUIpEbw+RNagKQcnMp7jkhw2VqL90ekqzu8SmS0AS530MbH6WG5Lraw2UVV YtGsgyVrMWuBdxbqO52RVibGJd2UjQlS0oW8DXkFOvCUqp/WgLYPCb6bTTGcXPjOyy3mtNuNGPj n/EAmK692ej+LflOzggW9tp1d97jDb/gu5PLlOUw7k4lba X-Google-Smtp-Source: AGHT+IEkv++nP1XZgFGglQlyqUlGW3kCUi7rPnay9ZMhKErbt4qPcz86yrkR1ubRTqfHLlOPMJj8bg== X-Received: by 2002:a05:6808:16a8:b0:45a:55e6:f5d6 with SMTP id 5614622812f47-45a6bd87897mr1217540b6e.12.1767800096765; Wed, 07 Jan 2026 07:34:56 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:a917:5124:7300:7cef]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e183ac3sm2398424b6e.4.2026.01.07.07.34.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Jan 2026 07:34:56 -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 , Chen Linxuan , 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, John Groves Subject: [PATCH V3 3/4] fuse: add API to set kernel mount options Date: Wed, 7 Jan 2026 09:34:42 -0600 Message-ID: <20260107153443.64794-4-john@groves.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260107153443.64794-1-john@groves.net> References: <20260107153244.64703-1-john@groves.net> <20260107153443.64794-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_add_kernel_mount_opt() to allow libfuse callers to pass additional mount options directly to the kernel. This enables filesystem-specific kernel mount options that aren't exposed through the standard libfuse mount option parsing. For example, famfs uses this to set the "shadow=3D" mount option for shadow file system mounts. API addition: int fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount_= opt) Signed-off-by: John Groves --- include/fuse_lowlevel.h | 10 ++++++++++ lib/fuse_i.h | 1 + lib/fuse_lowlevel.c | 5 +++++ lib/fuse_versionscript | 1 + lib/mount.c | 8 ++++++++ 5 files changed, 25 insertions(+) diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 016f831..d2bbcca 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -2195,6 +2195,16 @@ static inline int fuse_session_custom_io(struct fuse= _session *se, } #endif =20 +/** + * Allow a libfuse caller to directly add kernel mount opts + * + * @param se session object + * @param mount_opt the option to add + * + * @return 0 on success, -1 on failure + */ +int fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount_o= pt); + /** * Mount a FUSE file system. * diff --git a/lib/fuse_i.h b/lib/fuse_i.h index 65d2f68..41285d2 100644 --- a/lib/fuse_i.h +++ b/lib/fuse_i.h @@ -220,6 +220,7 @@ void destroy_mount_opts(struct mount_opts *mo); void fuse_mount_version(void); unsigned get_max_read(struct mount_opts *o); void fuse_kern_unmount(const char *mountpoint, int fd); +int __fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount= _opt); int fuse_kern_mount(const char *mountpoint, struct mount_opts *mo); =20 int fuse_send_reply_iov_nofree(fuse_req_t req, int error, struct iovec *io= v, diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 0cde3d4..413e7c3 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -4349,6 +4349,11 @@ int fuse_session_custom_io_30(struct fuse_session *s= e, offsetof(struct fuse_custom_io, clone_fd), fd); } =20 +int fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount_o= pt) +{ + return __fuse_add_kernel_mount_opt(se, mount_opt); +} + int fuse_session_mount(struct fuse_session *se, const char *_mountpoint) { int fd; diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript index f9562b6..536569a 100644 --- a/lib/fuse_versionscript +++ b/lib/fuse_versionscript @@ -220,6 +220,7 @@ FUSE_3.18 { =20 fuse_reply_statx; fuse_fs_statx; + fuse_add_kernel_mount_opt; } FUSE_3.17; =20 FUSE_3.19 { diff --git a/lib/mount.c b/lib/mount.c index 7a856c1..e6c2305 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -674,6 +674,14 @@ void destroy_mount_opts(struct mount_opts *mo) free(mo); } =20 +int __fuse_add_kernel_mount_opt(struct fuse_session *se, const char *mount= _opt) +{ + if (!se->mo) + return -1; + if (!mount_opt) + return -1; + return fuse_opt_add_opt(&se->mo->kernel_opts, mount_opt); +} =20 int fuse_kern_mount(const char *mountpoint, struct mount_opts *mo) { --=20 2.49.0 From nobody Sat Feb 7 18:21:28 2026 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (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 AFFEA399029 for ; Wed, 7 Jan 2026 15:35:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800104; cv=none; b=k1sNtzClqh4sTeOF5pIL+j5uSvk1p60WOROmfuoh7DnKYNNgwXQzCBF6RyyPM4X9Weu/ChDWPkgOrPYYBf3JUZX3ymoTuuSJA+z3bshRNkWIutGWnpPz10z+K1YOIbMEZ1O152tAlx4y61RATqA3aeCXmb31fzabpF4hfkBD/h4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767800104; c=relaxed/simple; bh=HM4lKamXQwEUZnRqp2/mgy4o0pjN0zbCyAQ9KEkrnNs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZuXhDV0ccsiBAiYx1NONQ7GXrAlIIUpSNGPBXO8fZ9WaqQn1TKavRtoZddh9lUsrNd2XFzdG+iGT1b33hOer943hQPC792ysxzRt/JOEBUM+6m6cBlA1a003HxddGigHpUdFOWCebWxjB4uT8RpWggOJs4416UxCt0wSCzchM9k= 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=TBfRge6Z; arc=none smtp.client-ip=209.85.167.181 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="TBfRge6Z" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-450c65f3510so1427939b6e.2 for ; Wed, 07 Jan 2026 07:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767800099; x=1768404899; 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=OPrNuirfi0NELPHMFcu/1KlJClDuCwOT8DJm2N/JJag=; b=TBfRge6ZoGYJNVe+MfO7B8Q/lEdSD76bj1t7mMM11HcoqkehMf7mYPh6Br09hLbmwh y5aMVudtDQjn9njNFVyKm4KX8K6HPC9G1m2LTLxOTYg8eCLtKE4p/qAEEvo6YzWRuHtW NdwWCLBC+PnDiHoahfPE0Kdc3e9EZRSWIiFGx1np9Vwxfs5x5NQ53vKDhtG4cWTXjTXR Cl+zwf/ufAj5/JpjyWYyyz7eH3pOHbDEAX3WCpWYztlP6NXg3E7CujM3RMhrebI/iWts kIwDZ3OB6Z32qnSp4QVo8SUwFMQ31YEstNwTC/Fc7lpl/JGrYHY3yx4MA72PakPxGF9S wIDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767800099; x=1768404899; 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=OPrNuirfi0NELPHMFcu/1KlJClDuCwOT8DJm2N/JJag=; b=irXFR5SnKch3lEDm1ZxeX5o/8ex0pWrAlvECJoxLzyhDzCAkYaLjhvhkQHt5YDZjCL C3RUdO+B+Z+09oSydQZ6L/Lm/dQiFT8mMYSjK2aW7VWfVLdTSO2h3fLFqu2dBJ8FdXqP HAG9G7giS6XdKfzKR0XAVpB1IE2ojCnC9T/AC0fQRLTO/dRHMzyCjnrDXpHhwje9Nm6X 1C6FjUppJyCrUNTizg80U36aHoOMKMYcGnd3GLejCvyEsAF0QuUF52W4zP+DQh2LU+VU n8YzNnLu5I1+rUM2nL2rwoYCWte2qUkmo4/VghYiKDkkAP/dvcXRvMd+xzXFaFC7Ep7k DR8w== X-Forwarded-Encrypted: i=1; AJvYcCX77WtiUMCTQ9yyVqsEfCoAfIt+RAyLGUMsVhFNTRZPoxjcZRoKaeFZGODyvwEvCmF7cfdNGw1NTTsNElk=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4nrbQcvNhkEw5Z7JnrEc+yUxj4fHyyoam7d7BJba1L+Lnbf3n pv1z2LlabhnhAlW3UR3sMn8ApAf1w/5OPxVoIVRS17EPsC7tJ1yNBl1d X-Gm-Gg: AY/fxX5gza6y/6hVs9yrhxW641uoiQIPpBErHIG7CCxJyKvT79DwIlh5aDNjjouODq/ aukxnF/P6LFA0kQRSMknUgP8RXVgePrlomir1kMs/Py+Xz1GpqX6mZJ6i0PDJIvIvxBQLcLOUzI wo6HhX7UNpzjwRsFxJMvm+iyOUcMPGNmHcrr3b5qbUgHSBaQo6C2wFVx09TCASj/SybTdbin9ua UAIauSg8zDf30vnhrC46ZPVemNXlRfDCJ1B8tLJL+TBVwCw4J6CJpmdgIxaK4HDHrh5YjdcAauL pziy3hjzz+2kFuysIknpeI6wBnyRfQ9t+di+6F+4A98A4hewi5wSrdrtzWgkUuz0YTMaL/l6snO 20Km4pnOWFf02RcE+7kvcLXoXlF0vEQel2sX6nK1WAyavksIYFjbnTYa+UIqfJuH6HCEv4Y66Mr mDbVIvJJ1sSk12D6jwHXcrF27SWO7BTOWChxccbMXICCvt X-Google-Smtp-Source: AGHT+IFUAwqlKPFZxOP8hKjN3yWWiewXwLTUZV8MqKGeOfhFctvOkPQ3NvPc2aDZQl4je/LWLvX3LQ== X-Received: by 2002:a05:6808:3206:b0:450:c877:fd6f with SMTP id 5614622812f47-45a6befa901mr1333720b6e.67.1767800099405; Wed, 07 Jan 2026 07:34:59 -0800 (PST) Received: from localhost.localdomain ([2603:8080:1500:3d89:a917:5124:7300:7cef]) by smtp.gmail.com with ESMTPSA id 5614622812f47-45a5e183ac3sm2398424b6e.4.2026.01.07.07.34.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Jan 2026 07:34:59 -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 , Chen Linxuan , 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, John Groves Subject: [PATCH V3 4/4] fuse: add famfs DAX fmap support Date: Wed, 7 Jan 2026 09:34:43 -0600 Message-ID: <20260107153443.64794-5-john@groves.net> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260107153443.64794-1-john@groves.net> References: <20260107153244.64703-1-john@groves.net> <20260107153443.64794-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 ++++++++++++++++++++++++++++++- 3 files changed, 72 insertions(+), 1 deletion(-) diff --git a/include/fuse_common.h b/include/fuse_common.h index 041188e..e428ddb 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 d2bbcca..55fcfd7 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 413e7c3..c3adfa2 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 { --=20 2.49.0