From nobody Thu Dec 12 01:30:56 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y7w0J4wVSz5gmL8; Thu, 12 Dec 2024 01:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y7w0J4PDjz4QLr; Thu, 12 Dec 2024 01:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733967056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMH7sOk2TdKtWEzdogurgMYHrmzAI5lo9pS84RtdAA8=; b=IGkAiBDsktKc4mUvVtdAuA5gI8/3xAMj2Q2ipt1YpcQD9NSsgnKSeK4XzrjeWiAp6qyg34 jMpsk/uBt+Ba93ejh/NVI+sqr18eBxSdDF2KQWOcALtxo1xrhvtoboVbjjsHde7rNPFvfF K5qbZGkQmqQyc5WqetcQhSjZEGGdtV53oyVJ9i5EdfhGFrndC1fMKowCeCx7XcYnj4+yF4 W+MBIElmyzzH1J+YeTThpUQKbOxrJtCgZJeCuXh1anMVNa9brc8THmK3+7QlUfJeDE+610 FihoXORZGiX0WsTNwagKooeFpZ0VFWNAdWPiOTJG/D9MCgkzCsPzYjRJ97cyWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733967056; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bMH7sOk2TdKtWEzdogurgMYHrmzAI5lo9pS84RtdAA8=; b=vvp1wD822ZsRW/z8pW3bBiDThgqwfCG/40C15/pBtROgUh+vNdju+YFclDESr9GoSWBbvU ydNqaYDSCpIJk51odVWC57CWeTOk1RFJI7y6gHaud53AP57Wwn6OylmK5D7f5bCm+plkiJ +5aSUbCRvFrd4QKCyNXrBZQkZirY5iDUsg9xPW9UzRmstjkG2Fd5VtjUk+JXoBinbB5vWx JMGSdpUpj9YAWplKge8A7qDQ8416lBZqht3A7+WiJxmUWnU+22oohuWEMAerfZkt+gISgS s9TUwFx/uNYEjNXM8GWq1QciHsDfIIwOWerv5wT03MggZvrk+w6XOnM4m2A49A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733967056; a=rsa-sha256; cv=none; b=tkjjn6lEuMXZZYyG1gcNYGuGcYqOJpiHwPatfCzuy7Ll1gpMAe1Kk1W4t6C0cfn5fVpVFS dL/+iyZxpoKt7VtuJlITBrlu1PLKNfUOHA2r8DdZvkQr+yr5mV+D2IlPgJRvfKXNOB4N4k oY4cY2wHaV6Dd1GRwtwqPR59Dn9lYUm7n/RiRQ95LfIDeRRvUITBlFwcv1upiy1ALuFDSS v6QpHhVE6si3QwEzGGWth7T7bPhi5oR3rzguFx1YBpktlZ94afrTDdUG0YXBS1FcjCu6t4 s/9gn2TuOJZbvtW6EcAjRWsv6R7IpYvGvKSutS4PzpzXYTBRwQZZmTCWLELVkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y7w0J40Y5zXy7; Thu, 12 Dec 2024 01:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BC1UudP015810; Thu, 12 Dec 2024 01:30:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BC1Uufq015807; Thu, 12 Dec 2024 01:30:56 GMT (envelope-from git) Date: Thu, 12 Dec 2024 01:30:56 GMT Message-Id: <202412120130.4BC1Uufq015807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 48d92db0804b - main - fusefs: Upgrade FUSE protocol to version 7.32. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48d92db0804b0e70e0d8dca5e1c8a99eaf70cc3c Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=48d92db0804b0e70e0d8dca5e1c8a99eaf70cc3c commit 48d92db0804b0e70e0d8dca5e1c8a99eaf70cc3c Author: Claudiu I. Palincas AuthorDate: 2024-12-11 23:17:54 +0000 Commit: Alan Somers CommitDate: 2024-12-12 01:30:33 +0000 fusefs: Upgrade FUSE protocol to version 7.32. This commit upgrades the FUSE API to protocol 7.32. It doesn't implement any of protocol 7.32's new features. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D48040 --- sys/fs/fuse/fuse_kernel.h | 81 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 3 deletions(-) diff --git a/sys/fs/fuse/fuse_kernel.h b/sys/fs/fuse/fuse_kernel.h index ad93a26adaab..14d5508ba3fa 100644 --- a/sys/fs/fuse/fuse_kernel.h +++ b/sys/fs/fuse/fuse_kernel.h @@ -161,6 +161,21 @@ * - add FOPEN_CACHE_DIR * - add FUSE_MAX_PAGES, add max_pages to init_out * - add FUSE_CACHE_SYMLINKS + * + * 7.29 + * - add FUSE_NO_OPENDIR_SUPPORT flag + * + * 7.30 + * - add FUSE_EXPLICIT_INVAL_DATA + * - add FUSE_IOCTL_COMPAT_X32 + * + * 7.31 + * - add FUSE_WRITE_KILL_PRIV flag + * - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING + * - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag + * + * 7.32 + * - add flags to fuse_attr, add FUSE_ATTR_SUBMOUNT, add FUSE_SUBMOUNTS */ #ifndef _FUSE_FUSE_KERNEL_H @@ -196,7 +211,7 @@ #define FUSE_KERNEL_VERSION 7 /** Minor version number of this interface */ -#define FUSE_KERNEL_MINOR_VERSION 29 +#define FUSE_KERNEL_MINOR_VERSION 32 /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 @@ -220,7 +235,7 @@ struct fuse_attr { uint32_t gid; uint32_t rdev; uint32_t blksize; - uint32_t padding; + uint32_t flags; }; struct fuse_kstatfs { @@ -265,11 +280,13 @@ struct fuse_file_lock { * FOPEN_KEEP_CACHE: don't invalidate the data cache on open * FOPEN_NONSEEKABLE: the file is not seekable * FOPEN_CACHE_DIR: allow caching this directory + * FOPEN_STREAM: the file is stream-like (no file position at all) */ #define FOPEN_DIRECT_IO (1 << 0) #define FOPEN_KEEP_CACHE (1 << 1) #define FOPEN_NONSEEKABLE (1 << 2) #define FOPEN_CACHE_DIR (1 << 3) +#define FOPEN_STREAM (1 << 4) /** * INIT request/reply flags @@ -299,6 +316,11 @@ struct fuse_file_lock { * FUSE_MAX_PAGES: init_out.max_pages contains the max number of req pages * FUSE_CACHE_SYMLINKS: cache READLINK responses * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir + * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request + * FUSE_MAP_ALIGNMENT: init_out.map_alignment contains log2(byte alignment) for + * foffset and moffset fields in struct + * fuse_setupmapping_out and fuse_removemapping_one. + * FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts */ #define FUSE_ASYNC_READ (1 << 0) #define FUSE_POSIX_LOCKS (1 << 1) @@ -325,6 +347,9 @@ struct fuse_file_lock { #define FUSE_MAX_PAGES (1 << 22) #define FUSE_CACHE_SYMLINKS (1 << 23) #define FUSE_NO_OPENDIR_SUPPORT (1 << 24) +#define FUSE_EXPLICIT_INVAL_DATA (1 << 25) +#define FUSE_MAP_ALIGNMENT (1 << 26) +#define FUSE_SUBMOUNTS (1 << 27) #ifdef linux /** @@ -356,9 +381,11 @@ struct fuse_file_lock { * * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed * FUSE_WRITE_LOCKOWNER: lock_owner field is valid + * FUSE_WRITE_KILL_PRIV: kill suid and sgid bits */ #define FUSE_WRITE_CACHE (1 << 0) #define FUSE_WRITE_LOCKOWNER (1 << 1) +#define FUSE_WRITE_KILL_PRIV (1 << 2) /** * Read flags @@ -373,6 +400,7 @@ struct fuse_file_lock { * FUSE_IOCTL_RETRY: retry with new iovecs * FUSE_IOCTL_32BIT: 32bit ioctl * FUSE_IOCTL_DIR: is a directory + * FUSE_IOCTL_COMPAT_X32: x32 compat ioctl on 64bit machine (64bit time_t) * * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs */ @@ -381,6 +409,7 @@ struct fuse_file_lock { #define FUSE_IOCTL_RETRY (1 << 2) #define FUSE_IOCTL_32BIT (1 << 3) #define FUSE_IOCTL_DIR (1 << 4) +#define FUSE_IOCTL_COMPAT_X32 (1 << 5) #define FUSE_IOCTL_MAX_IOV 256 @@ -404,6 +433,13 @@ struct fuse_file_lock { #define FUSE_FALLOC_FL_KEEP_SIZE 0x1 #define FUSE_FALLOC_FL_PUNCH_HOLE 0x2 +/** + * fuse_attr flags + * + * FUSE_ATTR_SUBMOUNT: Object is a submount root + */ +#define FUSE_ATTR_SUBMOUNT (1 << 0) + enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ @@ -450,10 +486,15 @@ enum fuse_opcode { FUSE_RENAME2 = 45, FUSE_LSEEK = 46, FUSE_COPY_FILE_RANGE = 47, + FUSE_SETUPMAPPING = 48, + FUSE_REMOVEMAPPING = 49, #ifdef linux /* CUSE specific operations */ CUSE_INIT = 4096, + /* Reserved opcodes: helpful to detect structure endian-ness */ + CUSE_INIT_BSWAP_RESERVED = 1048576, /* CUSE_INIT << 8 */ + FUSE_INIT_BSWAP_RESERVED = 436207616, /* FUSE_INIT << 24 */ #endif /* linux */ }; @@ -692,7 +733,7 @@ struct fuse_init_out { uint32_t max_write; uint32_t time_gran; uint16_t max_pages; - uint16_t padding; + uint16_t map_alignment; uint32_t unused[8]; }; @@ -863,6 +904,9 @@ struct fuse_notify_retrieve_in { uint64_t dummy4; }; +/* Device ioctls: */ +#define FUSE_DEV_IOC_CLONE _IOR(229, 0, uint32_t) + struct fuse_lseek_in { uint64_t fh; uint64_t offset; @@ -884,4 +928,35 @@ struct fuse_copy_file_range_in { uint64_t flags; }; + +#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0) +#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1) +struct fuse_setupmapping_in { + /* An already open handle */ + uint64_t fh; + /* Offset into the file to start the mapping */ + uint64_t foffset; + /* Length of mapping required */ + uint64_t len; + /* Flags, FUSE_SETUPMAPPING_FLAG_* */ + uint64_t flags; + /* Offset in Memory Window */ + uint64_t moffset; +}; + +struct fuse_removemapping_in { + /* number of fuse_removemapping_one follows */ + uint32_t count; +}; + +struct fuse_removemapping_one { + /* Offset into the dax window start the unmapping */ + uint64_t moffset; + /* Length of mapping required */ + uint64_t len; +}; + +#define FUSE_REMOVEMAPPING_MAX_ENTRY \ + (PAGE_SIZE / sizeof(struct fuse_removemapping_one)) + #endif /* _FUSE_FUSE_KERNEL_H */