Changeset View
Standalone View
sys/geom/geom_int.h
Show All 31 Lines | |||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#pragma once | |||||
rlibby: I feel like this may cause consternation (non-standard, not really used in the project, and… | |||||
Done Inline ActionsI sneak it in wherever I can, until someone complains. I'll replace it if you insist, but otherwise, it's supported by every compiler we could conceivably care about. cem: I sneak it in wherever I can, until someone complains. I'll replace it if you insist, but… | |||||
LIST_HEAD(class_list_head, g_class); | LIST_HEAD(class_list_head, g_class); | ||||
TAILQ_HEAD(g_tailq_head, g_geom); | TAILQ_HEAD(g_tailq_head, g_geom); | ||||
#define _GEOM_DEBUG(gcls, ctrlvar, loglvl, biop, formatstr, ...) do { \ | |||||
const int __control = (ctrlvar); \ | |||||
const int __level = (loglvl); \ | |||||
Not Done Inline Actions(Have we tried to get FreeBSD to take #define __UNIQ __CONCAT(__uniq, __COUNTER__) ?) rlibby: (Have we tried to get FreeBSD to take `#define __UNIQ __CONCAT(__uniq, __COUNTER__)` ?) | |||||
Done Inline ActionsI'm not sure. Do you know how __COUNTER__ interacts with reproducible builds? If it's per-CU, that seems more readily reproducible than any other scheme. Would it provide any benefit here? Worst case, this is a new scope and these variables shadow the external ones, right? Triggering -Wshadow, which is annoying with -Werror. Unless ctrlvar or biop is literally named __{control,level} I think we're ok without __UNIQ in this instance. I might be missing something :-). cem: I'm not sure. Do you know how `__COUNTER__` interacts with reproducible builds? If it's per… | |||||
Not Done Inline ActionsYeah, it was just a question, I definitely wouldn't insist on doing that for this review. Actually I had thought it was in the standard, but apparently it isn't. Perhaps that's why we haven't tried to upstream it. Yes, I believe it's set to 0 at the start of each CU. There's probably no practical benefit here, but a theoretical one. It's as you noted about ctlvar and biop, but it also affects the format varargs. I ran into a similar issue recently with fail points, which had me thinking about it. rlibby: Yeah, it was just a question, I definitely wouldn't insist on doing that for this review. | |||||
\ | |||||
if (__control < __level) \ | |||||
break; \ | |||||
\ | |||||
g_dbg_printf((gcls), (__control > 0) ? __level : -1, (biop), \ | |||||
": " formatstr, ## __VA_ARGS__); \ | |||||
} while (0) | |||||
extern int g_collectstats; | extern int g_collectstats; | ||||
#define G_STATS_PROVIDERS 1 /* Collect I/O stats for providers */ | #define G_STATS_PROVIDERS 1 /* Collect I/O stats for providers */ | ||||
#define G_STATS_CONSUMERS 2 /* Collect I/O stats for consumers */ | #define G_STATS_CONSUMERS 2 /* Collect I/O stats for consumers */ | ||||
extern int g_debugflags; | extern int g_debugflags; | ||||
/* | /* | ||||
* 1 G_T_TOPOLOGY | * 1 G_T_TOPOLOGY | ||||
* 2 G_T_BIO | * 2 G_T_BIO | ||||
* 4 G_T_ACCESS | * 4 G_T_ACCESS | ||||
* 8 (unused) | * 8 (unused) | ||||
* 16 Allow footshooting on rank#1 providers | * 16 Allow footshooting on rank#1 providers | ||||
* 32 G_T_DETAILS | * 32 G_T_DETAILS | ||||
*/ | */ | ||||
#define G_F_DISKIOCTL 64 | #define G_F_DISKIOCTL 64 | ||||
#define G_F_CTLDUMP 128 | #define G_F_CTLDUMP 128 | ||||
/* geom_dump.c */ | /* geom_dump.c */ | ||||
void g_confxml(void *, int flag); | void g_confxml(void *, int flag); | ||||
void g_conf_specific(struct sbuf *sb, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp); | void g_conf_specific(struct sbuf *sb, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp); | ||||
void g_conf_cat_escaped(struct sbuf *sb, const char *buf); | void g_conf_cat_escaped(struct sbuf *sb, const char *buf); | ||||
void g_conf_printf_escaped(struct sbuf *sb, const char *fmt, ...); | void g_conf_printf_escaped(struct sbuf *sb, const char *fmt, ...) __printflike(2, 3); | ||||
void g_confdot(void *, int flag); | void g_confdot(void *, int flag); | ||||
void g_conftxt(void *, int flag); | void g_conftxt(void *, int flag); | ||||
/* geom_event.c */ | /* geom_event.c */ | ||||
void g_event_init(void); | void g_event_init(void); | ||||
void g_run_events(void); | void g_run_events(void); | ||||
void g_do_wither(void); | void g_do_wither(void); | ||||
/* geom_subr.c */ | /* geom_subr.c */ | ||||
extern struct class_list_head g_classes; | extern struct class_list_head g_classes; | ||||
extern char *g_wait_event, *g_wait_sim, *g_wait_up, *g_wait_down; | extern char *g_wait_event, *g_wait_sim, *g_wait_up, *g_wait_down; | ||||
void g_wither_washer(void); | void g_wither_washer(void); | ||||
void g_dbg_printf(const char *gcls, int lvl, struct bio *bp, const char *format, ...) __printflike(4, 5); | |||||
/* geom_io.c */ | /* geom_io.c */ | ||||
void g_io_init(void); | void g_io_init(void); | ||||
void g_io_schedule_down(struct thread *tp); | void g_io_schedule_down(struct thread *tp); | ||||
void g_io_schedule_up(struct thread *tp); | void g_io_schedule_up(struct thread *tp); | ||||
/* geom_kern.c / geom_kernsim.c */ | /* geom_kern.c / geom_kernsim.c */ | ||||
void g_init(void); | void g_init(void); | ||||
extern int g_shutdown; | extern int g_shutdown; | ||||
extern int g_notaste; | extern int g_notaste; | ||||
/* geom_ctl.c */ | /* geom_ctl.c */ | ||||
void g_ctl_init(void); | void g_ctl_init(void); |
I feel like this may cause consternation (non-standard, not really used in the project, and other geom headers use ifndef include guards). However, I have no love for the bad old way either.