mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Prefix all refcount functions with zfs_
Recent changes in the Linux kernel made it necessary to prefix the refcount_add() function with zfs_ due to a name collision. To bring the other functions in line with that and to avoid future collisions, prefix the other refcount functions as well. Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tim Schumacher <timschumi@gmx.de> Closes #7963
This commit is contained in:
committed by
Brian Behlendorf
parent
fc23d59fa0
commit
424fd7c3e0
+15
-15
@@ -80,13 +80,13 @@ dsl_wrapping_key_hold(dsl_wrapping_key_t *wkey, void *tag)
|
||||
static void
|
||||
dsl_wrapping_key_rele(dsl_wrapping_key_t *wkey, void *tag)
|
||||
{
|
||||
(void) refcount_remove(&wkey->wk_refcnt, tag);
|
||||
(void) zfs_refcount_remove(&wkey->wk_refcnt, tag);
|
||||
}
|
||||
|
||||
static void
|
||||
dsl_wrapping_key_free(dsl_wrapping_key_t *wkey)
|
||||
{
|
||||
ASSERT0(refcount_count(&wkey->wk_refcnt));
|
||||
ASSERT0(zfs_refcount_count(&wkey->wk_refcnt));
|
||||
|
||||
if (wkey->wk_key.ck_data) {
|
||||
bzero(wkey->wk_key.ck_data,
|
||||
@@ -95,7 +95,7 @@ dsl_wrapping_key_free(dsl_wrapping_key_t *wkey)
|
||||
CRYPTO_BITS2BYTES(wkey->wk_key.ck_length));
|
||||
}
|
||||
|
||||
refcount_destroy(&wkey->wk_refcnt);
|
||||
zfs_refcount_destroy(&wkey->wk_refcnt);
|
||||
kmem_free(wkey, sizeof (dsl_wrapping_key_t));
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ dsl_wrapping_key_create(uint8_t *wkeydata, zfs_keyformat_t keyformat,
|
||||
bcopy(wkeydata, wkey->wk_key.ck_data, WRAPPING_KEY_LEN);
|
||||
|
||||
/* initialize the rest of the struct */
|
||||
refcount_create(&wkey->wk_refcnt);
|
||||
zfs_refcount_create(&wkey->wk_refcnt);
|
||||
wkey->wk_keyformat = keyformat;
|
||||
wkey->wk_salt = salt;
|
||||
wkey->wk_iters = iters;
|
||||
@@ -518,13 +518,13 @@ out:
|
||||
static void
|
||||
dsl_crypto_key_free(dsl_crypto_key_t *dck)
|
||||
{
|
||||
ASSERT(refcount_count(&dck->dck_holds) == 0);
|
||||
ASSERT(zfs_refcount_count(&dck->dck_holds) == 0);
|
||||
|
||||
/* destroy the zio_crypt_key_t */
|
||||
zio_crypt_key_destroy(&dck->dck_key);
|
||||
|
||||
/* free the refcount, wrapping key, and lock */
|
||||
refcount_destroy(&dck->dck_holds);
|
||||
zfs_refcount_destroy(&dck->dck_holds);
|
||||
if (dck->dck_wkey)
|
||||
dsl_wrapping_key_rele(dck->dck_wkey, dck);
|
||||
|
||||
@@ -535,7 +535,7 @@ dsl_crypto_key_free(dsl_crypto_key_t *dck)
|
||||
static void
|
||||
dsl_crypto_key_rele(dsl_crypto_key_t *dck, void *tag)
|
||||
{
|
||||
if (refcount_remove(&dck->dck_holds, tag) == 0)
|
||||
if (zfs_refcount_remove(&dck->dck_holds, tag) == 0)
|
||||
dsl_crypto_key_free(dck);
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ dsl_crypto_key_open(objset_t *mos, dsl_wrapping_key_t *wkey,
|
||||
}
|
||||
|
||||
/* finish initializing the dsl_crypto_key_t */
|
||||
refcount_create(&dck->dck_holds);
|
||||
zfs_refcount_create(&dck->dck_holds);
|
||||
dsl_wrapping_key_hold(wkey, dck);
|
||||
dck->dck_wkey = wkey;
|
||||
dck->dck_obj = dckobj;
|
||||
@@ -714,7 +714,7 @@ spa_keystore_dsl_key_rele(spa_t *spa, dsl_crypto_key_t *dck, void *tag)
|
||||
{
|
||||
rw_enter(&spa->spa_keystore.sk_dk_lock, RW_WRITER);
|
||||
|
||||
if (refcount_remove(&dck->dck_holds, tag) == 0) {
|
||||
if (zfs_refcount_remove(&dck->dck_holds, tag) == 0) {
|
||||
avl_remove(&spa->spa_keystore.sk_dsl_keys, dck);
|
||||
dsl_crypto_key_free(dck);
|
||||
}
|
||||
@@ -872,7 +872,7 @@ spa_keystore_unload_wkey_impl(spa_t *spa, uint64_t ddobj)
|
||||
if (!found_wkey) {
|
||||
ret = SET_ERROR(EACCES);
|
||||
goto error_unlock;
|
||||
} else if (refcount_count(&found_wkey->wk_refcnt) != 0) {
|
||||
} else if (zfs_refcount_count(&found_wkey->wk_refcnt) != 0) {
|
||||
ret = SET_ERROR(EBUSY);
|
||||
goto error_unlock;
|
||||
}
|
||||
@@ -946,11 +946,11 @@ spa_keystore_create_mapping_impl(spa_t *spa, uint64_t dsobj,
|
||||
|
||||
/* Allocate and initialize the mapping */
|
||||
km = kmem_zalloc(sizeof (dsl_key_mapping_t), KM_SLEEP);
|
||||
refcount_create(&km->km_refcnt);
|
||||
zfs_refcount_create(&km->km_refcnt);
|
||||
|
||||
ret = spa_keystore_dsl_key_hold_dd(spa, dd, km, &km->km_key);
|
||||
if (ret != 0) {
|
||||
refcount_destroy(&km->km_refcnt);
|
||||
zfs_refcount_destroy(&km->km_refcnt);
|
||||
kmem_free(km, sizeof (dsl_key_mapping_t));
|
||||
return (ret);
|
||||
}
|
||||
@@ -980,7 +980,7 @@ spa_keystore_create_mapping_impl(spa_t *spa, uint64_t dsobj,
|
||||
|
||||
if (should_free) {
|
||||
spa_keystore_dsl_key_rele(spa, km->km_key, km);
|
||||
refcount_destroy(&km->km_refcnt);
|
||||
zfs_refcount_destroy(&km->km_refcnt);
|
||||
kmem_free(km, sizeof (dsl_key_mapping_t));
|
||||
}
|
||||
|
||||
@@ -1020,7 +1020,7 @@ spa_keystore_remove_mapping(spa_t *spa, uint64_t dsobj, void *tag)
|
||||
* it is zero. Try to minimize time spent in this lock by deferring
|
||||
* cleanup work.
|
||||
*/
|
||||
if (refcount_remove(&found_km->km_refcnt, tag) == 0) {
|
||||
if (zfs_refcount_remove(&found_km->km_refcnt, tag) == 0) {
|
||||
should_free = B_TRUE;
|
||||
avl_remove(&spa->spa_keystore.sk_key_mappings, found_km);
|
||||
}
|
||||
@@ -1506,7 +1506,7 @@ spa_keystore_change_key_sync(void *arg, dmu_tx_t *tx)
|
||||
wkey_search.wk_ddobj = ds->ds_dir->dd_object;
|
||||
found_wkey = avl_find(&spa->spa_keystore.sk_wkeys, &wkey_search, NULL);
|
||||
if (found_wkey != NULL) {
|
||||
ASSERT0(refcount_count(&found_wkey->wk_refcnt));
|
||||
ASSERT0(zfs_refcount_count(&found_wkey->wk_refcnt));
|
||||
avl_remove(&spa->spa_keystore.sk_wkeys, found_wkey);
|
||||
dsl_wrapping_key_free(found_wkey);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user