Remove KMC_NOMAGAZINE

Remove dead code to make the implementation easier to understand.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Ahrens <matt@delphix.com>
Closes #10650
This commit is contained in:
Matthew Ahrens 2020-07-30 13:56:00 -07:00 committed by Brian Behlendorf
parent 3c09f6949a
commit c6f2b942be
3 changed files with 2 additions and 11 deletions

View File

@ -37,7 +37,6 @@
*/
typedef enum kmc_bit {
KMC_BIT_NODEBUG = 1, /* Default behavior */
KMC_BIT_NOMAGAZINE = 2, /* XXX: Unsupported */
KMC_BIT_KMEM = 5, /* Use kmem cache */
KMC_BIT_VMEM = 6, /* Use vmem cache */
KMC_BIT_KVMEM = 7, /* Use kvmalloc linux allocator */
@ -61,7 +60,6 @@ typedef enum kmem_cbrc {
} kmem_cbrc_t;
#define KMC_NODEBUG (1 << KMC_BIT_NODEBUG)
#define KMC_NOMAGAZINE (1 << KMC_BIT_NOMAGAZINE)
#define KMC_KMEM (1 << KMC_BIT_KMEM)
#define KMC_VMEM (1 << KMC_BIT_VMEM)
#define KMC_KVMEM (1 << KMC_BIT_KVMEM)

View File

@ -58,7 +58,6 @@ typedef void vmem_t;
* Flags for umem_cache_create()
*/
#define UMC_NODEBUG 0x00020000
#define UMC_NOMAGAZINE 0x00040000
#define UMEM_CACHE_NAMELEN 31

View File

@ -662,8 +662,7 @@ spl_magazine_create(spl_kmem_cache_t *skc)
{
int i = 0;
if (skc->skc_flags & KMC_NOMAGAZINE)
return (0);
ASSERT((skc->skc_flags & KMC_SLAB) == 0);
skc->skc_mag = kzalloc(sizeof (spl_kmem_magazine_t *) *
num_possible_cpus(), kmem_flags_convert(KM_SLEEP));
@ -693,8 +692,7 @@ spl_magazine_destroy(spl_kmem_cache_t *skc)
spl_kmem_magazine_t *skm;
int i = 0;
if (skc->skc_flags & KMC_NOMAGAZINE)
return;
ASSERT((skc->skc_flags & KMC_SLAB) == 0);
for_each_possible_cpu(i) {
skm = skc->skc_mag[i];
@ -721,7 +719,6 @@ spl_magazine_destroy(spl_kmem_cache_t *skc)
* KMC_KVMEM Force kvmem backed SPL cache
* KMC_SLAB Force Linux slab backed cache
* KMC_NODEBUG Disable debugging (unsupported)
* KMC_NOMAGAZINE Enabled for kmem/vmem, Disabled for Linux slab
*/
spl_kmem_cache_t *
spl_kmem_cache_create(char *name, size_t size, size_t align,
@ -735,7 +732,6 @@ spl_kmem_cache_create(char *name, size_t size, size_t align,
/*
* Unsupported flags
*/
ASSERT0(flags & KMC_NOMAGAZINE);
ASSERT(vmp == NULL);
ASSERT(reclaim == NULL);
@ -872,8 +868,6 @@ spl_kmem_cache_create(char *name, size_t size, size_t align,
rc = ENOMEM;
goto out;
}
skc->skc_flags |= KMC_NOMAGAZINE;
}
down_write(&spl_kmem_cache_sem);