git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Linux 3.8 compat: Support CONFIG_UIDGID_STRICT_TYPE_CHECKS
[zfs.git]
/
module
/
zfs
/
ddt_zap.c
diff --git
a/module/zfs/ddt_zap.c
b/module/zfs/ddt_zap.c
index
d6a991c
..
65b14ab
100644
(file)
--- a/
module/zfs/ddt_zap.c
+++ b/
module/zfs/ddt_zap.c
@@
-58,26
+58,30
@@
ddt_zap_destroy(objset_t *os, uint64_t object, dmu_tx_t *tx)
static int
ddt_zap_lookup(objset_t *os, uint64_t object, ddt_entry_t *dde)
{
static int
ddt_zap_lookup(objset_t *os, uint64_t object, ddt_entry_t *dde)
{
- uchar_t
cbuf[sizeof (dde->dde_phys) + 1]
;
+ uchar_t
*cbuf
;
uint64_t one, csize;
int error;
uint64_t one, csize;
int error;
+ cbuf = kmem_alloc(sizeof (dde->dde_phys) + 1, KM_PUSHPAGE);
+
error = zap_length_uint64(os, object, (uint64_t *)&dde->dde_key,
DDT_KEY_WORDS, &one, &csize);
if (error)
error = zap_length_uint64(os, object, (uint64_t *)&dde->dde_key,
DDT_KEY_WORDS, &one, &csize);
if (error)
-
return (error)
;
+
goto out
;
ASSERT(one == 1);
ASSERT(one == 1);
- ASSERT(csize <=
sizeof (cbuf
));
+ ASSERT(csize <=
(sizeof (dde->dde_phys) + 1
));
error = zap_lookup_uint64(os, object, (uint64_t *)&dde->dde_key,
DDT_KEY_WORDS, 1, csize, cbuf);
if (error)
error = zap_lookup_uint64(os, object, (uint64_t *)&dde->dde_key,
DDT_KEY_WORDS, 1, csize, cbuf);
if (error)
-
return (error)
;
+
goto out
;
ddt_decompress(cbuf, dde->dde_phys, csize, sizeof (dde->dde_phys));
ddt_decompress(cbuf, dde->dde_phys, csize, sizeof (dde->dde_phys));
+out:
+ kmem_free(cbuf, sizeof (dde->dde_phys) + 1);
- return (
0
);
+ return (
error
);
}
static void
}
static void
@@
-134,14
+138,10
@@
ddt_zap_walk(objset_t *os, uint64_t object, ddt_entry_t *dde, uint64_t *walk)
return (error);
}
return (error);
}
-static
uint64_
t
-ddt_zap_count(objset_t *os, uint64_t object)
+static
in
t
+ddt_zap_count(objset_t *os, uint64_t object
, uint64_t *count
)
{
{
- uint64_t count = 0;
-
- VERIFY(zap_count(os, object, &count) == 0);
-
- return (count);
+ return zap_count(os, object, count);
}
const ddt_ops_t ddt_zap_ops = {
}
const ddt_ops_t ddt_zap_ops = {