History

docs: filesystems: convert mount_api.txt to ReST

- Add a SPDX header; - Adjust document and section titles; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add table markups; - Add lists markups; - Add it to filesystems/index.rst.

Mauro Carvalho Chehab committed 6 years ago

Commit 791a17e1 parent a02dcdf4 files · +218 −116Browse files

Unified · Split

4 files
  1. Documentation/filesystems/index.rst +1 −0
  2. Documentation/filesystems/mount_api.rst +215 −114
  3. include/linux/fs_context.h +1 −1
  4. include/linux/lsm_hooks.h +1 −1
Documentation/filesystems/index.rst+1−0
@@ -30,6 +30,7 @@ algorithms work. · 29 unmodified lines
3030 files
3131 locks
3232 mandatory-locking
33+ mount_api
3334
3435 automount-support
3536
Documentation/filesystems/mount_api.rstrenamed from Documentation/filesystems/mount_api.txt+215−114
@@ -1,8 +1,10 @@
1− ====================
2− FILESYSTEM MOUNT API
3− ====================
1+.. SPDX-License-Identifier: GPL-2.0
42
5−CONTENTS
3+====================
4+fILESYSTEM Mount API
5+====================
6+
7+.. CONTENTS
68
79 (1) Overview.
810
@@ -21,8 +23,7 @@ CONTENTS · 12 unmodified lines
2123 (8) Parameter helper functions.
2224
2325
24−========
25−OVERVIEW
26+Overview
2627 ========
2728
2829 The creation of new mounts is now to be done in a multistep process:
@@ -43,7 +44,7 @@ The creation of new mounts is now to be done in a multistep process: · 14 unmodified lines
4344
4445 (7) Destroy the context.
4546
46−To support this, the file_system_type struct gains two new fields:
47+To support this, the file_system_type struct gains two new fields::
4748
4849 int (*init_fs_context)(struct fs_context *fc);
4950 const struct fs_parameter_description *parameters;
@@ -57,12 +58,11 @@ Note that security initialisation is done *after* the filesystem is called so · 7 unmodified lines
5758 that the namespaces may be adjusted first.
5859
5960
60−======================
61−THE FILESYSTEM CONTEXT
61+The Filesystem context
6262 ======================
6363
6464 The creation and reconfiguration of a superblock is governed by a filesystem
65−context. This is represented by the fs_context structure:
65+context. This is represented by the fs_context structure::
6666
6767 struct fs_context {
6868 const struct fs_context_operations *ops;
@@ -86,78 +86,106 @@ context. This is represented by the fs_context structure: · 17 unmodified lines
8686
8787 The fs_context fields are as follows:
8888
89− (*) const struct fs_context_operations *ops
89+ * ::
90+
91+ const struct fs_context_operations *ops
9092
9193 These are operations that can be done on a filesystem context (see
9294 below). This must be set by the ->init_fs_context() file_system_type
9395 operation.
9496
95− (*) struct file_system_type *fs_type
97+ * ::
98+
99+ struct file_system_type *fs_type
96100
97101 A pointer to the file_system_type of the filesystem that is being
98102 constructed or reconfigured. This retains a reference on the type owner.
99103
100− (*) void *fs_private
104+ * ::
105+
106+ void *fs_private
101107
102108 A pointer to the file system's private data. This is where the filesystem
103109 will need to store any options it parses.
104110
105− (*) struct dentry *root
111+ * ::
112+
113+ struct dentry *root
106114
107115 A pointer to the root of the mountable tree (and indirectly, the
108116 superblock thereof). This is filled in by the ->get_tree() op. If this
109117 is set, an active reference on root->d_sb must also be held.
110118
111− (*) struct user_namespace *user_ns
112− (*) struct net *net_ns
119+ * ::
120+
121+ struct user_namespace *user_ns
122+ struct net *net_ns
113123
114124 There are a subset of the namespaces in use by the invoking process. They
115125 retain references on each namespace. The subscribed namespaces may be
116126 replaced by the filesystem to reflect other sources, such as the parent
117127 mount superblock on an automount.
118128
119− (*) const struct cred *cred
129+ * ::
130+
131+ const struct cred *cred
120132
121133 The mounter's credentials. This retains a reference on the credentials.
122134
123− (*) char *source
135+ * ::
136+
137+ char *source
124138
125139 This specifies the source. It may be a block device (e.g. /dev/sda1) or
126140 something more exotic, such as the "host:/path" that NFS desires.
127141
128− (*) char *subtype
142+ * ::
143+
144+ char *subtype
129145
130146 This is a string to be added to the type displayed in /proc/mounts to
131147 qualify it (used by FUSE). This is available for the filesystem to set if
132148 desired.
133149
134− (*) void *security
150+ * ::
151+
152+ void *security
135153
136154 A place for the LSMs to hang their security data for the superblock. The
137155 relevant security operations are described below.
138156
139− (*) void *s_fs_info
157+ * ::
158+
159+ void *s_fs_info
140160
141161 The proposed s_fs_info for a new superblock, set in the superblock by
142162 sget_fc(). This can be used to distinguish superblocks.
143163
144− (*) unsigned int sb_flags
145− (*) unsigned int sb_flags_mask
164+ * ::
165+
166+ unsigned int sb_flags
167+ unsigned int sb_flags_mask
146168
147169 Which bits SB_* flags are to be set/cleared in super_block::s_flags.
148170
149− (*) unsigned int s_iflags
171+ * ::
172+
173+ unsigned int s_iflags
150174
151175 These will be bitwise-OR'd with s->s_iflags when a superblock is created.
152176
153− (*) enum fs_context_purpose
177+ * ::
178+
179+ enum fs_context_purpose
154180
155181 This indicates the purpose for which the context is intended. The
156182 available values are:
157183
158− FS_CONTEXT_FOR_MOUNT, -- New superblock for explicit mount
159− FS_CONTEXT_FOR_SUBMOUNT -- New automatic submount of extant mount
160− FS_CONTEXT_FOR_RECONFIGURE -- Change an existing mount
184+ ========================== ======================================
185+ FS_CONTEXT_FOR_MOUNT, New superblock for explicit mount
186+ FS_CONTEXT_FOR_SUBMOUNT New automatic submount of extant mount
187+ FS_CONTEXT_FOR_RECONFIGURE Change an existing mount
188+ ========================== ======================================
161189
162190 The mount context is created by calling vfs_new_fs_context() or
163191 vfs_dup_fs_context() and is destroyed with put_fs_context(). Note that the
@@ -176,11 +204,10 @@ mount context. For instance, NFS might pin the appropriate protocol version · 12 unmodified lines
176204 module.
177205
178206
179−=================================
180−THE FILESYSTEM CONTEXT OPERATIONS
207+The Filesystem Context Operations
181208 =================================
182209
183−The filesystem context points to a table of operations:
210+The filesystem context points to a table of operations::
184211
185212 struct fs_context_operations {
186213 void (*free)(struct fs_context *fc);
@@ -195,24 +222,32 @@ The filesystem context points to a table of operations: · 8 unmodified lines
195222 These operations are invoked by the various stages of the mount procedure to
196223 manage the filesystem context. They are as follows:
197224
198− (*) void (*free)(struct fs_context *fc);
225+ * ::
226+
227+ void (*free)(struct fs_context *fc);
199228
200229 Called to clean up the filesystem-specific part of the filesystem context
201230 when the context is destroyed. It should be aware that parts of the
202231 context may have been removed and NULL'd out by ->get_tree().
203232
204− (*) int (*dup)(struct fs_context *fc, struct fs_context *src_fc);
233+ * ::
234+
235+ int (*dup)(struct fs_context *fc, struct fs_context *src_fc);
205236
206237 Called when a filesystem context has been duplicated to duplicate the
207238 filesystem-private data. An error may be returned to indicate failure to
208239 do this.
209240
210− [!] Note that even if this fails, put_fs_context() will be called
241+ .. Warning::
242+
243+ Note that even if this fails, put_fs_context() will be called
211244 immediately thereafter, so ->dup() *must* make the
212245 filesystem-private data safe for ->free().
213246
214− (*) int (*parse_param)(struct fs_context *fc,
215− struct struct fs_parameter *param);
247+ * ::
248+
249+ int (*parse_param)(struct fs_context *fc,
250+ struct struct fs_parameter *param);
216251
217252 Called when a parameter is being added to the filesystem context. param
218253 points to the key name and maybe a value object. VFS-specific options
@@ -224,7 +259,9 @@ manage the filesystem context. They are as follows: · 5 unmodified lines
224259
225260 If successful, 0 should be returned or a negative error code otherwise.
226261
227− (*) int (*parse_monolithic)(struct fs_context *fc, void *data);
262+ * ::
263+
264+ int (*parse_monolithic)(struct fs_context *fc, void *data);
228265
229266 Called when the mount(2) system call is invoked to pass the entire data
230267 page in one go. If this is expected to be just a list of "key[=val]"
@@ -236,7 +273,9 @@ manage the filesystem context. They are as follows: · 5 unmodified lines
236273 finds it's the standard key-val list then it may pass it off to
237274 generic_parse_monolithic().
238275
239− (*) int (*get_tree)(struct fs_context *fc);
276+ * ::
277+
278+ int (*get_tree)(struct fs_context *fc);
240279
241280 Called to get or create the mountable root and superblock, using the
242281 information stored in the filesystem context (reconfiguration goes via a
@@ -249,7 +288,9 @@ manage the filesystem context. They are as follows: · 6 unmodified lines
249288 The phase on a userspace-driven context will be set to only allow this to
250289 be called once on any particular context.
251290
252− (*) int (*reconfigure)(struct fs_context *fc);
291+ * ::
292+
293+ int (*reconfigure)(struct fs_context *fc);
253294
254295 Called to effect reconfiguration of a superblock using information stored
255296 in the filesystem context. It may detach any resources it desires from
@@ -259,19 +300,20 @@ manage the filesystem context. They are as follows: · 3 unmodified lines
259300 On success it should return 0. In the case of an error, it should return
260301 a negative error code.
261302
262− [NOTE] reconfigure is intended as a replacement for remount_fs.
303+ .. Note:: reconfigure is intended as a replacement for remount_fs.
263304
264305
265−===========================
266−FILESYSTEM CONTEXT SECURITY
306+Filesystem context Security
267307 ===========================
268308
269309 The filesystem context contains a security pointer that the LSMs can use for
270310 building up a security context for the superblock to be mounted. There are a
271311 number of operations used by the new mount code for this purpose:
272312
273− (*) int security_fs_context_alloc(struct fs_context *fc,
274− struct dentry *reference);
313+ * ::
314+
315+ int security_fs_context_alloc(struct fs_context *fc,
316+ struct dentry *reference);
275317
276318 Called to initialise fc->security (which is preset to NULL) and allocate
277319 any resources needed. It should return 0 on success or a negative error
@@ -283,22 +325,28 @@ number of operations used by the new mount code for this purpose: · 5 unmodified lines
283325 non-NULL in the case of a submount (FS_CONTEXT_FOR_SUBMOUNT) in which case
284326 it indicates the automount point.
285327
286− (*) int security_fs_context_dup(struct fs_context *fc,
287− struct fs_context *src_fc);
328+ * ::
329+
330+ int security_fs_context_dup(struct fs_context *fc,
331+ struct fs_context *src_fc);
288332
289333 Called to initialise fc->security (which is preset to NULL) and allocate
290334 any resources needed. The original filesystem context is pointed to by
291335 src_fc and may be used for reference. It should return 0 on success or a
292336 negative error code on failure.
293337
294− (*) void security_fs_context_free(struct fs_context *fc);
338+ * ::
339+
340+ void security_fs_context_free(struct fs_context *fc);
295341
296342 Called to clean up anything attached to fc->security. Note that the
297343 contents may have been transferred to a superblock and the pointer cleared
298344 during get_tree.
299345
300− (*) int security_fs_context_parse_param(struct fs_context *fc,
301− struct fs_parameter *param);
346+ * ::
347+
348+ int security_fs_context_parse_param(struct fs_context *fc,
349+ struct fs_parameter *param);
302350
303351 Called for each mount parameter, including the source. The arguments are
304352 as for the ->parse_param() method. It should return 0 to indicate that
@@ -310,7 +358,9 @@ number of operations used by the new mount code for this purpose: · 5 unmodified lines
310358 (provided the value pointer is NULL'd out). If it is stolen, 1 must be
311359 returned to prevent it being passed to the filesystem.
312360
313− (*) int security_fs_context_validate(struct fs_context *fc);
361+ * ::
362+
363+ int security_fs_context_validate(struct fs_context *fc);
314364
315365 Called after all the options have been parsed to validate the collection
316366 as a whole and to do any necessary allocation so that
@@ -320,36 +370,43 @@ number of operations used by the new mount code for this purpose: · 3 unmodified lines
320370 In the case of reconfiguration, the target superblock will be accessible
321371 via fc->root.
322372
323− (*) int security_sb_get_tree(struct fs_context *fc);
373+ * ::
374+
375+ int security_sb_get_tree(struct fs_context *fc);
324376
325377 Called during the mount procedure to verify that the specified superblock
326378 is allowed to be mounted and to transfer the security data there. It
327379 should return 0 or a negative error code.
328380
329− (*) void security_sb_reconfigure(struct fs_context *fc);
381+ * ::
382+
383+ void security_sb_reconfigure(struct fs_context *fc);
330384
331385 Called to apply any reconfiguration to an LSM's context. It must not
332386 fail. Error checking and resource allocation must be done in advance by
333387 the parameter parsing and validation hooks.
334388
335− (*) int security_sb_mountpoint(struct fs_context *fc, struct path *mountpoint,
336− unsigned int mnt_flags);
389+ * ::
390+
391+ int security_sb_mountpoint(struct fs_context *fc,
392+ struct path *mountpoint,
393+ unsigned int mnt_flags);
337394
338395 Called during the mount procedure to verify that the root dentry attached
339396 to the context is permitted to be attached to the specified mountpoint.
340397 It should return 0 on success or a negative error code on failure.
341398
342399
343−==========================
344−VFS FILESYSTEM CONTEXT API
400+VFS Filesystem context API
345401 ==========================
346402
347403 There are four operations for creating a filesystem context and one for
348404 destroying a context:
349405
350− (*) struct fs_context *fs_context_for_mount(
351− struct file_system_type *fs_type,
352− unsigned int sb_flags);
406+ * ::
407+
408+ struct fs_context *fs_context_for_mount(struct file_system_type *fs_type,
409+ unsigned int sb_flags);
353410
354411 Allocate a filesystem context for the purpose of setting up a new mount,
355412 whether that be with a new superblock or sharing an existing one. This
@@ -359,7 +416,9 @@ destroying a context: · 3 unmodified lines
359416 fs_type specifies the filesystem type that will manage the context and
360417 sb_flags presets the superblock flags stored therein.
361418
362− (*) struct fs_context *fs_context_for_reconfigure(
419+ * ::
420+
421+ struct fs_context *fs_context_for_reconfigure(
363422 struct dentry *dentry,
364423 unsigned int sb_flags,
365424 unsigned int sb_flags_mask);
@@ -369,7 +428,9 @@ destroying a context: · 3 unmodified lines
369428 configured. sb_flags and sb_flags_mask indicate which superblock flags
370429 need changing and to what.
371430
372− (*) struct fs_context *fs_context_for_submount(
431+ * ::
432+
433+ struct fs_context *fs_context_for_submount(
373434 struct file_system_type *fs_type,
374435 struct dentry *reference);
375436
@@ -382,7 +443,9 @@ destroying a context: · 6 unmodified lines
382443 Note that it's not a requirement that the reference dentry be of the same
383444 filesystem type as fs_type.
384445
385− (*) struct fs_context *vfs_dup_fs_context(struct fs_context *src_fc);
446+ * ::
447+
448+ struct fs_context *vfs_dup_fs_context(struct fs_context *src_fc);
386449
387450 Duplicate a filesystem context, copying any options noted and duplicating
388451 or additionally referencing any resources held therein. This is available
@@ -392,14 +455,18 @@ destroying a context: · 3 unmodified lines
392455
393456 The purpose in the new context is inherited from the old one.
394457
395− (*) void put_fs_context(struct fs_context *fc);
458+ * ::
459+
460+ void put_fs_context(struct fs_context *fc);
396461
397462 Destroy a filesystem context, releasing any resources it holds. This
398463 calls the ->free() operation. This is intended to be called by anyone who
399464 created a filesystem context.
400465
401− [!] filesystem contexts are not refcounted, so this causes unconditional
402− destruction.
466+ .. Warning::
467+
468+ filesystem contexts are not refcounted, so this causes unconditional
469+ destruction.
403470
404471 In all the above operations, apart from the put op, the return is a mount
405472 context pointer or a negative error code.
@@ -407,8 +474,10 @@ context pointer or a negative error code. · 1 unmodified line
407474 For the remaining operations, if an error occurs, a negative error code will be
408475 returned.
409476
410− (*) int vfs_parse_fs_param(struct fs_context *fc,
411− struct fs_parameter *param);
477+ * ::
478+
479+ int vfs_parse_fs_param(struct fs_context *fc,
480+ struct fs_parameter *param);
412481
413482 Supply a single mount parameter to the filesystem context. This include
414483 the specification of the source/device which is specified as the "source"
@@ -423,53 +492,64 @@ returned. · 8 unmodified lines
423492
424493 The parameter value is typed and can be one of:
425494
426− fs_value_is_flag, Parameter not given a value.
427− fs_value_is_string, Value is a string
428− fs_value_is_blob, Value is a binary blob
429− fs_value_is_filename, Value is a filename* + dirfd
430− fs_value_is_file, Value is an open file (file*)
495+ ==================== =============================
496+ fs_value_is_flag Parameter not given a value
497+ fs_value_is_string Value is a string
498+ fs_value_is_blob Value is a binary blob
499+ fs_value_is_filename Value is a filename* + dirfd
500+ fs_value_is_file Value is an open file (file*)
501+ ==================== =============================
431502
432503 If there is a value, that value is stored in a union in the struct in one
433504 of param->{string,blob,name,file}. Note that the function may steal and
434505 clear the pointer, but then becomes responsible for disposing of the
435506 object.
436507
437− (*) int vfs_parse_fs_string(struct fs_context *fc, const char *key,
438− const char *value, size_t v_size);
508+ * ::
509+
510+ int vfs_parse_fs_string(struct fs_context *fc, const char *key,
511+ const char *value, size_t v_size);
439512
440513 A wrapper around vfs_parse_fs_param() that copies the value string it is
441514 passed.
442515
443− (*) int generic_parse_monolithic(struct fs_context *fc, void *data);
516+ * ::
517+
518+ int generic_parse_monolithic(struct fs_context *fc, void *data);
444519
445520 Parse a sys_mount() data page, assuming the form to be a text list
446521 consisting of key[=val] options separated by commas. Each item in the
447522 list is passed to vfs_mount_option(). This is the default when the
448523 ->parse_monolithic() method is NULL.
449524
450− (*) int vfs_get_tree(struct fs_context *fc);
525+ * ::
526+
527+ int vfs_get_tree(struct fs_context *fc);
451528
452529 Get or create the mountable root and superblock, using the parameters in
453530 the filesystem context to select/configure the superblock. This invokes
454531 the ->get_tree() method.
455532
456− (*) struct vfsmount *vfs_create_mount(struct fs_context *fc);
533+ * ::
534+
535+ struct vfsmount *vfs_create_mount(struct fs_context *fc);
457536
458537 Create a mount given the parameters in the specified filesystem context.
459538 Note that this does not attach the mount to anything.
460539
461540
462−===========================
463−SUPERBLOCK CREATION HELPERS
541+Superblock Creation Helpers
464542 ===========================
465543
466544 A number of VFS helpers are available for use by filesystems for the creation
467545 or looking up of superblocks.
468546
469− (*) struct super_block *
470− sget_fc(struct fs_context *fc,
471− int (*test)(struct super_block *sb, struct fs_context *fc),
472− int (*set)(struct super_block *sb, struct fs_context *fc));
547+ * ::
548+
549+ struct super_block *
550+ sget_fc(struct fs_context *fc,
551+ int (*test)(struct super_block *sb, struct fs_context *fc),
552+ int (*set)(struct super_block *sb, struct fs_context *fc));
473553
474554 This is the core routine. If test is non-NULL, it searches for an
475555 existing superblock matching the criteria held in the fs_context, using
@@ -482,10 +562,12 @@ or looking up of superblocks. · 6 unmodified lines
482562
483563 The following helpers all wrap sget_fc():
484564
485− (*) int vfs_get_super(struct fs_context *fc,
486− enum vfs_get_super_keying keying,
487− int (*fill_super)(struct super_block *sb,
488− struct fs_context *fc))
565+ * ::
566+
567+ int vfs_get_super(struct fs_context *fc,
568+ enum vfs_get_super_keying keying,
569+ int (*fill_super)(struct super_block *sb,
570+ struct fs_context *fc))
489571
490572 This creates/looks up a deviceless superblock. The keying indicates how
491573 many superblocks of this type may exist and in what manner they may be
@@ -515,14 +597,14 @@ PARAMETER DESCRIPTION · 23 unmodified lines
515597 =====================
516598
517599 Parameters are described using structures defined in linux/fs_parser.h.
518−There's a core description struct that links everything together:
600+There's a core description struct that links everything together::
519601
520602 struct fs_parameter_description {
521603 const struct fs_parameter_spec *specs;
522604 const struct fs_parameter_enum *enums;
523605 };
524606
525−For example:
607+For example::
526608
527609 enum {
528610 Opt_autocell,
@@ -539,10 +621,12 @@ For example: · 10 unmodified lines
539621
540622 The members are as follows:
541623
542− (1) const struct fs_parameter_specification *specs;
624+ (1) ::
625+
626+ const struct fs_parameter_specification *specs;
543627
544628 Table of parameter specifications, terminated with a null entry, where the
545− entries are of type:
629+ entries are of type::
546630
547631 struct fs_parameter_spec {
548632 const char *name;
@@ -558,6 +642,7 @@ The members are as follows: · 9 unmodified lines
558642
559643 The 'type' field indicates the desired value type and must be one of:
560644
645+ ======================= ======================= =====================
561646 TYPE NAME EXPECTED VALUE RESULT IN
562647 ======================= ======================= =====================
563648 fs_param_is_flag No value n/a
@@ -573,19 +658,23 @@ The members are as follows: · 9 unmodified lines
573658 fs_param_is_blockdev Blockdev path * Needs lookup
574659 fs_param_is_path Path * Needs lookup
575660 fs_param_is_fd File descriptor result->int_32
661+ ======================= ======================= =====================
576662
577663 Note that if the value is of fs_param_is_bool type, fs_parse() will try
578664 to match any string value against "0", "1", "no", "yes", "false", "true".
579665
580666 Each parameter can also be qualified with 'flags':
581667
668+ ======================= ================================================
582669 fs_param_v_optional The value is optional
583670 fs_param_neg_with_no result->negated set if key is prefixed with "no"
584671 fs_param_neg_with_empty result->negated set if value is ""
585672 fs_param_deprecated The parameter is deprecated.
673+ ======================= ================================================
586674
587675 These are wrapped with a number of convenience wrappers:
588676
677+ ======================= ===============================================
589678 MACRO SPECIFIES
590679 ======================= ===============================================
591680 fsparam_flag() fs_param_is_flag
@@ -602,9 +691,10 @@ The members are as follows: · 10 unmodified lines
602691 fsparam_bdev() fs_param_is_blockdev
603692 fsparam_path() fs_param_is_path
604693 fsparam_fd() fs_param_is_fd
694+ ======================= ===============================================
605695
606696 all of which take two arguments, name string and option number - for
607− example:
697+ example::
608698
609699 static const struct fs_parameter_spec afs_param_specs[] = {
610700 fsparam_flag ("autocell", Opt_autocell),
@@ -618,10 +708,12 @@ The members are as follows: · 7 unmodified lines
618708 of arguments to specify the type and the flags for anything that doesn't
619709 match one of the above macros.
620710
621− (2) const struct fs_parameter_enum *enums;
711+ (2) ::
712+
713+ const struct fs_parameter_enum *enums;
622714
623715 Table of enum value names to integer mappings, terminated with a null
624− entry. This is of type:
716+ entry. This is of type::
625717
626718 struct fs_parameter_enum {
627719 u8 opt;
@@ -630,7 +722,7 @@ The members are as follows: · 2 unmodified lines
630722 };
631723
632724 Where the array is an unsorted list of { parameter ID, name }-keyed
633− elements that indicate the value to map to, e.g.:
725+ elements that indicate the value to map to, e.g.::
634726
635727 static const struct fs_parameter_enum afs_param_enums[] = {
636728 { Opt_bar, "x", 1},
@@ -648,18 +740,19 @@ CONFIG_VALIDATE_FS_PARSER=y) and will allow the description to be queried from · 11 unmodified lines
648740 userspace using the fsinfo() syscall.
649741
650742
651−==========================
652−PARAMETER HELPER FUNCTIONS
743+Parameter Helper Functions
653744 ==========================
654745
655746 A number of helper functions are provided to help a filesystem or an LSM
656747 process the parameters it is given.
657748
658− (*) int lookup_constant(const struct constant_table tbl[],
659− const char *name, int not_found);
749+ * ::
750+
751+ int lookup_constant(const struct constant_table tbl[],
752+ const char *name, int not_found);
660753
661754 Look up a constant by name in a table of name -> integer mappings. The
662− table is an array of elements of the following type:
755+ table is an array of elements of the following type::
663756
664757 struct constant_table {
665758 const char *name;
@@ -669,9 +762,11 @@ process the parameters it is given. · 3 unmodified lines
669762 If a match is found, the corresponding value is returned. If a match
670763 isn't found, the not_found value is returned instead.
671764
672− (*) bool validate_constant_table(const struct constant_table *tbl,
673− size_t tbl_size,
674− int low, int high, int special);
765+ * ::
766+
767+ bool validate_constant_table(const struct constant_table *tbl,
768+ size_t tbl_size,
769+ int low, int high, int special);
675770
676771 Validate a constant table. Checks that all the elements are appropriately
677772 ordered, that there are no duplicates and that the values are between low
@@ -682,16 +777,20 @@ process the parameters it is given. · 4 unmodified lines
682777 If all is good, true is returned. If the table is invalid, errors are
683778 logged to dmesg and false is returned.
684779
685− (*) bool fs_validate_description(const struct fs_parameter_description *desc);
780+ * ::
781+
782+ bool fs_validate_description(const struct fs_parameter_description *desc);
686783
687784 This performs some validation checks on a parameter description. It
688785 returns true if the description is good and false if it is not. It will
689786 log errors to dmesg if validation fails.
690787
691− (*) int fs_parse(struct fs_context *fc,
692− const struct fs_parameter_description *desc,
693− struct fs_parameter *param,
694− struct fs_parse_result *result);
788+ * ::
789+
790+ int fs_parse(struct fs_context *fc,
791+ const struct fs_parameter_description *desc,
792+ struct fs_parameter *param,
793+ struct fs_parse_result *result);
695794
696795 This is the main interpreter of parameters. It uses the parameter
697796 description to look up a parameter by key name and to convert that to an
@@ -711,14 +810,16 @@ process the parameters it is given. · 13 unmodified lines
711810 parameter is matched, but the value is erroneous, -EINVAL will be
712811 returned; otherwise the parameter's option number will be returned.
713812
714− (*) int fs_lookup_param(struct fs_context *fc,
715− struct fs_parameter *value,
716− bool want_bdev,
717− struct path *_path);
813+ * ::
814+
815+ int fs_lookup_param(struct fs_context *fc,
816+ struct fs_parameter *value,
817+ bool want_bdev,
818+ struct path *_path);
718819
719820 This takes a parameter that carries a string or filename type and attempts
720821 to do a path lookup on it. If the parameter expects a blockdev, a check
721822 is made that the inode actually represents one.
722823
723− Returns 0 if successful and *_path will be set; returns a negative error
724− code if not.
824+ Returns 0 if successful and ``*_path`` will be set; returns a negative
825+ error code if not.
include/linux/fs_context.h+1−1
@@ -85,7 +85,7 @@ struct p_log { · 84 unmodified lines
8585 * Superblock creation fills in ->root whereas reconfiguration begins with this
8686 * already set.
8787 *
88− * See Documentation/filesystems/mount_api.txt
88+ * See Documentation/filesystems/mount_api.rst
8989 */
9090 struct fs_context {
9191 const struct fs_context_operations *ops;
include/linux/lsm_hooks.h+1−1
@@ -77,7 +77,7 @@ · 76 unmodified lines
7777 * state. This is called immediately after commit_creds().
7878 *
7979 * Security hooks for mount using fs_context.
80− * [See also Documentation/filesystems/mount_api.txt]
80+ * [See also Documentation/filesystems/mount_api.rst]
8181 *
8282 * @fs_context_dup:
8383 * Allocate and attach a security structure to sc->security. This pointer

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t