Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13795210ybl; Sun, 29 Dec 2019 21:06:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwWWNOWSKQOaimIpBMkfGKEJpHb4SMOCv/V9CSY4YenJ7CIOFaArwXFHEHAXJBC7Z8a/rGo X-Received: by 2002:a05:6830:2116:: with SMTP id i22mr75449531otc.0.1577682406908; Sun, 29 Dec 2019 21:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577682406; cv=none; d=google.com; s=arc-20160816; b=V3t840cZmLx+mYnwvx9NWQvlJTYXZYKrnzqf30NQV0RNAXWXdnOv0oplhhfKQB4haU pbIPNTYVI/OH8Cv3h7K8h+yGQ7QKbwOkwaO6Uul5F+Noo6iPtzYf615l4LMySxNAZMSW f+KqezgGVi1UG6nMzPyHzqumhbd0fQrW/d/7vtYJuXx3J7BRde44/bRuv9g/t6nILP1N 37h+EMdNrvEXrCz0IKT6ApKVZdxJjDvsjfUOeNUoIEaH4FaiUXI/t4P1X8m0snrOknaw 5Qa7Xa3Zv4PezFvtQ0gghTKBTO483AH422OefHUvhiAG+mg9t6gOypgkjddiV5EsfoBN ZTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0bGFOBTnjumQZE2kID8F6RH3CwsaMKHdPP5Y224cXIg=; b=KmO4YOm/0JiTkhSucwCb8E+pp0kh+Ujl6gy6+8KHHEIAIZO1JaFjudHu9dnxp6kY3M lapLr7ot7FXd3x6EFBAjv4ywvoQp2i1piL7H8zEu45nhAiTjKc9XHE0Dov+H00RhPsok vb4kKUmzuxPaJJ9mGEksH7vZab0J0F0dp5I3fng3sc+veey3GMlGXnWvquEaYuYeTDpU UFr6jYvEripD2o7tPmx++RiSkBwFghSZqHMlPF6OYq7yri5MhA+V1NcZR5RqOU6UNx7i +eqc4uJIhGm7/PISHdYHDq9b+ySGf8MDRAIkCL9OLCWVOA1MmBs/QpQXquVD0kQc34b0 jCfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="A/J3wKOK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si22362737otm.263.2019.12.29.21.06.33; Sun, 29 Dec 2019 21:06:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@gmail.com header.s=20161025 header.b="A/J3wKOK"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727144AbfL3FE7 (ORCPT + 99 others); Mon, 30 Dec 2019 00:04:59 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34813 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726775AbfL3FE7 (ORCPT ); Mon, 30 Dec 2019 00:04:59 -0500 Received: by mail-pl1-f193.google.com with SMTP id x17so14189204pln.1; Sun, 29 Dec 2019 21:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0bGFOBTnjumQZE2kID8F6RH3CwsaMKHdPP5Y224cXIg=; b=A/J3wKOK3L5WTy8mt5B7Bn2RTq7etw1YqjFgPdqpMGjSc/oKafJ6pPosZdJK538zV0 ZvZZXULnpWdMnsa5Et6ZLWsEVggxGCkghGxcpvypkk4rHzlgeAJIE0d1OTiOD1QZeUi1 BtzDBu8Nnecvdt3IIXqMRXifQAhvj3VclAk7m+IKr/eaPWh1XSB/EJYIW+eNPZd88bO6 m0pn6yiGBRwGPKc41wJaggZ4ddi5afNFmayqyhTBp9S/9JFrEWuclWmkEaVVrinX7dLu N2vQcZIZCe0j80NSnb9Jjf5ikWaqXvER/7Or/PRB/RM4EzBX0NKpeVj3HFPRMbgoR7Fu S92A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0bGFOBTnjumQZE2kID8F6RH3CwsaMKHdPP5Y224cXIg=; b=ovczHdLdUmcPBBWnpsYJBvcJXPreKaBM0zBFFVlkAegDchNnyGgdQTDTb4TFyc7cm/ 8dFszo/BNF+BjwxnbyBuw9mmanhMoZGNTwG+Wkjfc0ziTscRxU1PvWVj2ZVsbs11Gtre e+STyPPSGC+kVPa7ytHkE10QmOe0rlwjNtaJlmQyUzzyY4zC2zkhCtLO56b9iJ6K7uBX J/g6cwV0h3b7k5/BTn3RlG7VKUVIlWHwkZCWFWj9cVTOptahVBaEdUmgZ+0iqn0f00tO OsLttQcFuc4p9pSc3asJj4wjYvApFt0Jakw9tgSzn0Cr/WMryewT9w5P6AlLEFIrxOkV LgLQ== X-Gm-Message-State: APjAAAX2RUnPfKMWkRnNAWVkPntjSJVtxdKa8DAXxClvhj0EcXBxk/ZM 4mM5cXAsMxfqZpgRTlh0tbU= X-Received: by 2002:a17:902:8bc4:: with SMTP id r4mr66088386plo.291.1577682298168; Sun, 29 Dec 2019 21:04:58 -0800 (PST) Received: from localhost.localdomain ([2804:14d:72b1:8920:da15:c0bd:33c1:e2ad]) by smtp.gmail.com with ESMTPSA id r2sm45054727pgv.16.2019.12.29.21.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Dec 2019 21:04:57 -0800 (PST) From: "Daniel W. S. Almeida" X-Google-Original-From: Daniel W. S. Almeida To: corbet@lwn.net, mchehab+samsung@kernel.org Cc: "Daniel W. S. Almeida" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [PATCH 1/5] Documentation: nfs: convert pnfs.txt to ReST Date: Mon, 30 Dec 2019 02:04:43 -0300 Message-Id: <1523c9b99c383c789c3ae943987b2d700377b979.1577681894.git.dwlsalmeida@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Daniel W. S. Almeida" Convert pnfs.txt to ReST. Content remains mostly unchanged. Signed-off-by: Daniel W. S. Almeida --- Documentation/filesystems/index.rst | 1 + Documentation/filesystems/nfs/index.rst | 9 +++++++ .../filesystems/nfs/{pnfs.txt => pnfs.rst} | 25 +++++++++++-------- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 Documentation/filesystems/nfs/index.rst rename Documentation/filesystems/nfs/{pnfs.txt => pnfs.rst} (87%) diff --git a/Documentation/filesystems/index.rst b/Documentation/filesystems/index.rst index ad6315a48d14..801d773a44b9 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst @@ -48,3 +48,4 @@ Documentation for filesystem implementations. autofs virtiofs + nfs/index diff --git a/Documentation/filesystems/nfs/index.rst b/Documentation/filesystems/nfs/index.rst new file mode 100644 index 000000000000..d19ba592779a --- /dev/null +++ b/Documentation/filesystems/nfs/index.rst @@ -0,0 +1,9 @@ +=============================== +NFS +=============================== + + +.. toctree:: + :maxdepth: 1 + + pnfs diff --git a/Documentation/filesystems/nfs/pnfs.txt b/Documentation/filesystems/nfs/pnfs.rst similarity index 87% rename from Documentation/filesystems/nfs/pnfs.txt rename to Documentation/filesystems/nfs/pnfs.rst index 80dc0bdc302a..7c470ecdc3a9 100644 --- a/Documentation/filesystems/nfs/pnfs.txt +++ b/Documentation/filesystems/nfs/pnfs.rst @@ -1,15 +1,17 @@ -Reference counting in pnfs: +========================== +Reference counting in pnfs ========================== The are several inter-related caches. We have layouts which can reference multiple devices, each of which can reference multiple data servers. Each data server can be referenced by multiple devices. Each device -can be referenced by multiple layouts. To keep all of this straight, +can be referenced by multiple layouts. To keep all of this straight, we need to reference count. struct pnfs_layout_hdr ----------------------- +====================== + The on-the-wire command LAYOUTGET corresponds to struct pnfs_layout_segment, usually referred to by the variable name lseg. Each nfs_inode may hold a pointer to a cache of these layout @@ -25,7 +27,8 @@ the reference count, as the layout is kept around by the lseg that keeps it in the list. deviceid_cache --------------- +============== + lsegs reference device ids, which are resolved per nfs_client and layout driver type. The device ids are held in a RCU cache (struct nfs4_deviceid_cache). The cache itself is referenced across each @@ -38,24 +41,26 @@ justification, but seems reasonable given that we can have multiple deviceid's per filesystem, and multiple filesystems per nfs_client. The hash code is copied from the nfsd code base. A discussion of -hashing and variations of this algorithm can be found at: -http://groups.google.com/group/comp.lang.c/browse_thread/thread/9522965e2b8d3809 +hashing and variations of this algorithm can be found `here. +`_ data server cache ------------------ +================= + file driver devices refer to data servers, which are kept in a module level cache. Its reference is held over the lifetime of the deviceid pointing to it. lseg ----- +==== + lseg maintains an extra reference corresponding to the NFS_LSEG_VALID bit which holds it in the pnfs_layout_hdr's list. When the final lseg is removed from the pnfs_layout_hdr's list, the NFS_LAYOUT_DESTROYED bit is set, preventing any new lsegs from being added. layout drivers --------------- +============== PNFS utilizes what is called layout drivers. The STD defines 4 basic layout types: "files", "objects", "blocks", and "flexfiles". For each @@ -68,6 +73,6 @@ Blocks-layout-driver code is in: fs/nfs/blocklayout/.. directory Flexfiles-layout-driver code is in: fs/nfs/flexfilelayout/.. directory blocks-layout setup -------------------- +=================== TODO: Document the setup needs of the blocks layout driver -- 2.24.1