Skip to content

Commit 58ecde9

Browse files
committed
Merge patch series "exportfs: Some kernel-doc fixes"
André Almeida <andrealmeid@igalia.com> says: This short series removes some duplicated documentation and address some kernel-doc issues. * patches from https://patch.msgid.link/20260112-tonyk-fs_uuid-v1-0-acc1889de772@igalia.com: docs: exportfs: Use source code struct documentation exportfs: Complete kernel-doc for struct export_operations exportfs: Mark struct export_operations functions at kernel-doc exportfs: Fix kernel-doc output for get_name() Link: https://patch.msgid.link/20260112-tonyk-fs_uuid-v1-0-acc1889de772@igalia.com Signed-off-by: Christian Brauner <brauner@kernel.org>
2 parents 589cff4 + f9a6a3f commit 58ecde9

File tree

2 files changed

+28
-47
lines changed

2 files changed

+28
-47
lines changed

Documentation/filesystems/nfs/exporting.rst

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -119,43 +119,11 @@ For a filesystem to be exportable it must:
119119

120120
A file system implementation declares that instances of the filesystem
121121
are exportable by setting the s_export_op field in the struct
122-
super_block. This field must point to a "struct export_operations"
123-
struct which has the following members:
124-
125-
encode_fh (mandatory)
126-
Takes a dentry and creates a filehandle fragment which may later be used
127-
to find or create a dentry for the same object.
128-
129-
fh_to_dentry (mandatory)
130-
Given a filehandle fragment, this should find the implied object and
131-
create a dentry for it (possibly with d_obtain_alias).
132-
133-
fh_to_parent (optional but strongly recommended)
134-
Given a filehandle fragment, this should find the parent of the
135-
implied object and create a dentry for it (possibly with
136-
d_obtain_alias). May fail if the filehandle fragment is too small.
137-
138-
get_parent (optional but strongly recommended)
139-
When given a dentry for a directory, this should return a dentry for
140-
the parent. Quite possibly the parent dentry will have been allocated
141-
by d_alloc_anon. The default get_parent function just returns an error
142-
so any filehandle lookup that requires finding a parent will fail.
143-
->lookup("..") is *not* used as a default as it can leave ".." entries
144-
in the dcache which are too messy to work with.
145-
146-
get_name (optional)
147-
When given a parent dentry and a child dentry, this should find a name
148-
in the directory identified by the parent dentry, which leads to the
149-
object identified by the child dentry. If no get_name function is
150-
supplied, a default implementation is provided which uses vfs_readdir
151-
to find potential names, and matches inode numbers to find the correct
152-
match.
153-
154-
flags
155-
Some filesystems may need to be handled differently than others. The
156-
export_operations struct also includes a flags field that allows the
157-
filesystem to communicate such information to nfsd. See the Export
158-
Operations Flags section below for more explanation.
122+
super_block. This field must point to a struct export_operations
123+
which has the following members:
124+
125+
.. kernel-doc:: include/linux/exportfs.h
126+
:identifiers: struct export_operations
159127

160128
A filehandle fragment consists of an array of 1 or more 4byte words,
161129
together with a one byte "type".

include/linux/exportfs.h

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ struct handle_to_path_ctx {
201201
* @commit_metadata: commit metadata changes to stable storage
202202
*
203203
* See Documentation/filesystems/nfs/exporting.rst for details on how to use
204-
* this interface correctly.
204+
* this interface correctly and the definition of the flags.
205205
*
206-
* encode_fh:
206+
* @encode_fh:
207207
* @encode_fh should store in the file handle fragment @fh (using at most
208208
* @max_len bytes) information that can be used by @decode_fh to recover the
209209
* file referred to by the &struct dentry @de. If @flag has CONNECTABLE bit
@@ -215,7 +215,7 @@ struct handle_to_path_ctx {
215215
* greater than @max_len*4 bytes). On error @max_len contains the minimum
216216
* size(in 4 byte unit) needed to encode the file handle.
217217
*
218-
* fh_to_dentry:
218+
* @fh_to_dentry:
219219
* @fh_to_dentry is given a &struct super_block (@sb) and a file handle
220220
* fragment (@fh, @fh_len). It should return a &struct dentry which refers
221221
* to the same file that the file handle fragment refers to. If it cannot,
@@ -227,31 +227,44 @@ struct handle_to_path_ctx {
227227
* created with d_alloc_root. The caller can then find any other extant
228228
* dentries by following the d_alias links.
229229
*
230-
* fh_to_parent:
230+
* @fh_to_parent:
231231
* Same as @fh_to_dentry, except that it returns a pointer to the parent
232232
* dentry if it was encoded into the filehandle fragment by @encode_fh.
233233
*
234-
* get_name:
234+
* @get_name:
235235
* @get_name should find a name for the given @child in the given @parent
236236
* directory. The name should be stored in the @name (with the
237-
* understanding that it is already pointing to a %NAME_MAX+1 sized
237+
* understanding that it is already pointing to a %NAME_MAX + 1 sized
238238
* buffer. get_name() should return %0 on success, a negative error code
239239
* or error. @get_name will be called without @parent->i_rwsem held.
240240
*
241-
* get_parent:
241+
* @get_parent:
242242
* @get_parent should find the parent directory for the given @child which
243243
* is also a directory. In the event that it cannot be found, or storage
244244
* space cannot be allocated, a %ERR_PTR should be returned.
245245
*
246-
* permission:
246+
* @permission:
247247
* Allow filesystems to specify a custom permission function.
248248
*
249-
* open:
249+
* @open:
250250
* Allow filesystems to specify a custom open function.
251251
*
252-
* commit_metadata:
252+
* @commit_metadata:
253253
* @commit_metadata should commit metadata changes to stable storage.
254254
*
255+
* @get_uuid:
256+
* Get a filesystem unique signature exposed to clients.
257+
*
258+
* @map_blocks:
259+
* Map and, if necessary, allocate blocks for a layout.
260+
*
261+
* @commit_blocks:
262+
* Commit blocks in a layout once the client is done with them.
263+
*
264+
* @flags:
265+
* Allows the filesystem to communicate to nfsd that it may want to do things
266+
* differently when dealing with it.
267+
*
255268
* Locking rules:
256269
* get_parent is called with child->d_inode->i_rwsem down
257270
* get_name is not (which is possibly inconsistent)

0 commit comments

Comments
 (0)