aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h')
-rw-r--r--sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h b/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h
index 4456046e6e4c..050fc3036f87 100644
--- a/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h
+++ b/sys/contrib/openzfs/include/os/freebsd/zfs/sys/zfs_znode_impl.h
@@ -6,7 +6,7 @@
* 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.
+ * or https://opensource.org/licenses/CDDL-1.0.
* See the License for the specific language governing permissions
* and limitations under the License.
*
@@ -116,30 +116,31 @@ typedef struct zfs_soft_state {
#define Z_ISLNK(type) ((type) == VLNK)
#define Z_ISDIR(type) ((type) == VDIR)
-#define zn_has_cached_data(zp) vn_has_cached_data(ZTOV(zp))
+#define zn_has_cached_data(zp, start, end) \
+ vn_has_cached_data(ZTOV(zp))
#define zn_flush_cached_data(zp, sync) vn_flush_cached_data(ZTOV(zp), sync)
-#define zn_rlimit_fsize(zp, uio) \
+#define zn_rlimit_fsize(size) zfs_rlimit_fsize(size)
+#define zn_rlimit_fsize_uio(zp, uio) \
vn_rlimit_fsize(ZTOV(zp), GET_UIO_STRUCT(uio), zfs_uio_td(uio))
/* Called on entry to each ZFS vnode and vfs operation */
-#define ZFS_ENTER(zfsvfs) \
- { \
- ZFS_TEARDOWN_ENTER_READ((zfsvfs), FTAG); \
- if (__predict_false((zfsvfs)->z_unmounted)) { \
- ZFS_TEARDOWN_EXIT_READ(zfsvfs, FTAG); \
- return (EIO); \
- } \
+static inline int
+zfs_enter(zfsvfs_t *zfsvfs, const char *tag)
+{
+ ZFS_TEARDOWN_ENTER_READ(zfsvfs, tag);
+ if (__predict_false((zfsvfs)->z_unmounted)) {
+ ZFS_TEARDOWN_EXIT_READ(zfsvfs, tag);
+ return (SET_ERROR(EIO));
}
+ return (0);
+}
/* Must be called before exiting the vop */
-#define ZFS_EXIT(zfsvfs) ZFS_TEARDOWN_EXIT_READ(zfsvfs, FTAG)
-
-/* Verifies the znode is valid */
-#define ZFS_VERIFY_ZP(zp) \
- if (__predict_false((zp)->z_sa_hdl == NULL)) { \
- ZFS_EXIT((zp)->z_zfsvfs); \
- return (EIO); \
- } \
+static inline void
+zfs_exit(zfsvfs_t *zfsvfs, const char *tag)
+{
+ ZFS_TEARDOWN_EXIT_READ(zfsvfs, tag);
+}
/*
* Macros for dealing with dmu_buf_hold
@@ -175,11 +176,12 @@ extern void zfs_tstamp_update_setup_ext(struct znode *,
uint_t, uint64_t [2], uint64_t [2], boolean_t have_tx);
extern void zfs_znode_free(struct znode *);
-extern zil_replay_func_t *zfs_replay_vector[TX_MAX_TYPE];
-extern int zfsfstype;
+extern zil_replay_func_t *const zfs_replay_vector[TX_MAX_TYPE];
extern int zfs_znode_parent_and_name(struct znode *zp, struct znode **dzpp,
char *buf);
+
+extern int zfs_rlimit_fsize(off_t fsize);
#ifdef __cplusplus
}
#endif