MFV r329753: 8809 libzpool should leverage work done in libfakekernel
illumos/illumos-gate@f06dce2c1f Reviewed by: Sebastien Roy <sebastien.roy@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Andrew Stormont <astormont@racktopsystems.com>
This commit is contained in:
commit
d208c07cf3
@ -23,6 +23,7 @@
|
|||||||
* Copyright (c) 2012, 2017 by Delphix. All rights reserved.
|
* Copyright (c) 2012, 2017 by Delphix. All rights reserved.
|
||||||
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
|
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
|
||||||
* Copyright (c) 2014 Integros [integros.com]
|
* Copyright (c) 2014 Integros [integros.com]
|
||||||
|
* Copyright 2017 RackTop Systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/zfs_context.h>
|
#include <sys/zfs_context.h>
|
||||||
@ -66,7 +67,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, default_ibs, CTLFLAG_RWTUN,
|
|||||||
&zfs_default_ibs, 0, "Default dnode indirect block shift");
|
&zfs_default_ibs, 0, "Default dnode indirect block shift");
|
||||||
|
|
||||||
#ifdef illumos
|
#ifdef illumos
|
||||||
|
#ifdef _KERNEL
|
||||||
static kmem_cbrc_t dnode_move(void *, void *, size_t, void *);
|
static kmem_cbrc_t dnode_move(void *, void *, size_t, void *);
|
||||||
|
#endif /* _KERNEL */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -222,7 +225,9 @@ dnode_init(void)
|
|||||||
dnode_cache = kmem_cache_create("dnode_t",
|
dnode_cache = kmem_cache_create("dnode_t",
|
||||||
sizeof (dnode_t),
|
sizeof (dnode_t),
|
||||||
0, dnode_cons, dnode_dest, NULL, NULL, NULL, 0);
|
0, dnode_cons, dnode_dest, NULL, NULL, NULL, 0);
|
||||||
|
#ifdef _KERNEL
|
||||||
kmem_cache_set_move(dnode_cache, dnode_move);
|
kmem_cache_set_move(dnode_cache, dnode_move);
|
||||||
|
#endif /* _KERNEL */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -414,7 +419,9 @@ dnode_create(objset_t *os, dnode_phys_t *dnp, dmu_buf_impl_t *db,
|
|||||||
dnode_t *dn;
|
dnode_t *dn;
|
||||||
|
|
||||||
dn = kmem_cache_alloc(dnode_cache, KM_SLEEP);
|
dn = kmem_cache_alloc(dnode_cache, KM_SLEEP);
|
||||||
|
#ifdef _KERNEL
|
||||||
ASSERT(!POINTER_IS_VALID(dn->dn_objset));
|
ASSERT(!POINTER_IS_VALID(dn->dn_objset));
|
||||||
|
#endif /* _KERNEL */
|
||||||
dn->dn_moved = 0;
|
dn->dn_moved = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -706,6 +713,7 @@ static struct {
|
|||||||
} dnode_move_stats;
|
} dnode_move_stats;
|
||||||
#endif /* DNODE_STATS */
|
#endif /* DNODE_STATS */
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
static void
|
static void
|
||||||
dnode_move_impl(dnode_t *odn, dnode_t *ndn)
|
dnode_move_impl(dnode_t *odn, dnode_t *ndn)
|
||||||
{
|
{
|
||||||
@ -843,7 +851,6 @@ dnode_move_impl(dnode_t *odn, dnode_t *ndn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef illumos
|
#ifdef illumos
|
||||||
#ifdef _KERNEL
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static kmem_cbrc_t
|
static kmem_cbrc_t
|
||||||
dnode_move(void *buf, void *newbuf, size_t size, void *arg)
|
dnode_move(void *buf, void *newbuf, size_t size, void *arg)
|
||||||
@ -984,8 +991,8 @@ dnode_move(void *buf, void *newbuf, size_t size, void *arg)
|
|||||||
|
|
||||||
return (KMEM_CBRC_YES);
|
return (KMEM_CBRC_YES);
|
||||||
}
|
}
|
||||||
#endif /* _KERNEL */
|
|
||||||
#endif /* illumos */
|
#endif /* illumos */
|
||||||
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
void
|
void
|
||||||
dnode_special_close(dnode_handle_t *dnh)
|
dnode_special_close(dnode_handle_t *dnh)
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Use is subject to license terms.
|
* Use is subject to license terms.
|
||||||
|
* Copyright 2017 RackTop Systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SYS_ACL_H
|
#ifndef _SYS_ACL_H
|
||||||
@ -130,7 +131,7 @@ typedef struct acl_info acl_t;
|
|||||||
#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED| \
|
#define ACL_FLAGS_ALL (ACL_AUTO_INHERIT|ACL_PROTECTED| \
|
||||||
ACL_DEFAULTED)
|
ACL_DEFAULTED)
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#if defined(_KERNEL) || defined(_FAKE_KERNEL)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These are only applicable in a CIFS context.
|
* These are only applicable in a CIFS context.
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 by Delphix. All rights reserved.
|
* Copyright (c) 2014 by Delphix. All rights reserved.
|
||||||
|
* Copyright 2017 RackTop Systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||||
@ -134,7 +135,7 @@ extern "C" {
|
|||||||
#define BIT_ONLYONESET(u) \
|
#define BIT_ONLYONESET(u) \
|
||||||
((((u) == 0) ? 0 : ((u) & ((u) - 1)) == 0))
|
((((u) == 0) ? 0 : ((u) & ((u) - 1)) == 0))
|
||||||
|
|
||||||
#if defined(_KERNEL) && !defined(_ASM)
|
#if (defined(_KERNEL) || defined(_FAKE_KERNEL)) && !defined(_ASM)
|
||||||
#include <sys/atomic.h>
|
#include <sys/atomic.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -188,7 +189,7 @@ extern int odd_parity(ulong_t);
|
|||||||
*/
|
*/
|
||||||
#define BITX(u, h, l) (((u) >> (l)) & ((1LU << ((h) - (l) + 1LU)) - 1LU))
|
#define BITX(u, h, l) (((u) >> (l)) & ((1LU << ((h) - (l) + 1LU)) - 1LU))
|
||||||
|
|
||||||
#endif /* _KERNEL && !_ASM */
|
#endif /* (_KERNEL || _FAKE_KERNEL) && !_ASM */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright 2017 RackTop Systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SYS_CPUPART_H
|
#ifndef _SYS_CPUPART_H
|
||||||
@ -40,7 +41,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#if defined(_KERNEL) || defined(_FAKE_KERNEL)
|
||||||
|
|
||||||
typedef int cpupartid_t;
|
typedef int cpupartid_t;
|
||||||
|
|
||||||
@ -148,7 +149,7 @@ extern uint_t cpupart_list(psetid_t *, uint_t, int);
|
|||||||
extern int cpupart_setattr(psetid_t, uint_t);
|
extern int cpupart_setattr(psetid_t, uint_t);
|
||||||
extern int cpupart_getattr(psetid_t, uint_t *);
|
extern int cpupart_getattr(psetid_t, uint_t *);
|
||||||
|
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL || _FAKE_KERNEL */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2014 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
* Copyright 2014 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
||||||
|
* Copyright 2017 RackTop Systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SYS_CPUVAR_H
|
#ifndef _SYS_CPUVAR_H
|
||||||
@ -31,6 +32,7 @@
|
|||||||
#include <sys/sysinfo.h> /* has cpu_stat_t definition */
|
#include <sys/sysinfo.h> /* has cpu_stat_t definition */
|
||||||
#include <sys/disp.h>
|
#include <sys/disp.h>
|
||||||
#include <sys/processor.h>
|
#include <sys/processor.h>
|
||||||
|
#include <sys/kcpc.h> /* has kcpc_ctx_t definition */
|
||||||
|
|
||||||
#include <sys/loadavg.h>
|
#include <sys/loadavg.h>
|
||||||
#if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP)
|
#if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP)
|
||||||
@ -610,9 +612,9 @@ extern struct cpu *curcpup(void);
|
|||||||
#endif /* _KERNEL || _KMEMUSER */
|
#endif /* _KERNEL || _KMEMUSER */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CPU support routines.
|
* CPU support routines (not for genassym.c)
|
||||||
*/
|
*/
|
||||||
#if defined(_KERNEL) && defined(__STDC__) /* not for genassym.c */
|
#if (defined(_KERNEL) || defined(_FAKE_KERNEL)) && defined(__STDC__)
|
||||||
|
|
||||||
struct zone;
|
struct zone;
|
||||||
|
|
||||||
@ -819,7 +821,7 @@ extern void populate_idstr(struct cpu *);
|
|||||||
extern void cpu_vm_data_init(struct cpu *);
|
extern void cpu_vm_data_init(struct cpu *);
|
||||||
extern void cpu_vm_data_destroy(struct cpu *);
|
extern void cpu_vm_data_destroy(struct cpu *);
|
||||||
|
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL || _FAKE_KERNEL */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright 2017 RackTop Systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SYS_FM_UTIL_H
|
#ifndef _SYS_FM_UTIL_H
|
||||||
@ -70,7 +71,7 @@ typedef struct erpt_dump {
|
|||||||
} ed_tod_base;
|
} ed_tod_base;
|
||||||
} erpt_dump_t;
|
} erpt_dump_t;
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#if defined(_KERNEL) || defined(_FAKE_KERNEL)
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
|
|
||||||
#define FM_STK_DEPTH 20 /* maximum stack depth */
|
#define FM_STK_DEPTH 20 /* maximum stack depth */
|
||||||
@ -92,7 +93,7 @@ extern void fm_ereport_dump(void);
|
|||||||
extern void fm_ereport_post(nvlist_t *, int);
|
extern void fm_ereport_post(nvlist_t *, int);
|
||||||
|
|
||||||
extern int is_fm_panic();
|
extern int is_fm_panic();
|
||||||
#endif /* _KERNEL */
|
#endif /* _KERNEL || _FAKE_KERNEL */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright 2017 RackTop Systems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
|
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user