diff options
author | Matthew Macy <[email protected]> | 2019-11-01 10:37:33 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-11-01 10:37:33 -0700 |
commit | bd4dde8ef7b3861b20f12619f8994e037b303040 (patch) | |
tree | 33f8795c8c9e103a3235cbb0afd90ccd795499d5 /include | |
parent | bbc18de83afaceff498104d9d261c0328057ccf6 (diff) |
Prefix struct rangelock
A struct rangelock already exists on FreeBSD. Add a zfs_ prefix as
per our convention to prevent any conflict with existing symbols.
This change is a follow up to 2cc479d0.
Reviewed-by: Matt Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #9534
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/dmu.h | 2 | ||||
-rw-r--r-- | include/sys/zfs_rlock.h | 32 | ||||
-rw-r--r-- | include/sys/zfs_znode.h | 2 | ||||
-rw-r--r-- | include/sys/zvol_impl.h | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/include/sys/dmu.h b/include/sys/dmu.h index 33a7667df..44889bb10 100644 --- a/include/sys/dmu.h +++ b/include/sys/dmu.h @@ -1045,7 +1045,7 @@ typedef struct zgd { struct lwb *zgd_lwb; struct blkptr *zgd_bp; dmu_buf_t *zgd_db; - struct locked_range *zgd_lr; + struct zfs_locked_range *zgd_lr; void *zgd_private; } zgd_t; diff --git a/include/sys/zfs_rlock.h b/include/sys/zfs_rlock.h index 5f1e2a364..0ac1561f9 100644 --- a/include/sys/zfs_rlock.h +++ b/include/sys/zfs_rlock.h @@ -39,40 +39,40 @@ typedef enum { RL_READER, RL_WRITER, RL_APPEND -} rangelock_type_t; +} zfs_rangelock_type_t; -struct locked_range; +struct zfs_locked_range; -typedef void (rangelock_cb_t)(struct locked_range *, void *); +typedef void (zfs_rangelock_cb_t)(struct zfs_locked_range *, void *); -typedef struct rangelock { +typedef struct zfs_rangelock { avl_tree_t rl_tree; /* contains locked_range_t */ kmutex_t rl_lock; - rangelock_cb_t *rl_cb; + zfs_rangelock_cb_t *rl_cb; void *rl_arg; -} rangelock_t; +} zfs_rangelock_t; -typedef struct locked_range { - rangelock_t *lr_rangelock; /* rangelock that this lock applies to */ +typedef struct zfs_locked_range { + zfs_rangelock_t *lr_rangelock; /* rangelock that this lock applies to */ avl_node_t lr_node; /* avl node link */ uint64_t lr_offset; /* file range offset */ uint64_t lr_length; /* file range length */ uint_t lr_count; /* range reference count in tree */ - rangelock_type_t lr_type; /* range type */ + zfs_rangelock_type_t lr_type; /* range type */ kcondvar_t lr_write_cv; /* cv for waiting writers */ kcondvar_t lr_read_cv; /* cv for waiting readers */ uint8_t lr_proxy; /* acting for original range */ uint8_t lr_write_wanted; /* writer wants to lock this range */ uint8_t lr_read_wanted; /* reader wants to lock this range */ -} locked_range_t; +} zfs_locked_range_t; -void zfs_rangelock_init(rangelock_t *, rangelock_cb_t *, void *); -void zfs_rangelock_fini(rangelock_t *); +void zfs_rangelock_init(zfs_rangelock_t *, zfs_rangelock_cb_t *, void *); +void zfs_rangelock_fini(zfs_rangelock_t *); -locked_range_t *zfs_rangelock_enter(rangelock_t *, - uint64_t, uint64_t, rangelock_type_t); -void zfs_rangelock_exit(locked_range_t *); -void zfs_rangelock_reduce(locked_range_t *, uint64_t, uint64_t); +zfs_locked_range_t *zfs_rangelock_enter(zfs_rangelock_t *, + uint64_t, uint64_t, zfs_rangelock_type_t); +void zfs_rangelock_exit(zfs_locked_range_t *); +void zfs_rangelock_reduce(zfs_locked_range_t *, uint64_t, uint64_t); #ifdef __cplusplus } diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h index 4eb1da650..79c4137fc 100644 --- a/include/sys/zfs_znode.h +++ b/include/sys/zfs_znode.h @@ -191,7 +191,7 @@ typedef struct znode { krwlock_t z_parent_lock; /* parent lock for directories */ krwlock_t z_name_lock; /* "master" lock for dirent locks */ zfs_dirlock_t *z_dirlocks; /* directory entry lock list */ - rangelock_t z_rangelock; /* file range locks */ + zfs_rangelock_t z_rangelock; /* file range locks */ boolean_t z_unlinked; /* file has been unlinked */ boolean_t z_atime_dirty; /* atime needs to be synced */ boolean_t z_zn_prefetch; /* Prefetch znodes? */ diff --git a/include/sys/zvol_impl.h b/include/sys/zvol_impl.h index 12b653e66..845eb04bc 100644 --- a/include/sys/zvol_impl.h +++ b/include/sys/zvol_impl.h @@ -47,7 +47,7 @@ typedef struct zvol_state { uint32_t zv_open_count; /* open counts */ uint32_t zv_changed; /* disk changed */ zilog_t *zv_zilog; /* ZIL handle */ - rangelock_t zv_rangelock; /* for range locking */ + zfs_rangelock_t zv_rangelock; /* for range locking */ dnode_t *zv_dn; /* dnode hold */ list_node_t zv_next; /* next zvol_state_t linkage */ uint64_t zv_hash; /* name hash */ |