Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: filesystems: caching/operations.txt: convert it to ReST

- Add a SPDX header;
- Adjust document and section titles;
- Comment out text ToC for html/pdf output;
- Mark literal blocks as such;
- Add it to filesystems/caching/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/97e71cc598a4f61df484ebda3ec06b63530ceb62.1588021877.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
09eac7c5 efc930fa

+23 -25
+1
Documentation/filesystems/caching/index.rst
··· 9 9 fscache 10 10 object 11 11 netfs-api 12 + operations
+21 -24
Documentation/filesystems/caching/operations.txt Documentation/filesystems/caching/operations.rst
··· 1 - ================================ 2 - ASYNCHRONOUS OPERATIONS HANDLING 3 - ================================ 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ================================ 4 + Asynchronous Operations Handling 5 + ================================ 4 6 5 7 By: David Howells <dhowells@redhat.com> 6 8 7 - Contents: 9 + .. Contents: 8 10 9 11 (*) Overview. 10 12 ··· 19 17 (*) Asynchronous callback. 20 18 21 19 22 - ======== 23 - OVERVIEW 20 + Overview 24 21 ======== 25 22 26 23 FS-Cache has an asynchronous operations handling facility that it uses for its ··· 34 33 To make use of this facility, <linux/fscache-cache.h> should be #included. 35 34 36 35 37 - =============================== 38 - OPERATION RECORD INITIALISATION 36 + Operation Record Initialisation 39 37 =============================== 40 38 41 - An operation is recorded in an fscache_operation struct: 39 + An operation is recorded in an fscache_operation struct:: 42 40 43 41 struct fscache_operation { 44 42 union { ··· 50 50 }; 51 51 52 52 Someone wanting to issue an operation should allocate something with this 53 - struct embedded in it. They should initialise it by calling: 53 + struct embedded in it. They should initialise it by calling:: 54 54 55 55 void fscache_operation_init(struct fscache_operation *op, 56 56 fscache_operation_release_t release); ··· 67 67 operation and waited for afterwards. 68 68 69 69 70 - ========== 71 - PARAMETERS 70 + Parameters 72 71 ========== 73 72 74 73 There are a number of parameters that can be set in the operation record's flag ··· 86 87 87 88 If this option is to be used, FSCACHE_OP_WAITING must be set in op->flags 88 89 before submitting the operation, and the operating thread must wait for it 89 - to be cleared before proceeding: 90 + to be cleared before proceeding:: 90 91 91 92 wait_on_bit(&op->flags, FSCACHE_OP_WAITING, 92 93 TASK_UNINTERRUPTIBLE); ··· 100 101 page to a netfs page after the backing fs has read the page in. 101 102 102 103 If this option is used, op->fast_work and op->processor must be 103 - initialised before submitting the operation: 104 + initialised before submitting the operation:: 104 105 105 106 INIT_WORK(&op->fast_work, do_some_work); 106 107 ··· 113 114 pages that have just been fetched from a remote server. 114 115 115 116 If this option is used, op->slow_work and op->processor must be 116 - initialised before submitting the operation: 117 + initialised before submitting the operation:: 117 118 118 119 fscache_operation_init_slow(op, processor) 119 120 ··· 131 132 operations running at the same time. 132 133 133 134 134 - ========= 135 - PROCEDURE 135 + Procedure 136 136 ========= 137 137 138 138 Operations are used through the following procedure: ··· 141 143 generic op embedded within. 142 144 143 145 (2) The submitting thread must then submit the operation for processing using 144 - one of the following two functions: 146 + one of the following two functions:: 145 147 146 148 int fscache_submit_op(struct fscache_object *object, 147 149 struct fscache_operation *op); ··· 162 164 operation of conflicting exclusivity is in progress on the object. 163 165 164 166 If the operation is asynchronous, the manager will retain a reference to 165 - it, so the caller should put their reference to it by passing it to: 167 + it, so the caller should put their reference to it by passing it to:: 166 168 167 169 void fscache_put_operation(struct fscache_operation *op); 168 170 ··· 177 179 (4) The operation holds an effective lock upon the object, preventing other 178 180 exclusive ops conflicting until it is released. The operation can be 179 181 enqueued for further immediate asynchronous processing by adjusting the 180 - CPU time provisioning option if necessary, eg: 182 + CPU time provisioning option if necessary, eg:: 181 183 182 184 op->flags &= ~FSCACHE_OP_TYPE; 183 185 op->flags |= ~FSCACHE_OP_FAST; 184 186 185 - and calling: 187 + and calling:: 186 188 187 189 void fscache_enqueue_operation(struct fscache_operation *op) 188 190 ··· 190 192 pools. 191 193 192 194 193 - ===================== 194 - ASYNCHRONOUS CALLBACK 195 + Asynchronous Callback 195 196 ===================== 196 197 197 198 When used in asynchronous mode, the worker thread pool will invoke the 198 199 processor method with a pointer to the operation. This should then get at the 199 - container struct by using container_of(): 200 + container struct by using container_of():: 200 201 201 202 static void fscache_write_op(struct fscache_operation *_op) 202 203 {
+1 -1
fs/fscache/operation.c
··· 4 4 * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. 5 5 * Written by David Howells (dhowells@redhat.com) 6 6 * 7 - * See Documentation/filesystems/caching/operations.txt 7 + * See Documentation/filesystems/caching/operations.rst 8 8 */ 9 9 10 10 #define FSCACHE_DEBUG_LEVEL OPERATION