]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
vfstest: rename struct t_idmapped_mounts
authorChristian Brauner <brauner@kernel.org>
Thu, 12 May 2022 16:52:41 +0000 (18:52 +0200)
committerZorro Lang <zlang@kernel.org>
Sun, 15 May 2022 00:59:31 +0000 (08:59 +0800)
The idmapped mounts test suite has grown to cover a lot of generic vfs
functionality that is not concerned with idmapped mounts at all.

As was discussed upstream it's time to rename it to something that
reflects its generic nature.

Rename the basic structure used for the tests from struct
t_idmapped_mounts to struct test_struct.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/vfs/utils.h
src/vfs/vfstest.c

index a62a48443db1caf411a712c55ccfbe030429e77f..c10246467a698c9ef7dca6ff9f3c33fa6956e7cc 100644 (file)
                __internal_ret__;                             \
        })
 
+struct test_struct {
+       int (*test)(void);
+       unsigned int support_flags;
+       const char *description;
+};
+
 typedef enum idmap_type_t {
        ID_TYPE_UID,
        ID_TYPE_GID
index 7f57b77783c8224940af1ed4639d6fcebaa5a639..e615c4e14f055e4b4fe848d07cd1bc1915ebba83 100644 (file)
@@ -14308,11 +14308,7 @@ static const struct option longopts[] = {
        {NULL,                                  0,                      0,        0},
 };
 
-struct t_idmapped_mounts {
-       int (*test)(void);
-       unsigned int support_flags;
-       const char *description;
-} basic_suite[] = {
+struct test_struct basic_suite[] = {
        { acls,                                                         T_REQUIRE_IDMAPPED_MOUNTS,      "posix acls on regular mounts",                                                                 },
        { create_in_userns,                                             T_REQUIRE_IDMAPPED_MOUNTS,      "create operations in user namespace",                                                          },
        { device_node_in_userns,                                        T_REQUIRE_IDMAPPED_MOUNTS,      "device node in user namespace",                                                                },
@@ -14364,15 +14360,15 @@ struct t_idmapped_mounts {
        { threaded_idmapped_mount_interactions,                         T_REQUIRE_IDMAPPED_MOUNTS,      "threaded operations on idmapped mounts",                                                       },
 };
 
-struct t_idmapped_mounts fscaps_in_ancestor_userns[] = {
+struct test_struct fscaps_in_ancestor_userns[] = {
        { fscaps_idmapped_mounts_in_userns_valid_in_ancestor_userns,    T_REQUIRE_IDMAPPED_MOUNTS,      "fscaps on idmapped mounts in user namespace writing fscap valid in ancestor userns",           },
 };
 
-struct t_idmapped_mounts t_nested_userns[] = {
+struct test_struct t_nested_userns[] = {
        { nested_userns,                                                T_REQUIRE_IDMAPPED_MOUNTS,      "test that nested user namespaces behave correctly when attached to idmapped mounts",           },
 };
 
-struct t_idmapped_mounts t_btrfs[] = {
+struct test_struct t_btrfs[] = {
        { btrfs_subvolumes_fsids_mapped,                                T_REQUIRE_IDMAPPED_MOUNTS,      "test subvolumes with mapped fsids",                                                            },
        { btrfs_subvolumes_fsids_mapped_userns,                         T_REQUIRE_IDMAPPED_MOUNTS,      "test subvolumes with mapped fsids inside user namespace",                                      },
        { btrfs_subvolumes_fsids_mapped_user_subvol_rm_allowed,         T_REQUIRE_IDMAPPED_MOUNTS,      "test subvolume deletion with user_subvol_rm_allowed mount option",                             },
@@ -14398,21 +14394,21 @@ struct t_idmapped_mounts t_btrfs[] = {
 };
 
 /* Test for commit 968219708108 ("fs: handle circular mappings correctly"). */
-struct t_idmapped_mounts t_setattr_fix_968219708108[] = {
+struct test_struct t_setattr_fix_968219708108[] = {
        { setattr_fix_968219708108,                                     T_REQUIRE_IDMAPPED_MOUNTS,      "test that setattr works correctly",                                                            },
 };
 
 /* Test for commit 705191b03d50 ("fs: fix acl translation"). */
-struct t_idmapped_mounts t_setxattr_fix_705191b03d50[] = {
+struct test_struct t_setxattr_fix_705191b03d50[] = {
        { setxattr_fix_705191b03d50,                                    T_REQUIRE_USERNS,               "test that setxattr works correctly for userns mountable filesystems",                          },
 };
 
-static bool run_test(struct t_idmapped_mounts suite[], size_t suite_size)
+static bool run_test(struct test_struct suite[], size_t suite_size)
 {
        int i;
 
        for (i = 0; i < suite_size; i++) {
-               struct t_idmapped_mounts *t = &suite[i];
+               struct test_struct *t = &suite[i];
                int ret;
                pid_t pid;