Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp890180ybh; Wed, 11 Mar 2020 12:57:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvrG3IZLMmjMpXY4igb3Oa23BoKaefT+P5BIu6Yf6YN4bkWTiCu1FbJAXpfkZw3DEUybDd8 X-Received: by 2002:a4a:8dd9:: with SMTP id a25mr1452151ool.69.1583956651452; Wed, 11 Mar 2020 12:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583956651; cv=none; d=google.com; s=arc-20160816; b=drpiM0r5ZPN/+WZMS3w3I+hTGHfE7z0H+YZh6NaFD/TaVhWxwlhsHq2WsK+i+tAk/Y wqJF8Jqyc+guc5O9FXXhBnTFof+FSlTTxj6kvm2M+LVdujHstYIqueQO3k74kFinC3vZ v0kv8773kucG7eAKt4DfFi7CFM9YUXbSBznfHDCeDo5rGOQlvIIHLs6wgtqnUjbvWLcH 0nu38xtJREs4c64QTqx8uZemwCWAAcDDr/q5uUEJvpVYS8ExIpm/46mucmNb3D8g+V51 oU/VCJnCDPg1HXFHcTVgPp209lNp9IJ7xeJCTyz6/Ymbbn2M81e7OsZBxP/nzVrkdI/o gtJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=ILm/labxd8xB2Zh7kdfJljhjlrpHqghGKORFVjJ8qv8=; b=Cd8x2KaVTLYw7ZEgzPg7e2BSehOyGdNPCpq+awXBgV7et7I+UnBSwO5l48euQFEYhd ql54ISl3+J48h8ktY2v7wQAMqkPXFNy8lJhM4FmhtKJYLw76I3ab6NpfV7jtqLvMTNle xX6/VmPppFwBm1w112U9ydtIO0WWrPWu7XbHx9+w8zwv/IVqll780xXz0RihZCmVVQ2D sjCF57nG7q1c/XRUtS1MGPCfl+9yrtfY3/Mqiufn8kbZi3Y2YmoKEUKLWK7bBSAZvyIg 5QInPxTcMq3axUDmWXWWJtMmRPYfIozO6e7bPCwJWljeC4Xiub1DqyLZdyoNlYEJJ/Si Chbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=atuH3O0X; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si1577754oth.274.2020.03.11.12.57.19; Wed, 11 Mar 2020 12:57:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=atuH3O0X; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387446AbgCKT4m (ORCPT + 99 others); Wed, 11 Mar 2020 15:56:42 -0400 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:61730 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387409AbgCKT4m (ORCPT ); Wed, 11 Mar 2020 15:56:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1583956601; x=1615492601; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ILm/labxd8xB2Zh7kdfJljhjlrpHqghGKORFVjJ8qv8=; b=atuH3O0XRRzH9pualX7sBbR5DEFA912+ZEOvdTGqogMuj/XSh9BiO17k 40O8m4lmB4T9EZeCPOWdomEtLOKFgpBpEJGxoAqTLejA1IX82wuBRlaV5 KeJRRjosf5besMNgj+5MxA60XofNw7iQBUA/ndiuYkDZlMyxYOUy0hK5W E=; IronPort-SDR: 54Cm4kLAkdAqJ4shh1qqaECE6i7DXFqBWiov4tyKNKqVxMce0ekq+h7PSTRptPk44gYxFEF4V/ sO0w9x4BZ4iQ== X-IronPort-AV: E=Sophos;i="5.70,541,1574121600"; d="scan'208";a="21100372" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1e-27fb8269.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 11 Mar 2020 19:56:27 +0000 Received: from EX13MTAUWA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-27fb8269.us-east-1.amazon.com (Postfix) with ESMTPS id 07F97A2405; Wed, 11 Mar 2020 19:56:25 +0000 (UTC) Received: from EX13D13UWA001.ant.amazon.com (10.43.160.136) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 11 Mar 2020 19:56:25 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D13UWA001.ant.amazon.com (10.43.160.136) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Mar 2020 19:56:24 +0000 Received: from dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (172.23.141.97) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 11 Mar 2020 19:56:23 +0000 Received: by dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (Postfix, from userid 6262777) id E61DCDEC0F; Wed, 11 Mar 2020 19:56:23 +0000 (UTC) From: Frank van der Linden To: , , CC: Frank van der Linden Subject: [PATCH 01/13] nfs,nfsd: NFSv4.2 extended attribute protocol definitions Date: Wed, 11 Mar 2020 19:56:01 +0000 Message-ID: <20200311195613.26108-2-fllinden@amazon.com> X-Mailer: git-send-email 2.16.6 In-Reply-To: <20200311195613.26108-1-fllinden@amazon.com> References: <20200311195613.26108-1-fllinden@amazon.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Add definitions for the new operations, errors and flags as defined in RFC 8276 (File System Extended Attributes in NFSv4). Signed-off-by: Frank van der Linden --- include/linux/nfs4.h | 20 ++++++++++++++++++++ include/uapi/linux/nfs4.h | 3 +++ 2 files changed, 23 insertions(+) diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 82d8fb422092..350aeda0c48c 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -150,6 +150,12 @@ enum nfs_opnum4 { OP_WRITE_SAME = 70, OP_CLONE = 71, + /* xattr support (RFC8726) */ + OP_GETXATTR = 72, + OP_SETXATTR = 73, + OP_LISTXATTRS = 74, + OP_REMOVEXATTR = 75, + OP_ILLEGAL = 10044, }; @@ -280,6 +286,10 @@ enum nfsstat4 { NFS4ERR_WRONG_LFS = 10092, NFS4ERR_BADLABEL = 10093, NFS4ERR_OFFLOAD_NO_REQS = 10094, + + /* xattr (RFC8276) */ + NFS4ERR_NOXATTR = 10095, + NFS4ERR_XATTR2BIG = 10096, }; static inline bool seqid_mutating_err(u32 err) @@ -452,6 +462,7 @@ enum change_attr_type4 { #define FATTR4_WORD2_CHANGE_ATTR_TYPE (1UL << 15) #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) #define FATTR4_WORD2_MODE_UMASK (1UL << 17) +#define FATTR4_WORD2_XATTR_SUPPORT (1UL << 18) /* MDS threshold bitmap bits */ #define THRESHOLD_RD (1UL << 0) @@ -700,4 +711,13 @@ struct nl4_server { struct nfs42_netaddr nl4_addr; /* NL4_NETADDR */ } u; }; + +/* + * Options for setxattr. These match the flags for setxattr(2). + */ +enum nfs4_setxattr_options { + SETXATTR4_EITHER = 0, + SETXATTR4_CREATE = 1, + SETXATTR4_REPLACE = 2, +}; #endif diff --git a/include/uapi/linux/nfs4.h b/include/uapi/linux/nfs4.h index 8572930cf5b0..bf197e99b98f 100644 --- a/include/uapi/linux/nfs4.h +++ b/include/uapi/linux/nfs4.h @@ -33,6 +33,9 @@ #define NFS4_ACCESS_EXTEND 0x0008 #define NFS4_ACCESS_DELETE 0x0010 #define NFS4_ACCESS_EXECUTE 0x0020 +#define NFS4_ACCESS_XAREAD 0x0040 +#define NFS4_ACCESS_XAWRITE 0x0080 +#define NFS4_ACCESS_XALIST 0x0100 #define NFS4_FH_PERSISTENT 0x0000 #define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001 -- 2.16.6