mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 22:32:43 -04:00
Remove the now obsolete geomidorname hack.
This commit is contained in:
parent
a460614661
commit
606402511a
2 changed files with 0 additions and 107 deletions
|
|
@ -176,26 +176,6 @@ struct g_provider {
|
|||
#define G_PF_CANDELETE 0x1
|
||||
};
|
||||
|
||||
/*
|
||||
* This gadget is used by userland to pinpoint a particular instance of
|
||||
* something in the kernel. The name is unreadable on purpose, people
|
||||
* should not encounter it directly but use library functions to deal
|
||||
* with it.
|
||||
* If len is zero, "id" contains a cast of the kernel pointer where the
|
||||
* entity is located, (likely derived from the "id=" attribute in the
|
||||
* XML config) and the g_id*() functions will validate this before allowing
|
||||
* it to be used.
|
||||
* If len is non-zero, it is the strlen() of the name which is pointed to
|
||||
* by "name".
|
||||
*/
|
||||
struct geomidorname {
|
||||
u_int len;
|
||||
union {
|
||||
const char *name;
|
||||
uintptr_t id;
|
||||
} u;
|
||||
};
|
||||
|
||||
/* geom_dev.c */
|
||||
int g_dev_print(void);
|
||||
|
||||
|
|
@ -239,10 +219,6 @@ void g_spoil(struct g_provider *pp, struct g_consumer *cp);
|
|||
int g_std_access(struct g_provider *pp, int dr, int dw, int de);
|
||||
void g_std_done(struct bio *bp);
|
||||
void g_std_spoiled(struct g_consumer *cp);
|
||||
struct g_class *g_idclass(struct geomidorname *);
|
||||
struct g_geom *g_idgeom(struct geomidorname *);
|
||||
struct g_provider *g_idprovider(struct geomidorname *);
|
||||
|
||||
|
||||
/* geom_io.c */
|
||||
struct bio * g_clone_bio(struct bio *);
|
||||
|
|
|
|||
|
|
@ -688,86 +688,3 @@ g_sanity(void *ptr)
|
|||
}
|
||||
}
|
||||
|
||||
struct g_class *
|
||||
g_idclass(struct geomidorname *p)
|
||||
{
|
||||
struct g_class *mp;
|
||||
char *n;
|
||||
|
||||
if (p->len == 0) {
|
||||
LIST_FOREACH(mp, &g_classes, class)
|
||||
if ((uintptr_t)mp == p->u.id)
|
||||
return (mp);
|
||||
return (NULL);
|
||||
}
|
||||
n = g_malloc(p->len + 1, M_WAITOK);
|
||||
if (copyin(p->u.name, n, p->len) == 0) {
|
||||
n[p->len] = '\0';
|
||||
LIST_FOREACH(mp, &g_classes, class)
|
||||
if (!bcmp(n, mp->name, p->len + 1)) {
|
||||
g_free(n);
|
||||
return (mp);
|
||||
}
|
||||
}
|
||||
g_free(n);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
struct g_geom *
|
||||
g_idgeom(struct geomidorname *p)
|
||||
{
|
||||
struct g_class *mp;
|
||||
struct g_geom *gp;
|
||||
char *n;
|
||||
|
||||
if (p->len == 0) {
|
||||
LIST_FOREACH(mp, &g_classes, class)
|
||||
LIST_FOREACH(gp, &mp->geom, geom)
|
||||
if ((uintptr_t)gp == p->u.id)
|
||||
return (gp);
|
||||
return (NULL);
|
||||
}
|
||||
n = g_malloc(p->len + 1, M_WAITOK);
|
||||
if (copyin(p->u.name, n, p->len) == 0) {
|
||||
n[p->len] = '\0';
|
||||
LIST_FOREACH(mp, &g_classes, class)
|
||||
LIST_FOREACH(gp, &mp->geom, geom)
|
||||
if (!bcmp(n, gp->name, p->len + 1)) {
|
||||
g_free(n);
|
||||
return (gp);
|
||||
}
|
||||
}
|
||||
g_free(n);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
struct g_provider *
|
||||
g_idprovider(struct geomidorname *p)
|
||||
{
|
||||
struct g_class *mp;
|
||||
struct g_geom *gp;
|
||||
struct g_provider *pp;
|
||||
char *n;
|
||||
|
||||
if (p->len == 0) {
|
||||
LIST_FOREACH(mp, &g_classes, class)
|
||||
LIST_FOREACH(gp, &mp->geom, geom)
|
||||
LIST_FOREACH(pp, &gp->provider, provider)
|
||||
if ((uintptr_t)pp == p->u.id)
|
||||
return (pp);
|
||||
return (NULL);
|
||||
}
|
||||
n = g_malloc(p->len + 1, M_WAITOK);
|
||||
if (copyin(p->u.name, n, p->len) == 0) {
|
||||
n[p->len] = '\0';
|
||||
LIST_FOREACH(mp, &g_classes, class)
|
||||
LIST_FOREACH(gp, &mp->geom, geom)
|
||||
LIST_FOREACH(pp, &gp->provider, provider)
|
||||
if (!bcmp(n, pp->name, p->len + 1)) {
|
||||
g_free(n);
|
||||
return (pp);
|
||||
}
|
||||
}
|
||||
g_free(n);
|
||||
return (NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue