Skip to content

Commit 09eac7c

Browse files
mchehabJonathan Corbet
authored andcommitted
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>
1 parent efc930f commit 09eac7c

3 files changed

Lines changed: 23 additions & 25 deletions

File tree

‎Documentation/filesystems/caching/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Filesystem Caching
99
fscache
1010
object
1111
netfs-api
12+
operations

Documentation/filesystems/caching/operations.txt renamed to Documentation/filesystems/caching/operations.rst

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
================================
2-
ASYNCHRONOUS OPERATIONS HANDLING
3-
================================
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
================================
4+
Asynchronous Operations Handling
5+
================================
46

57
By: David Howells <dhowells@redhat.com>
68

7-
Contents:
9+
.. Contents:
810
911
(*) Overview.
1012
@@ -17,8 +19,7 @@ Contents:
1719
(*) Asynchronous callback.
1820
1921
20-
========
21-
OVERVIEW
22+
Overview
2223
========
2324

2425
FS-Cache has an asynchronous operations handling facility that it uses for its
@@ -33,11 +34,10 @@ backend for completion.
3334
To make use of this facility, <linux/fscache-cache.h> should be #included.
3435

3536

36-
===============================
37-
OPERATION RECORD INITIALISATION
37+
Operation Record Initialisation
3838
===============================
3939

40-
An operation is recorded in an fscache_operation struct:
40+
An operation is recorded in an fscache_operation struct::
4141

4242
struct fscache_operation {
4343
union {
@@ -50,7 +50,7 @@ An operation is recorded in an fscache_operation struct:
5050
};
5151

5252
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::
5454

5555
void fscache_operation_init(struct fscache_operation *op,
5656
fscache_operation_release_t release);
@@ -67,8 +67,7 @@ FSCACHE_OP_WAITING may be set in op->flags prior to each submission of the
6767
operation and waited for afterwards.
6868

6969

70-
==========
71-
PARAMETERS
70+
Parameters
7271
==========
7372

7473
There are a number of parameters that can be set in the operation record's flag
@@ -87,7 +86,7 @@ operations:
8786

8887
If this option is to be used, FSCACHE_OP_WAITING must be set in op->flags
8988
before submitting the operation, and the operating thread must wait for it
90-
to be cleared before proceeding:
89+
to be cleared before proceeding::
9190

9291
wait_on_bit(&op->flags, FSCACHE_OP_WAITING,
9392
TASK_UNINTERRUPTIBLE);
@@ -101,7 +100,7 @@ operations:
101100
page to a netfs page after the backing fs has read the page in.
102101

103102
If this option is used, op->fast_work and op->processor must be
104-
initialised before submitting the operation:
103+
initialised before submitting the operation::
105104

106105
INIT_WORK(&op->fast_work, do_some_work);
107106

@@ -114,7 +113,7 @@ operations:
114113
pages that have just been fetched from a remote server.
115114

116115
If this option is used, op->slow_work and op->processor must be
117-
initialised before submitting the operation:
116+
initialised before submitting the operation::
118117

119118
fscache_operation_init_slow(op, processor)
120119

@@ -132,8 +131,7 @@ Furthermore, operations may be one of two types:
132131
operations running at the same time.
133132

134133

135-
=========
136-
PROCEDURE
134+
Procedure
137135
=========
138136

139137
Operations are used through the following procedure:
@@ -143,7 +141,7 @@ Operations are used through the following procedure:
143141
generic op embedded within.
144142

145143
(2) The submitting thread must then submit the operation for processing using
146-
one of the following two functions:
144+
one of the following two functions::
147145

148146
int fscache_submit_op(struct fscache_object *object,
149147
struct fscache_operation *op);
@@ -164,7 +162,7 @@ Operations are used through the following procedure:
164162
operation of conflicting exclusivity is in progress on the object.
165163

166164
If the operation is asynchronous, the manager will retain a reference to
167-
it, so the caller should put their reference to it by passing it to:
165+
it, so the caller should put their reference to it by passing it to::
168166

169167
void fscache_put_operation(struct fscache_operation *op);
170168
@@ -179,26 +177,25 @@ Operations are used through the following procedure:
179177
(4) The operation holds an effective lock upon the object, preventing other
180178
exclusive ops conflicting until it is released. The operation can be
181179
enqueued for further immediate asynchronous processing by adjusting the
182-
CPU time provisioning option if necessary, eg:
180+
CPU time provisioning option if necessary, eg::
183181

184182
op->flags &= ~FSCACHE_OP_TYPE;
185183
op->flags |= ~FSCACHE_OP_FAST;
186184
187-
and calling:
185+
and calling::
188186

189187
void fscache_enqueue_operation(struct fscache_operation *op)
190188
191189
This can be used to allow other things to have use of the worker thread
192190
pools.
193191

194192

195-
=====================
196-
ASYNCHRONOUS CALLBACK
193+
Asynchronous Callback
197194
=====================
198195

199196
When used in asynchronous mode, the worker thread pool will invoke the
200197
processor method with a pointer to the operation. This should then get at the
201-
container struct by using container_of():
198+
container struct by using container_of()::
202199

203200
static void fscache_write_op(struct fscache_operation *_op)
204201
{

‎fs/fscache/operation.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
55
* Written by David Howells (dhowells@redhat.com)
66
*
7-
* See Documentation/filesystems/caching/operations.txt
7+
* See Documentation/filesystems/caching/operations.rst
88
*/
99

1010
#define FSCACHE_DEBUG_LEVEL OPERATION

0 commit comments

Comments
 (0)