Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp707973ybz; Wed, 15 Apr 2020 17:11:07 -0700 (PDT) X-Google-Smtp-Source: APiQypIhSK5WZ3mDnqWxXazQ1v+OHx4eezOmoscPeBbgHDk1x7G72pnzJxSKInQI6SHZbg29Rvmd X-Received: by 2002:a50:cd89:: with SMTP id p9mr27326793edi.188.1586995867557; Wed, 15 Apr 2020 17:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995867; cv=none; d=google.com; s=arc-20160816; b=f4RcpCDUbbg3TxZQpStOvbyLhh4TdMOxIhlVv1DVCrKzfK9P5XnKeiFEvAcNCeH6c+ CBYxslEc3/mYWoqrLltdm2BOogXrSexBitbEvjOLvQhJQOLG1lLye81/pNVCR3GJwxol TAbRSB18mMIs0avehKxeIciJNwNG3EZ8oJ4gwagDbbo+L2eLaLUQGOIAYz9liKvJXPsO 2djTHS+M/6gYIOSXPc4OYI6jNSP4CdhK5s0xiSNgsuN746k1yq/OTf0j91yHrU9a50nU yEtFT5UZKMM3r2KngjY7G6WgOz0psJLxdnxFiXNth7l9UJTtl+7OcWXPzrPlL9ZxRLPa jv8w== 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=pkABeNl4P0lxAOAr2tGHe/5Z5UYXNFpmc+8m4QynOfo=; b=Z2UcbWSdQM6didnpUF4IVKYirmtGV45Y+KTIqujpxKWIUQah1OlRJKHeVcnwv9REzz 7Lm84hnrT1AYxHqQaLAMGXMCwpSA25E1YIjuRTsG1B3JyxFjHzhq/0/b++td7/b5l4ip F5E2QJm+iA+MHyJLdi/H8hYimJZCXzHTXmmztHbETSzhub9qiIPj3tpeNTkGcsSYB8IB zfYYe3HWVlghGQQng4ndN9xB52bkzjTcrpv/aszoBXRJpLhBAVcQtNNNsB/bGQJXClXe HdGuz9YcMwchZqcJjJHO8NgDuWNWACZuwv4hC+4a25wrwD1msgu17jeN1Gh/ms8khwAU CpIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PMLJPImW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si9637067eju.18.2020.04.15.17.10.44; Wed, 15 Apr 2020 17:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PMLJPImW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388327AbgDOOos (ORCPT + 99 others); Wed, 15 Apr 2020 10:44:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:44598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392132AbgDOOcw (ORCPT ); Wed, 15 Apr 2020 10:32:52 -0400 Received: from mail.kernel.org (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A08D32076D; Wed, 15 Apr 2020 14:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586961170; bh=n4BmXd8N8vutOAdpVhWLKUoBRF2Vet4WcaVXRIJWT+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PMLJPImWSOOgoIAAXR2PGXYTpW6V3S2ROiKLK86ST/VJKQtUXRgNa8JqL4uSOl13L qcc2/X8nXjQY5o9C5PrL+pAjxUmSZ6kmwJ0RxX+d6Ffe0bd6Fx32pyUfVsoqe1kNPX MEW/sGi0ZHuY/AVmYAZH4qbQYNwnUKqScQ4rExN0= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jOj5s-006kNp-Uh; Wed, 15 Apr 2020 16:32:48 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , David Howells , linux-cachefs@redhat.com Subject: [PATCH 02/34] docs: filesystems: convert caching/object.txt to ReST Date: Wed, 15 Apr 2020 16:32:15 +0200 Message-Id: <65a83e92dcf7461361052ca2d2cfb8c3f27f7fd6.1586960617.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.2 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 - Add a SPDX header; - Adjust document and section titles; - Comment out text ToC for html/pdf output; - Some whitespace fixes and new line breaks; - Adjust the events list to make them look better for html output; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/filesystems/caching/fscache.txt | 2 +- Documentation/filesystems/caching/index.rst | 9 ++++ .../caching/{object.txt => object.rst} | 43 ++++++++----------- Documentation/filesystems/index.rst | 2 + fs/fscache/object.c | 2 +- 5 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 Documentation/filesystems/caching/index.rst rename Documentation/filesystems/caching/{object.txt => object.rst} (95%) diff --git a/Documentation/filesystems/caching/fscache.txt b/Documentation/filesystems/caching/fscache.txt index 50f0a5757f48..071ff50a774d 100644 --- a/Documentation/filesystems/caching/fscache.txt +++ b/Documentation/filesystems/caching/fscache.txt @@ -191,7 +191,7 @@ The cache backend API to FS-Cache can be found in: A description of the internal representations and object state machine can be found in: - Documentation/filesystems/caching/object.txt + Documentation/filesystems/caching/object.rst ======================= diff --git a/Documentation/filesystems/caching/index.rst b/Documentation/filesystems/caching/index.rst new file mode 100644 index 000000000000..e5ec95ff0be2 --- /dev/null +++ b/Documentation/filesystems/caching/index.rst @@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0 + +Filesystem Caching +================== + +.. toctree:: + :maxdepth: 2 + + object diff --git a/Documentation/filesystems/caching/object.txt b/Documentation/filesystems/caching/object.rst similarity index 95% rename from Documentation/filesystems/caching/object.txt rename to Documentation/filesystems/caching/object.rst index 100ff41127e4..ce0e043ccd33 100644 --- a/Documentation/filesystems/caching/object.txt +++ b/Documentation/filesystems/caching/object.rst @@ -1,10 +1,12 @@ - ==================================================== - IN-KERNEL CACHE OBJECT REPRESENTATION AND MANAGEMENT - ==================================================== +.. SPDX-License-Identifier: GPL-2.0 + +==================================================== +In-Kernel Cache Object Representation and Management +==================================================== By: David Howells -Contents: +.. Contents: (*) Representation @@ -18,8 +20,7 @@ Contents: (*) The set of events. -============== -REPRESENTATION +Representation ============== FS-Cache maintains an in-kernel representation of each object that a netfs is @@ -38,7 +39,7 @@ or even by no objects (it may not be cached). Furthermore, both cookies and objects are hierarchical. The two hierarchies correspond, but the cookies tree is a superset of the union of the object trees -of multiple caches: +of multiple caches:: NETFS INDEX TREE : CACHE 1 : CACHE 2 : : @@ -89,8 +90,7 @@ pointers to the cookies. The cookies themselves and any objects attached to those cookies are hidden from it. -=============================== -OBJECT MANAGEMENT STATE MACHINE +Object Management State Machine =============================== Within FS-Cache, each active object is managed by its own individual state @@ -124,7 +124,7 @@ is not masked, the object will be queued for processing (by calling fscache_enqueue_object()). -PROVISION OF CPU TIME +Provision of CPU Time --------------------- The work to be done by the various states was given CPU time by the threads of @@ -141,7 +141,7 @@ because: workqueues don't necessarily have the right numbers of threads. -LOCKING SIMPLIFICATION +Locking Simplification ---------------------- Because only one worker thread may be operating on any particular object's @@ -151,8 +151,7 @@ from the cache backend's representation (fscache_object) - which may be requested from either end. -================= -THE SET OF STATES +The Set of States ================= The object state machine has a set of states that it can be in. There are @@ -275,19 +274,17 @@ memory and potentially deletes stuff from disk: this state. -THE SET OF EVENTS +The Set of Events ----------------- There are a number of events that can be raised to an object state machine: - (*) FSCACHE_OBJECT_EV_UPDATE - + FSCACHE_OBJECT_EV_UPDATE The netfs requested that an object be updated. The state machine will ask the cache backend to update the object, and the cache backend will ask the netfs for details of the change through its cookie definition ops. - (*) FSCACHE_OBJECT_EV_CLEARED - + FSCACHE_OBJECT_EV_CLEARED This is signalled in two circumstances: (a) when an object's last child object is dropped and @@ -296,20 +293,16 @@ There are a number of events that can be raised to an object state machine: This is used to proceed from the dying state. - (*) FSCACHE_OBJECT_EV_ERROR - + FSCACHE_OBJECT_EV_ERROR This is signalled when an I/O error occurs during the processing of some object. - (*) FSCACHE_OBJECT_EV_RELEASE - (*) FSCACHE_OBJECT_EV_RETIRE - + FSCACHE_OBJECT_EV_RELEASE, FSCACHE_OBJECT_EV_RETIRE These are signalled when the netfs relinquishes a cookie it was using. The event selected depends on whether the netfs asks for the backing object to be retired (deleted) or retained. - (*) FSCACHE_OBJECT_EV_WITHDRAW - + FSCACHE_OBJECT_EV_WITHDRAW This is signalled when the cache backend wants to withdraw an object. This means that the object will have to be detached from the netfs's cookie. diff --git a/Documentation/filesystems/index.rst b/Documentation/filesystems/index.rst index e7b46dac7079..773af390c5e5 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst @@ -25,6 +25,8 @@ algorithms work. locking directory-locking + caching/index + porting Filesystem support layers diff --git a/fs/fscache/object.c b/fs/fscache/object.c index cfeba839a0f2..efaa003b8323 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c @@ -4,7 +4,7 @@ * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.com) * - * See Documentation/filesystems/caching/object.txt for a description of the + * See Documentation/filesystems/caching/object.rst for a description of the * object state machine and the in-kernel representations. */ -- 2.25.2