Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/geom.h
Show First 20 Lines • Show All 415 Lines • ▼ Show 20 Lines | |||||
#define DECLARE_GEOM_CLASS(class, name) \ | #define DECLARE_GEOM_CLASS(class, name) \ | ||||
static moduledata_t name##_mod = { \ | static moduledata_t name##_mod = { \ | ||||
#name, g_modevent, &class \ | #name, g_modevent, &class \ | ||||
}; \ | }; \ | ||||
DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); | DECLARE_MODULE(name, name##_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); | ||||
int g_is_geom_thread(struct thread *td); | int g_is_geom_thread(struct thread *td); | ||||
#else | |||||
#include <string.h> | |||||
#endif /* _KERNEL */ | |||||
#ifndef _PATH_DEV | #ifndef _PATH_DEV | ||||
#define _PATH_DEV "/dev/" | #define _PATH_DEV "/dev/" | ||||
#endif | #endif | ||||
cem: Seems like we should be able to eliminate either the definition or the paths include, right? | |||||
#endif /* _KERNEL */ | static __inline const char * | ||||
g_provider_name(const char *path) | |||||
Done Inline ActionsI am thinking whether g_provider_name() would be more specific. mav: I am thinking whether g_provider_name() would be more specific. | |||||
{ | |||||
if (strncmp(path, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) | |||||
path += sizeof(_PATH_DEV) - 1; | |||||
return (path); | |||||
} | |||||
/* geom_ctl.c */ | /* geom_ctl.c */ | ||||
int gctl_set_param(struct gctl_req *req, const char *param, void const *ptr, int len); | int gctl_set_param(struct gctl_req *req, const char *param, void const *ptr, int len); | ||||
void gctl_set_param_err(struct gctl_req *req, const char *param, void const *ptr, int len); | void gctl_set_param_err(struct gctl_req *req, const char *param, void const *ptr, int len); | ||||
void *gctl_get_param(struct gctl_req *req, const char *param, int *len); | void *gctl_get_param(struct gctl_req *req, const char *param, int *len); | ||||
void *gctl_get_param_flags(struct gctl_req *req, const char *param, int flags, int *len); | void *gctl_get_param_flags(struct gctl_req *req, const char *param, int flags, int *len); | ||||
char const *gctl_get_asciiparam(struct gctl_req *req, const char *param); | char const *gctl_get_asciiparam(struct gctl_req *req, const char *param); | ||||
void *gctl_get_paraml(struct gctl_req *req, const char *param, int len); | void *gctl_get_paraml(struct gctl_req *req, const char *param, int len); | ||||
void *gctl_get_paraml_opt(struct gctl_req *req, const char *param, int len); | void *gctl_get_paraml_opt(struct gctl_req *req, const char *param, int len); | ||||
int gctl_error(struct gctl_req *req, const char *fmt, ...) __printflike(2, 3); | int gctl_error(struct gctl_req *req, const char *fmt, ...) __printflike(2, 3); | ||||
void gctl_msg(struct gctl_req *req, const char *fmt, ...) __printflike(2, 3); | void gctl_msg(struct gctl_req *req, const char *fmt, ...) __printflike(2, 3); | ||||
void gctl_post_messages(struct gctl_req *req); | void gctl_post_messages(struct gctl_req *req); | ||||
struct g_class *gctl_get_class(struct gctl_req *req, char const *arg); | struct g_class *gctl_get_class(struct gctl_req *req, char const *arg); | ||||
const char *gctl_get_providername(struct gctl_req *, const char *); | |||||
Done Inline Actions... and respectively here "provider" not "device". mav: ... and respectively here "provider" not "device". | |||||
struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mp, char const *arg); | struct g_geom *gctl_get_geom(struct gctl_req *req, struct g_class *mp, char const *arg); | ||||
struct g_provider *gctl_get_provider(struct gctl_req *req, char const *arg); | struct g_provider *gctl_get_provider(struct gctl_req *req, char const *arg); | ||||
#endif /* _GEOM_GEOM_H_ */ | #endif /* _GEOM_GEOM_H_ */ |
Seems like we should be able to eliminate either the definition or the paths include, right?