Skip to content

Commit 74e2f8d

Browse files
committed
docs: fs: fscrypt.rst: get rid of :c:type: tags
The :c:type: tag has problems with Sphinx 3.x, as structs there should be declared with c:struct. So, remove them, relying at automarkup.py extension to convert them into cross-references. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent b30fd8e commit 74e2f8d

1 file changed

Lines changed: 36 additions & 38 deletions

File tree

‎Documentation/filesystems/fscrypt.rst‎

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,9 @@ FS_IOC_SET_ENCRYPTION_POLICY
436436

437437
The FS_IOC_SET_ENCRYPTION_POLICY ioctl sets an encryption policy on an
438438
empty directory or verifies that a directory or regular file already
439-
has the specified encryption policy. It takes in a pointer to a
440-
:c:type:`struct fscrypt_policy_v1` or a :c:type:`struct
441-
fscrypt_policy_v2`, defined as follows::
439+
has the specified encryption policy. It takes in a pointer to
440+
struct fscrypt_policy_v1 or struct fscrypt_policy_v2, defined as
441+
follows::
442442

443443
#define FSCRYPT_POLICY_V1 0
444444
#define FSCRYPT_KEY_DESCRIPTOR_SIZE 8
@@ -464,11 +464,11 @@ fscrypt_policy_v2`, defined as follows::
464464

465465
This structure must be initialized as follows:
466466

467-
- ``version`` must be FSCRYPT_POLICY_V1 (0) if the struct is
468-
:c:type:`fscrypt_policy_v1` or FSCRYPT_POLICY_V2 (2) if the struct
469-
is :c:type:`fscrypt_policy_v2`. (Note: we refer to the original
470-
policy version as "v1", though its version code is really 0.) For
471-
new encrypted directories, use v2 policies.
467+
- ``version`` must be FSCRYPT_POLICY_V1 (0) if
468+
struct fscrypt_policy_v1 is used or FSCRYPT_POLICY_V2 (2) if
469+
struct fscrypt_policy_v2 is used. (Note: we refer to the original
470+
policy version as "v1", though its version code is really 0.)
471+
For new encrypted directories, use v2 policies.
472472

473473
- ``contents_encryption_mode`` and ``filenames_encryption_mode`` must
474474
be set to constants from ``<linux/fscrypt.h>`` which identify the
@@ -508,9 +508,9 @@ This structure must be initialized as follows:
508508
replaced with ``master_key_identifier``, which is longer and cannot
509509
be arbitrarily chosen. Instead, the key must first be added using
510510
`FS_IOC_ADD_ENCRYPTION_KEY`_. Then, the ``key_spec.u.identifier``
511-
the kernel returned in the :c:type:`struct fscrypt_add_key_arg` must
512-
be used as the ``master_key_identifier`` in the :c:type:`struct
513-
fscrypt_policy_v2`.
511+
the kernel returned in the struct fscrypt_add_key_arg must
512+
be used as the ``master_key_identifier`` in
513+
struct fscrypt_policy_v2.
514514

515515
If the file is not yet encrypted, then FS_IOC_SET_ENCRYPTION_POLICY
516516
verifies that the file is an empty directory. If so, the specified
@@ -590,7 +590,7 @@ FS_IOC_GET_ENCRYPTION_POLICY_EX
590590
The FS_IOC_GET_ENCRYPTION_POLICY_EX ioctl retrieves the encryption
591591
policy, if any, for a directory or regular file. No additional
592592
permissions are required beyond the ability to open the file. It
593-
takes in a pointer to a :c:type:`struct fscrypt_get_policy_ex_arg`,
593+
takes in a pointer to struct fscrypt_get_policy_ex_arg,
594594
defined as follows::
595595

596596
struct fscrypt_get_policy_ex_arg {
@@ -637,9 +637,8 @@ The FS_IOC_GET_ENCRYPTION_POLICY ioctl can also retrieve the
637637
encryption policy, if any, for a directory or regular file. However,
638638
unlike `FS_IOC_GET_ENCRYPTION_POLICY_EX`_,
639639
FS_IOC_GET_ENCRYPTION_POLICY only supports the original policy
640-
version. It takes in a pointer directly to a :c:type:`struct
641-
fscrypt_policy_v1` rather than a :c:type:`struct
642-
fscrypt_get_policy_ex_arg`.
640+
version. It takes in a pointer directly to struct fscrypt_policy_v1
641+
rather than struct fscrypt_get_policy_ex_arg.
643642

644643
The error codes for FS_IOC_GET_ENCRYPTION_POLICY are the same as those
645644
for FS_IOC_GET_ENCRYPTION_POLICY_EX, except that
@@ -680,8 +679,7 @@ the filesystem, making all files on the filesystem which were
680679
encrypted using that key appear "unlocked", i.e. in plaintext form.
681680
It can be executed on any file or directory on the target filesystem,
682681
but using the filesystem's root directory is recommended. It takes in
683-
a pointer to a :c:type:`struct fscrypt_add_key_arg`, defined as
684-
follows::
682+
a pointer to struct fscrypt_add_key_arg, defined as follows::
685683

686684
struct fscrypt_add_key_arg {
687685
struct fscrypt_key_specifier key_spec;
@@ -710,17 +708,16 @@ follows::
710708
__u8 raw[];
711709
};
712710

713-
:c:type:`struct fscrypt_add_key_arg` must be zeroed, then initialized
711+
struct fscrypt_add_key_arg must be zeroed, then initialized
714712
as follows:
715713

716714
- If the key is being added for use by v1 encryption policies, then
717715
``key_spec.type`` must contain FSCRYPT_KEY_SPEC_TYPE_DESCRIPTOR, and
718716
``key_spec.u.descriptor`` must contain the descriptor of the key
719717
being added, corresponding to the value in the
720-
``master_key_descriptor`` field of :c:type:`struct
721-
fscrypt_policy_v1`. To add this type of key, the calling process
722-
must have the CAP_SYS_ADMIN capability in the initial user
723-
namespace.
718+
``master_key_descriptor`` field of struct fscrypt_policy_v1.
719+
To add this type of key, the calling process must have the
720+
CAP_SYS_ADMIN capability in the initial user namespace.
724721

725722
Alternatively, if the key is being added for use by v2 encryption
726723
policies, then ``key_spec.type`` must contain
@@ -737,12 +734,13 @@ as follows:
737734

738735
- ``key_id`` is 0 if the raw key is given directly in the ``raw``
739736
field. Otherwise ``key_id`` is the ID of a Linux keyring key of
740-
type "fscrypt-provisioning" whose payload is a :c:type:`struct
741-
fscrypt_provisioning_key_payload` whose ``raw`` field contains the
742-
raw key and whose ``type`` field matches ``key_spec.type``. Since
743-
``raw`` is variable-length, the total size of this key's payload
744-
must be ``sizeof(struct fscrypt_provisioning_key_payload)`` plus the
745-
raw key size. The process must have Search permission on this key.
737+
type "fscrypt-provisioning" whose payload is
738+
struct fscrypt_provisioning_key_payload whose ``raw`` field contains
739+
the raw key and whose ``type`` field matches ``key_spec.type``.
740+
Since ``raw`` is variable-length, the total size of this key's
741+
payload must be ``sizeof(struct fscrypt_provisioning_key_payload)``
742+
plus the raw key size. The process must have Search permission on
743+
this key.
746744

747745
Most users should leave this 0 and specify the raw key directly.
748746
The support for specifying a Linux keyring key is intended mainly to
@@ -860,8 +858,8 @@ The FS_IOC_REMOVE_ENCRYPTION_KEY ioctl removes a claim to a master
860858
encryption key from the filesystem, and possibly removes the key
861859
itself. It can be executed on any file or directory on the target
862860
filesystem, but using the filesystem's root directory is recommended.
863-
It takes in a pointer to a :c:type:`struct fscrypt_remove_key_arg`,
864-
defined as follows::
861+
It takes in a pointer to struct fscrypt_remove_key_arg, defined
862+
as follows::
865863

866864
struct fscrypt_remove_key_arg {
867865
struct fscrypt_key_specifier key_spec;
@@ -956,8 +954,8 @@ FS_IOC_GET_ENCRYPTION_KEY_STATUS
956954
The FS_IOC_GET_ENCRYPTION_KEY_STATUS ioctl retrieves the status of a
957955
master encryption key. It can be executed on any file or directory on
958956
the target filesystem, but using the filesystem's root directory is
959-
recommended. It takes in a pointer to a :c:type:`struct
960-
fscrypt_get_key_status_arg`, defined as follows::
957+
recommended. It takes in a pointer to
958+
struct fscrypt_get_key_status_arg, defined as follows::
961959

962960
struct fscrypt_get_key_status_arg {
963961
/* input */
@@ -1148,10 +1146,10 @@ Implementation details
11481146
Encryption context
11491147
------------------
11501148

1151-
An encryption policy is represented on-disk by a :c:type:`struct
1152-
fscrypt_context_v1` or a :c:type:`struct fscrypt_context_v2`. It is
1153-
up to individual filesystems to decide where to store it, but normally
1154-
it would be stored in a hidden extended attribute. It should *not* be
1149+
An encryption policy is represented on-disk by
1150+
struct fscrypt_context_v1 or struct fscrypt_context_v2. It is up to
1151+
individual filesystems to decide where to store it, but normally it
1152+
would be stored in a hidden extended attribute. It should *not* be
11551153
exposed by the xattr-related system calls such as getxattr() and
11561154
setxattr() because of the special semantics of the encryption xattr.
11571155
(In particular, there would be much confusion if an encryption policy
@@ -1249,8 +1247,8 @@ a strong "hash" of the ciphertext filename, along with the optional
12491247
filesystem-specific hash(es) needed for directory lookups. This
12501248
allows the filesystem to still, with a high degree of confidence, map
12511249
the filename given in ->lookup() back to a particular directory entry
1252-
that was previously listed by readdir(). See :c:type:`struct
1253-
fscrypt_nokey_name` in the source for more details.
1250+
that was previously listed by readdir(). See
1251+
struct fscrypt_nokey_name in the source for more details.
12541252

12551253
Note that the precise way that filenames are presented to userspace
12561254
without the key is subject to change in the future. It is only meant

0 commit comments

Comments
 (0)