diff options
author | Matt Macy <mmacy@FreeBSD.org> | 2020-09-04 21:31:58 +0000 |
---|---|---|
committer | Matt Macy <mmacy@FreeBSD.org> | 2020-09-04 21:31:58 +0000 |
commit | 431004027d028e7e689b171c442e6f1c384205c6 (patch) | |
tree | 6cf42660d552d2264586ffc9e69020ae6a604f1f /include | |
parent | 93ddd0259dd285fbac5cc5086a039a22f1b046a1 (diff) | |
download | src-431004027d028e7e689b171c442e6f1c384205c6.tar.gz src-431004027d028e7e689b171c442e6f1c384205c6.zip |
Update vendor openzfs to fd20a8vendor/openzfs/2.0-rc1-gfd20a8
Notes
Notes:
svn path=/vendor-sys/openzfs/dist/; revision=365340
svn path=/vendor-sys/openzfs/2.0-rc1-gfd20a8/; revision=365341; tag=vendor/openzfs/2.0-rc1-gfd20a8
Diffstat (limited to 'include')
-rw-r--r-- | include/libzfs.h | 14 | ||||
-rw-r--r-- | include/libzfs_impl.h | 4 | ||||
-rw-r--r-- | include/os/freebsd/spl/sys/cred.h | 2 | ||||
-rw-r--r-- | include/os/freebsd/spl/sys/zone.h | 9 | ||||
-rw-r--r-- | include/os/freebsd/zfs/sys/Makefile.am | 2 | ||||
-rw-r--r-- | include/os/freebsd/zfs/sys/zfs_vfsops.h | 1 | ||||
-rw-r--r-- | include/os/linux/kernel/linux/page_compat.h | 25 | ||||
-rw-r--r-- | include/os/linux/spl/sys/vmsystm.h | 11 | ||||
-rw-r--r-- | include/os/linux/zfs/sys/Makefile.am | 2 | ||||
-rw-r--r-- | include/sys/Makefile.am | 1 | ||||
-rw-r--r-- | include/sys/zfs_vfsops.h | 35 |
11 files changed, 60 insertions, 46 deletions
diff --git a/include/libzfs.h b/include/libzfs.h index 4e6336180648..6b4f518a4a86 100644 --- a/include/libzfs.h +++ b/include/libzfs.h @@ -642,7 +642,19 @@ extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *); extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, nvlist_t *props); extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t); -extern int zfs_rename(zfs_handle_t *, const char *, boolean_t, boolean_t); + +typedef struct renameflags { + /* recursive rename */ + int recursive : 1; + + /* don't unmount file systems */ + int nounmount : 1; + + /* force unmount file systems */ + int forceunmount : 1; +} renameflags_t; + +extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t); typedef struct sendflags { /* Amount of extra information to print. */ diff --git a/include/libzfs_impl.h b/include/libzfs_impl.h index 26e042964739..dfb63285c1fd 100644 --- a/include/libzfs_impl.h +++ b/include/libzfs_impl.h @@ -166,6 +166,10 @@ int zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp, * changelist_gather() flag to force it to iterate on mounted datasets only */ #define CL_GATHER_ITER_MOUNTED 2 +/* + * Use this changelist_gather() flag to prevent unmounting of file systems. + */ +#define CL_GATHER_DONT_UNMOUNT 4 typedef struct prop_changelist prop_changelist_t; diff --git a/include/os/freebsd/spl/sys/cred.h b/include/os/freebsd/spl/sys/cred.h index e32910e0efab..86f79011d6da 100644 --- a/include/os/freebsd/spl/sys/cred.h +++ b/include/os/freebsd/spl/sys/cred.h @@ -93,7 +93,7 @@ extern cred_t *zone_kcred(void); extern gid_t crgetrgid(const cred_t *); extern gid_t crgetsgid(const cred_t *); -#define crgetzoneid(x) (0) +#define crgetzoneid(cr) ((cr)->cr_prison->pr_id) extern projid_t crgetprojid(const cred_t *); extern cred_t *crgetmapped(const cred_t *); diff --git a/include/os/freebsd/spl/sys/zone.h b/include/os/freebsd/spl/sys/zone.h index 71a28adaf26e..dd088de836d3 100644 --- a/include/os/freebsd/spl/sys/zone.h +++ b/include/os/freebsd/spl/sys/zone.h @@ -29,6 +29,8 @@ #ifndef _OPENSOLARIS_SYS_ZONE_H_ #define _OPENSOLARIS_SYS_ZONE_H_ +#include <sys/jail.h> + /* * Macros to help with zone visibility restrictions. */ @@ -36,12 +38,9 @@ #define GLOBAL_ZONEID 0 /* - * Is thread in the global zone? + * Is proc in the global zone? */ -#define INGLOBALZONE(p) in_globalzone((p)) - - -extern boolean_t in_globalzone(struct proc *); +#define INGLOBALZONE(proc) (!jailed((proc)->p_ucred)) /* * Attach the given dataset to the given jail. diff --git a/include/os/freebsd/zfs/sys/Makefile.am b/include/os/freebsd/zfs/sys/Makefile.am index a8cfa39f3543..6a65a7326066 100644 --- a/include/os/freebsd/zfs/sys/Makefile.am +++ b/include/os/freebsd/zfs/sys/Makefile.am @@ -6,7 +6,7 @@ KERNEL_H = \ zfs_ctldir.h \ zfs_dir.h \ zfs_ioctl_compat.h \ - zfs_vfsops.h \ + zfs_vfsops_os.h \ zfs_vnops.h \ zfs_znode_impl.h \ zpl.h diff --git a/include/os/freebsd/zfs/sys/zfs_vfsops.h b/include/os/freebsd/zfs/sys/zfs_vfsops.h index 70ada204a292..1b80ee7cb177 100644 --- a/include/os/freebsd/zfs/sys/zfs_vfsops.h +++ b/include/os/freebsd/zfs/sys/zfs_vfsops.h @@ -168,7 +168,6 @@ extern boolean_t zfs_is_readonly(zfsvfs_t *zfsvfs); extern int zfs_get_temporary_prop(struct dsl_dataset *ds, zfs_prop_t zfs_prop, uint64_t *val, char *setpoint); extern int zfs_busy(void); -extern void zfsvfs_update_fromname(const char *oldname, const char *newname); #ifdef __cplusplus } diff --git a/include/os/linux/kernel/linux/page_compat.h b/include/os/linux/kernel/linux/page_compat.h index 8ad04f9bbfc6..bd6cb398b0c0 100644 --- a/include/os/linux/kernel/linux/page_compat.h +++ b/include/os/linux/kernel/linux/page_compat.h @@ -35,16 +35,6 @@ #else #define nr_inactive_file_pages() global_zone_page_state(NR_INACTIVE_FILE) #endif -#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE_B) -#define nr_slab_reclaimable_pages() \ - global_node_page_state(NR_SLAB_RECLAIMABLE_B) -#else -#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE) -#define nr_slab_reclaimable_pages() global_node_page_state(NR_SLAB_RECLAIMABLE) -#else -#define nr_slab_reclaimable_pages() global_zone_page_state(NR_SLAB_RECLAIMABLE) -#endif -#endif #elif defined(ZFS_GLOBAL_NODE_PAGE_STATE) @@ -64,16 +54,6 @@ #else #define nr_inactive_file_pages() global_page_state(NR_INACTIVE_FILE) #endif -#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE_B) -#define nr_slab_reclaimable_pages() \ - global_node_page_state(NR_SLAB_RECLAIMABLE_B) -#else -#if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE) -#define nr_slab_reclaimable_pages() global_node_page_state(NR_SLAB_RECLAIMABLE) -#else -#define nr_slab_reclaimable_pages() global_page_state(NR_SLAB_RECLAIMABLE) -#endif -#endif #else @@ -81,11 +61,6 @@ #define nr_file_pages() global_page_state(NR_FILE_PAGES) #define nr_inactive_anon_pages() global_page_state(NR_INACTIVE_ANON) #define nr_inactive_file_pages() global_page_state(NR_INACTIVE_FILE) -#ifdef ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE_B -#define nr_slab_reclaimable_pages() global_page_state(NR_SLAB_RECLAIMABLE_B) -#else -#define nr_slab_reclaimable_pages() global_page_state(NR_SLAB_RECLAIMABLE) -#endif /* ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE_B */ #endif /* ZFS_GLOBAL_ZONE_PAGE_STATE */ diff --git a/include/os/linux/spl/sys/vmsystm.h b/include/os/linux/spl/sys/vmsystm.h index 705339486bc8..8783231dcf2a 100644 --- a/include/os/linux/spl/sys/vmsystm.h +++ b/include/os/linux/spl/sys/vmsystm.h @@ -47,17 +47,6 @@ #define membar_producer() smp_wmb() #define physmem zfs_totalram_pages -#ifdef ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE_B -#define freemem (nr_free_pages() + \ - global_page_state(NR_INACTIVE_FILE) + \ - global_page_state(NR_INACTIVE_ANON) + \ - global_page_state(NR_SLAB_RECLAIMABLE_B)) -#else -#define freemem (nr_free_pages() + \ - global_page_state(NR_INACTIVE_FILE) + \ - global_page_state(NR_INACTIVE_ANON) + \ - global_page_state(NR_SLAB_RECLAIMABLE)) -#endif /* ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE_B */ #define xcopyin(from, to, size) copy_from_user(to, from, size) #define xcopyout(from, to, size) copy_to_user(to, from, size) diff --git a/include/os/linux/zfs/sys/Makefile.am b/include/os/linux/zfs/sys/Makefile.am index 732d94ee804e..b56e6771d28a 100644 --- a/include/os/linux/zfs/sys/Makefile.am +++ b/include/os/linux/zfs/sys/Makefile.am @@ -19,7 +19,7 @@ KERNEL_H = \ zfs_context_os.h \ zfs_ctldir.h \ zfs_dir.h \ - zfs_vfsops.h \ + zfs_vfsops_os.h \ zfs_vnops.h \ zfs_znode_impl.h \ zpl.h diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am index c2bc3be03c9f..75727b93aacd 100644 --- a/include/sys/Makefile.am +++ b/include/sys/Makefile.am @@ -115,6 +115,7 @@ COMMON_H = \ zfs_sa.h \ zfs_stat.h \ zfs_sysfs.h \ + zfs_vfsops.h \ zfs_znode.h \ zil.h \ zil_impl.h \ diff --git a/include/sys/zfs_vfsops.h b/include/sys/zfs_vfsops.h new file mode 100644 index 000000000000..a438c86f0a0c --- /dev/null +++ b/include/sys/zfs_vfsops.h @@ -0,0 +1,35 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Portions Copyright 2020 iXsystems, Inc. + */ + +#ifndef _SYS_ZFS_VFSOPS_H +#define _SYS_ZFS_VFSOPS_H + +#ifdef _KERNEL +#include <sys/zfs_vfsops_os.h> +#endif + +extern void zfsvfs_update_fromname(const char *, const char *); + +#endif /* _SYS_ZFS_VFSOPS_H */ |