]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Move check_file to os/$platform section
authorJorgen Lundman <lundman@lundman.net>
Mon, 26 Jul 2021 23:34:11 +0000 (08:34 +0900)
committerGitHub <noreply@github.com>
Mon, 26 Jul 2021 23:34:11 +0000 (16:34 -0700)
Keep check_file_generic() in shared code base, and allow special case
code in check_file() in os section. In future, macOS will have
additional checks in check_file().

Linux and FreeBSD wrappers just calls check_file_generic().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #12385

cmd/zpool/os/freebsd/zpool_vdev_os.c
cmd/zpool/os/linux/zpool_vdev_os.c
cmd/zpool/zpool_util.h
cmd/zpool/zpool_vdev.c

index aa66d29fa60484f2a065c25bdff26d3ddcb4b1f9..66bfe28f13f8df1ada19701931e1617993d6512f 100644 (file)
@@ -116,3 +116,9 @@ after_zpool_upgrade(zpool_handle_t *zhp)
                    "details.\n"), zpool_get_name(zhp));
        }
 }
+
+int
+check_file(const char *file, boolean_t force, boolean_t isspare)
+{
+       return (check_file_generic(file, force, isspare));
+}
index da87aa79f3651d421e951ca198ba91790c5ca474..10929fa65a11f4c6b73917cbc057b988f9e14f18 100644 (file)
@@ -410,3 +410,9 @@ void
 after_zpool_upgrade(zpool_handle_t *zhp)
 {
 }
+
+int
+check_file(const char *file, boolean_t force, boolean_t isspare)
+{
+       return (check_file_generic(file, force, isspare));
+}
index 60e8ea873b23de948e0948522e246bca581f4cfe..4002e5794021206827a1ebcdbe9bafe579251bbb 100644 (file)
@@ -131,6 +131,7 @@ boolean_t check_sector_size_database(char *path, int *sector_size);
 void vdev_error(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
 int check_file(const char *file, boolean_t force, boolean_t isspare);
 void after_zpool_upgrade(zpool_handle_t *zhp);
+int check_file_generic(const char *file, boolean_t force, boolean_t isspare);
 
 #ifdef __cplusplus
 }
index 57d41e5eaaf3aae79ca05b83cef0e779b08f40b3..dcc67e7e201465de297384e311f218b89224e55c 100644 (file)
@@ -112,7 +112,7 @@ vdev_error(const char *fmt, ...)
  * not in use by another pool, and not in use by swap.
  */
 int
-check_file(const char *file, boolean_t force, boolean_t isspare)
+check_file_generic(const char *file, boolean_t force, boolean_t isspare)
 {
        char  *name;
        int fd;