mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-31 11:14:09 +03:00
OK, some pretty substantial rework here. I've merged the spl-file
stuff which only inclused the getf()/releasef() in to the vnode area where it will only really be used. These calls allow a user to grab an open file struct given only the known open fd for a particular user context. ZFS makes use of these, but they're a bit tricky to test from within the kernel since you already need the file open and know the fd. So we basically spook the system calls to setup the environment we need for the splat test case and verify given just the know fd we can get the file, create the needed vnode, and then use the vnode interface as usual to read and write from it. While I was hacking away I also noticed a NULL termination issue in the second kobj test case so I fixed that too. In fact, I fixed a few other things as well but all for the best! git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@51 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
@@ -238,21 +238,23 @@ __kmem_cache_create(char *name, size_t size, size_t align,
|
||||
}
|
||||
EXPORT_SYMBOL(__kmem_cache_create);
|
||||
|
||||
/* Return codes discarded because Solaris implementation has void return */
|
||||
void
|
||||
/* Return code provided despite Solaris's void return. There should be no
|
||||
* harm here since the Solaris versions will ignore it anyway. */
|
||||
int
|
||||
__kmem_cache_destroy(kmem_cache_t *cache)
|
||||
{
|
||||
kmem_cache_cb_t *kcc;
|
||||
char *name;
|
||||
int rc;
|
||||
|
||||
spin_lock(&kmem_cache_cb_lock);
|
||||
kcc = kmem_cache_find_cache_cb(cache);
|
||||
spin_unlock(&kmem_cache_cb_lock);
|
||||
if (kcc == NULL)
|
||||
return;
|
||||
return -EINVAL;
|
||||
|
||||
name = (char *)kmem_cache_name(cache);
|
||||
kmem_cache_destroy(cache);
|
||||
rc = kmem_cache_destroy(cache);
|
||||
kmem_cache_remove_cache_cb(kcc);
|
||||
kfree(name);
|
||||
|
||||
@@ -262,6 +264,7 @@ __kmem_cache_destroy(kmem_cache_t *cache)
|
||||
remove_shrinker(kmem_cache_shrinker);
|
||||
|
||||
spin_unlock(&kmem_cache_cb_lock);
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL(__kmem_cache_destroy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user