From patchwork Mon Jun 17 01:21:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 13699848 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DFC98836 for ; Mon, 17 Jun 2024 01:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718587514; cv=none; b=KlhKNzSNBi3fQlU2137NASFgN7jXzCjYIVe98hlvpaRW/E4qdC8055aHcmAuysJRGuqfCNX7gNfJVo94LpgNVhU6JJnU92laGSCMopwKrubXDDynVLz2JrzoqpPOqbyu2z+241YnvXipmi5qyISS7KxIJqa22fHFogZmV39Xv2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718587514; c=relaxed/simple; bh=u0m2Qekqox7a/+wsRz/htnWo29bY24C1eCoOvnXIhyE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pV4WT+WPVFHQVA5o46qdCVQ9nxEUwYCBR2OTFXv9PmV4D39D0a3w/eXX/Q+0OnPEUZI+4YplkrFZjl1viejQdeYjRWhfiNvxrc5iPXX16qk+WwP9+YFPtQ7Zu5sEHBZBxg+GqMlPZNGIqD6BryxJzJvhiwVeVY5s5sF/X1xIQQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B/h0t+0h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B/h0t+0h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A83D1C4AF1C for ; Mon, 17 Jun 2024 01:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718587513; bh=u0m2Qekqox7a/+wsRz/htnWo29bY24C1eCoOvnXIhyE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=B/h0t+0hRsMxdoDRhkl4BteoUx0Q0B2LN5zHQphYZT+qkVlTZSUN2R6c4qOWXIxyP S2Dr2BrXAxdXjLTTh65oHK1mmzSqjmgKYCVK2PRUwI8jFLbE2M29DG8FJ0X1eXzJPJ +50OYDmuHKsfbQtnw6n3VP9LI1/7eVFOQwKhzcxySr0oZAVmmdKKvMcvm6Awz3sJB0 Y8jV2TgT8mvvAQve6GZE5rEDZFbbGL6uE3Gp4/6PW/47O+Rf/4Y63NZB/BPTPAEuff c748DlIr6PpPxC7pfh+NQtHG6q1vC8PHF42umeGeTUzsiMBvfLr++xaub5pk13UKzf d5pKfvVlZz1fw== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v2 10/19] NFSv4: Enable attribute delegations Date: Sun, 16 Jun 2024 21:21:28 -0400 Message-ID: <20240617012137.674046-11-trondmy@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240617012137.674046-10-trondmy@kernel.org> References: <20240617012137.674046-1-trondmy@kernel.org> <20240617012137.674046-2-trondmy@kernel.org> <20240617012137.674046-3-trondmy@kernel.org> <20240617012137.674046-4-trondmy@kernel.org> <20240617012137.674046-5-trondmy@kernel.org> <20240617012137.674046-6-trondmy@kernel.org> <20240617012137.674046-7-trondmy@kernel.org> <20240617012137.674046-8-trondmy@kernel.org> <20240617012137.674046-9-trondmy@kernel.org> <20240617012137.674046-10-trondmy@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Trond Myklebust If we see that the server supports attribute delegations, then request them by setting the appropriate OPEN arguments. Signed-off-by: Trond Myklebust Signed-off-by: Lance Shelton Reviewed-by: Jeff Layton Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 03835c8a180f..1209ce22158e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1339,8 +1339,13 @@ nfs4_map_atomic_open_share(struct nfs_server *server, if (!(server->caps & NFS_CAP_ATOMIC_OPEN_V1)) goto out; /* Want no delegation if we're using O_DIRECT */ - if (openflags & O_DIRECT) + if (openflags & O_DIRECT) { res |= NFS4_SHARE_WANT_NO_DELEG; + goto out; + } + /* res |= NFS4_SHARE_WANT_NO_PREFERENCE; */ + if (server->caps & NFS_CAP_DELEGTIME) + res |= NFS4_SHARE_WANT_DELEG_TIMESTAMPS; out: return res; }