From nobody Tue Dec 07 04:51:24 2021 X-Original-To: dev-commits-src-all@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 A0F0F18C5E27; Tue, 7 Dec 2021 04:51:24 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J7SYm2kzWz53hX; Tue, 7 Dec 2021 04:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 3E994199A3; Tue, 7 Dec 2021 04:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1B74pOlk079014; Tue, 7 Dec 2021 04:51:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B74pOHX079013; Tue, 7 Dec 2021 04:51:24 GMT (envelope-from git) Date: Tue, 7 Dec 2021 04:51:24 GMT Message-Id: <202112070451.1B74pOHX079013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 8254f966988e - stable/13 - fusefs: diff reduction in fuse_kernel.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 8254f966988e2ec58b5380bc7a7030789a450500 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638852684; 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=aiHSpwBrIuSWurS8Rh9zW5kflb2EksCXLtR5hYLNl6s=; b=GEsFzsAuplqXcQ7isDBX144MnHqv5MMNNr0FKriRMqoIAkDYMC0nSZz/Q5FrSivyW1emPk ZNC/XPkM8ZSccqrkQ8h9XO4sPxhamqcoeWrPeimXA62Pjn0nKbtl7qT0rmwbsdhWclXOiB qcNJZVPcwWB/sGyaiWT4Ynoq40ag9Dql2/8ihox6Jnr+Y6B5xt6BSWvB6+stSwrp+SHCMF ylB39OFg/ZP3HODvx6RJMME0YXo92JIGEv/STqO/g2VSwZBqi+fZz/9nPsTV690ukQqfYr B2tsgv0teKjb3SqwOiDWVZUX+e4zBtyojG+4+kyfh3BlvHXQyxVZDnDAwJxEAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638852684; a=rsa-sha256; cv=none; b=KPXXk5YQ4uuyl3md2sv0HzThlzMZ+9v0azo+v3NXjDcwxuGonPHcuVTAisk8lbj2CAPAdD IeNQH8fY30xjigT2mTzFrAPjqjL5S49iRLN9vxqP3AhMzzEDDrXzUHT9p5u3l0FNAlqg7d Em0agMx2Tt8uzqzKvA6er7wbX2lUuIOA03dW+maR7gWMIJTjQRiecCXppkSmlxXK/KZxT9 ouoDI4E3lrlnEj8YnoGkc1SMygZT8Vbhk/X/860Kln0Ztqqh9zbXz6FOtbLbge2laB6uFD gsi3gZAWneB+8dz8O8lFbe+MHw0W2OuXTJORDC4aVU1hRKkDg1jfOipZa9Nlyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=8254f966988e2ec58b5380bc7a7030789a450500 commit 8254f966988e2ec58b5380bc7a7030789a450500 Author: Alan Somers AuthorDate: 2021-09-25 14:23:54 +0000 Commit: Alan Somers CommitDate: 2021-12-07 04:50:01 +0000 fusefs: diff reduction in fuse_kernel.h Synchronize formatting and documentation in fuse_kernel.h with upstream sources. Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D32141 (cherry picked from commit a3a1ce3794e85fe27cb5af5e9f48a490a9ef70c2) --- sys/fs/fuse/fuse_internal.c | 2 +- sys/fs/fuse/fuse_kernel.h | 85 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 77 insertions(+), 10 deletions(-) diff --git a/sys/fs/fuse/fuse_internal.c b/sys/fs/fuse/fuse_internal.c index 82e37ed5a466..731ac9c2ba24 100644 --- a/sys/fs/fuse/fuse_internal.c +++ b/sys/fs/fuse/fuse_internal.c @@ -363,7 +363,7 @@ fuse_internal_fsync(struct vnode *vp, ffsi->fsync_flags = 0; if (datasync) - ffsi->fsync_flags = 1; + ffsi->fsync_flags = FUSE_FSYNC_FDATASYNC; if (waitfor == MNT_WAIT) { err = fdisp_wait_answ(&fdi); diff --git a/sys/fs/fuse/fuse_kernel.h b/sys/fs/fuse/fuse_kernel.h index 14cf4fabac14..bd7323e9def2 100644 --- a/sys/fs/fuse/fuse_kernel.h +++ b/sys/fs/fuse/fuse_kernel.h @@ -41,22 +41,61 @@ * * Protocol changelog: * + * 7.1: + * - add the following messages: + * FUSE_SETATTR, FUSE_SYMLINK, FUSE_MKNOD, FUSE_MKDIR, FUSE_UNLINK, + * FUSE_RMDIR, FUSE_RENAME, FUSE_LINK, FUSE_OPEN, FUSE_READ, FUSE_WRITE, + * FUSE_RELEASE, FUSE_FSYNC, FUSE_FLUSH, FUSE_SETXATTR, FUSE_GETXATTR, + * FUSE_LISTXATTR, FUSE_REMOVEXATTR, FUSE_OPENDIR, FUSE_READDIR, + * FUSE_RELEASEDIR + * - add padding to messages to accommodate 32-bit servers on 64-bit kernels + * + * 7.2: + * - add FOPEN_DIRECT_IO and FOPEN_KEEP_CACHE flags + * - add FUSE_FSYNCDIR message + * + * 7.3: + * - add FUSE_ACCESS message + * - add FUSE_CREATE message + * - add filehandle to fuse_setattr_in + * + * 7.4: + * - add frsize to fuse_kstatfs + * - clean up request size limit checking + * + * 7.5: + * - add flags and max_write to fuse_init_out + * + * 7.6: + * - add max_readahead to fuse_init_in and fuse_init_out + * + * 7.7: + * - add FUSE_INTERRUPT message + * - add POSIX file lock support + * + * 7.8: + * - add lock_owner and flags fields to fuse_release_in + * - add FUSE_BMAP message + * - add FUSE_DESTROY message + * * 7.9: * - new fuse_getattr_in input argument of GETATTR * - add lk_flags in fuse_lk_in * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in * - add blksize field to fuse_attr * - add file flags field to fuse_read_in and fuse_write_in + * - Add ATIME_NOW and MTIME_NOW flags to fuse_setattr_in * * 7.10 * - add nonseekable open flag * - * 7.11 + * 7.11 * - add IOCTL message * - add unsolicited notification support + * - add POLL message and NOTIFY_POLL notification * - * 7.12 - * - add umask flag to input argument of open, mknod and mkdir + * 7.12 + * - add umask flag to input argument of create, mknod and mkdir * - add notification messages for invalidation of inodes and * directory entries * @@ -89,6 +128,7 @@ * * 7.20 * - add FUSE_AUTO_INVAL_DATA + * * 7.21 * - add FUSE_READDIRPLUS * - send the requested events in POLL request @@ -105,7 +145,7 @@ * - add FUSE_RENAME2 request * - add FUSE_NO_OPEN_SUPPORT flag * - * 7.24 + * 7.24 * - add FUSE_LSEEK for SEEK_HOLE and SEEK_DATA support * * 7.25 @@ -134,6 +174,26 @@ #include #endif +/* + * Version negotiation: + * + * Both the kernel and userspace send the version they support in the + * INIT request and reply respectively. + * + * If the major versions match then both shall use the smallest + * of the two minor versions for communication. + * + * If the kernel supports a larger major version, then userspace shall + * reply with the major version it supports, ignore the rest of the + * INIT message and expect a new INIT message from the kernel with a + * matching major version. + * + * If the library supports a larger major version, then it shall fall + * back to the major protocol version sent by the kernel for + * communication and reply with that major version (and an arbitrary + * supported minor version). + */ + /** Version number of this interface */ #define FUSE_KERNEL_VERSION 7 @@ -331,6 +391,13 @@ struct fuse_file_lock { */ #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0) +/** + * Fsync flags + * + * FUSE_FSYNC_FDATASYNC: Sync data only, not metadata + */ +#define FUSE_FSYNC_FDATASYNC (1 << 0) + enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ @@ -791,14 +858,14 @@ struct fuse_notify_retrieve_in { }; struct fuse_lseek_in { - uint64_t fh; - uint64_t offset; - uint32_t whence; - uint32_t padding; + uint64_t fh; + uint64_t offset; + uint32_t whence; + uint32_t padding; }; struct fuse_lseek_out { - uint64_t offset; + uint64_t offset; }; struct fuse_copy_file_range_in {