1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

geom: clean up empty lines in .c and .h files

This commit is contained in:
Mateusz Guzik 2020-09-01 22:14:09 +00:00
parent 27dcd3d90b
commit d40bc60752
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365226
60 changed files with 32 additions and 141 deletions

View File

@ -129,7 +129,6 @@ g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *p
g_topology_assert();
gp = NULL;
gp = g_new_geomf(mp, "%s.bde", pp->name);
cp = g_new_consumer(gp);
g_attach(cp, pp);
@ -226,7 +225,6 @@ g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *p
return;
}
static int
g_bde_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp)
{

View File

@ -54,7 +54,6 @@
#define G_BDE_LOCKSIZE 384
#define NLOCK_FIELDS 13
/* This just needs to be "large enough" */
#define G_BDE_KEYBYTES 304

View File

@ -124,7 +124,6 @@ g_bde_crypt_read(struct g_bde_work *wp)
u_char skey[G_BDE_SKEYLEN];
keyInstance ki;
cipherInstance ci;
AES_init(&ci);
sc = wp->softc;
@ -164,7 +163,6 @@ g_bde_crypt_write(struct g_bde_work *wp)
AES_init(&ci);
o = 0;
for (n = 0; o < wp->length; n++, o += sc->sectorsize) {
s = (u_char *)wp->data + o;
d = (u_char *)wp->sp->data + o;
arc4rand(skey, sizeof skey, 0);

View File

@ -93,7 +93,6 @@ SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_hi,
sysctl_handle_pct, "IU",
"");
static int g_cache_destroy(struct g_cache_softc *sc, boolean_t force);
static g_ctl_destroy_geom_t g_cache_destroy_geom;
@ -112,7 +111,6 @@ struct g_class g_cache_class = {
#define OFF2BNO(off, sc) ((off) >> (sc)->sc_bshift)
#define BNO2OFF(bno, sc) ((bno) << (sc)->sc_bshift)
static struct g_cache_desc *
g_cache_alloc(struct g_cache_softc *sc)
{

View File

@ -70,7 +70,6 @@ struct g_class g_concat_class = {
.destroy_geom = g_concat_destroy_geom
};
/*
* Greatest Common Divisor.
*/

View File

@ -176,7 +176,6 @@ struct g_class g_eli_class = {
.fini = g_eli_fini
};
/*
* Code paths:
* BIO_READ:
@ -185,7 +184,6 @@ struct g_class g_eli_class = {
* g_eli_start -> g_eli_crypto_run -> g_eli_crypto_write_done -> g_io_request -> g_eli_write_done -> g_io_deliver
*/
/*
* EAGAIN from crypto(9) means, that we were probably balanced to another crypto
* accelerator or something like this.

View File

@ -49,10 +49,8 @@ __FBSDID("$FreeBSD$");
#include <geom/geom_dbg.h>
#include <geom/eli/g_eli.h>
MALLOC_DECLARE(M_ELI);
static void
g_eli_ctl_attach(struct gctl_req *req, struct g_class *mp)
{

View File

@ -84,7 +84,6 @@ static struct cdevsw g_gate_cdevsw = {
.d_name = G_GATE_CTL_NAME
};
static struct g_gate_softc **g_gate_units;
static u_int g_gate_nunits;
static struct mtx g_gate_units_lock;

View File

@ -233,7 +233,6 @@ g_ccd_freesc(struct ccd_s *sc)
g_free(sc);
}
static int
ccdinit(struct gctl_req *req, struct ccd_s *cs)
{
@ -261,7 +260,6 @@ ccdinit(struct gctl_req *req, struct ccd_s *cs)
cs->sc_offset = 0;
else
cs->sc_offset = CCD_OFFSET;
}
for (ix = 0; ix < cs->sc_ndisks; ix++) {
ci = &cs->sc_cinfo[ix];
@ -359,7 +357,6 @@ ccdinterleave(struct ccd_s *cs)
int ix;
daddr_t size;
/*
* Allocate an interleave table. The worst case occurs when each
* of N disks is of a different size, resulting in N interleave

View File

@ -470,7 +470,6 @@ g_ctl_req(void *arg, int flag __unused)
g_topology_assert();
}
static int
g_ctl_ioctl_ctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
{

View File

@ -1081,7 +1081,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS)
sbuf_delete(sb);
return error;
}
SYSCTL_PROC(_kern, OID_AUTO, disks,
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0,
sysctl_disks, "A", "names of available disks");

View File

@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <geom/geom_int.h>
#include <geom/geom_disk.h>
static void
g_confdot_consumer(struct sbuf *sb, struct g_consumer *cp)
{
@ -242,7 +241,6 @@ g_conf_provider(struct sbuf *sb, struct g_provider *pp)
sbuf_cat(sb, "\t</provider>\n");
}
static void
g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp)
{

View File

@ -131,7 +131,6 @@ g_attr_changed_event(void *arg, int flag)
g_topology_assert();
if (flag != EV_CANCEL && g_shutdown == 0) {
/*
* Tell all consumers of the change.
*/
@ -170,7 +169,7 @@ g_orphan_provider(struct g_provider *pp, int error)
KASSERT(error != 0,
("g_orphan_provider(%p(%s), 0) error must be non-zero\n",
pp, pp->name));
pp->error = error;
mtx_lock(&g_eventlock);
KASSERT(!(pp->flags & G_PF_ORPHAN),

View File

@ -36,4 +36,3 @@ struct g_flashmap {
};
#endif

View File

@ -305,7 +305,7 @@ g_io_zonecmd(struct disk_zone_args *zone_args, struct g_consumer *cp)
{
struct bio *bp;
int error;
g_trace(G_T_BIO, "bio_zone(%d)", zone_args->zone_cmd);
bp = g_alloc_bio();
bp->bio_cmd = BIO_ZONE;

View File

@ -187,7 +187,7 @@ sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS)
return (sysctl_kern_geom_confany(req, g_conftxt, &hint));
}
static int
sysctl_kern_geom_confdot(SYSCTL_HANDLER_ARGS)
{

View File

@ -172,7 +172,6 @@ find_marker(struct g_consumer *cp, const char *line, off_t *offset)
for (search_offset = search_start;
search_offset < cp->provider->mediasize;
search_offset += search_step) {
g_topology_unlock();
buf = g_read_data(cp, rounddown(search_offset, sectorsize),
roundup(strlen(search_key), sectorsize), NULL);
@ -376,7 +375,6 @@ g_map_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
for (i = 0; i < MAP_MAXSLICE; i++)
g_map_parse_part(mp, pp, cp, gp, sc, i);
g_access(cp, -1, 0, 0);
if (LIST_EMPTY(&gp->provider)) {
if (bootverbose)

View File

@ -101,7 +101,7 @@ g_dbg_printf(const char *classname, int lvl, struct bio *bp,
sbuf_cat(&sb, classname);
if (lvl >= 0)
sbuf_printf(&sb, "[%d]", lvl);
va_start(ap, format);
sbuf_vprintf(&sb, format, ap);
va_end(ap);
@ -598,7 +598,6 @@ g_new_provider_event(void *arg, int flag)
}
}
struct g_provider *
g_new_providerf(struct g_geom *gp, const char *fmt, ...)
{
@ -717,7 +716,7 @@ g_resize_provider_event(void *arg, int flag)
}
pp->mediasize = size;
LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) {
gp = cp->geom;
if ((gp->flags & G_GEOM_WITHER) == 0 && gp->resize != NULL)

View File

@ -203,7 +203,6 @@ g_label_mangle_name(char *label, size_t size)
if (*label == '\0')
return;
sb = sbuf_new(NULL, NULL, size, SBUF_FIXEDLEN);
for (c = label; *c != '\0'; c++) {
/* Trim leading whitespace. */

View File

@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include <geom/label/g_label.h>
#include <geom/multipath/g_multipath.h>
static char* classes_pass[] = { G_DISK_CLASS_NAME, G_MULTIPATH_CLASS_NAME,
NULL };

View File

@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
#define ISO9660_OFFSET 0x8000
#define VOLUME_LEN 32
static void
g_label_iso9660_taste(struct g_consumer *cp, char *label, size_t size)
{

View File

@ -82,7 +82,6 @@ g_label_msdosfs_taste(struct g_consumer *cp, char *label, size_t size)
goto error;
}
/*
* Test if this is really a FAT volume and determine the FAT type.
*/

View File

@ -110,7 +110,6 @@ struct g_class g_mirror_class = {
.resize = g_mirror_resize
};
static void g_mirror_destroy_provider(struct g_mirror_softc *sc);
static int g_mirror_update_disk(struct g_mirror_disk *disk, u_int state);
static void g_mirror_update_device(struct g_mirror_softc *sc, bool force);
@ -125,7 +124,6 @@ static void g_mirror_register_request(struct g_mirror_softc *sc,
struct bio *bp);
static void g_mirror_sync_release(struct g_mirror_softc *sc);
static const char *
g_mirror_disk_state2str(int state)
{

View File

@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include <geom/geom_dbg.h>
#include <geom/mountver/g_mountver.h>
SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, mountver, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "GEOM_MOUNTVER stuff");
@ -555,7 +554,7 @@ g_mountver_ident_matches(struct g_geom *gp)
return (0);
}
static struct g_geom *
g_mountver_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
{

View File

@ -479,7 +479,6 @@ g_multipath_kt(void *arg)
kproc_exit(0);
}
static int
g_multipath_access(struct g_provider *pp, int dr, int dw, int de)
{

View File

@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include <geom/geom_dbg.h>
#include <geom/nop/g_nop.h>
SYSCTL_DECL(_kern_geom);
static SYSCTL_NODE(_kern_geom, OID_AUTO, nop, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"GEOM_NOP stuff");

View File

@ -317,7 +317,6 @@ g_part_get_physpath_done(struct bio *bp)
g_std_done(bp);
}
#define DPRINTF(...) if (bootverbose) { \
printf("GEOM_PART: " __VA_ARGS__); \
}

View File

@ -663,4 +663,3 @@ g_part_bsd64_write(struct g_part_table *basetable, struct g_consumer *cp)
g_free(dlp);
return (error);
}

View File

@ -210,7 +210,6 @@ ebr_parse_type(const char *type, u_char *dp_typ)
return (EINVAL);
}
static void
ebr_set_chs(struct g_part_table *table, uint32_t lba, u_char *cylp, u_char *hdp,
u_char *secp)
@ -249,7 +248,6 @@ ebr_align(struct g_part_table *basetable, uint32_t *start, uint32_t *size)
return (0);
}
static int
g_part_ebr_add(struct g_part_table *basetable, struct g_part_entry *baseentry,
struct g_part_parms *gpp)

View File

@ -1286,7 +1286,6 @@ g_part_ldm_probe(struct g_part_table *basetable, struct g_consumer *cp)
u_char *buf, type[64];
int error, idx;
pp = cp->provider;
if (pp->sectorsize != 512)
return (ENXIO);

View File

@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
#include <geom/raid/g_raid.h>
#include "g_raid_md_if.h"
static struct g_raid_softc *
g_raid_find_node(struct g_class *mp, const char *name)
{

View File

@ -2270,7 +2270,6 @@ g_raid_md_ctl_ddf(struct g_raid_md_object *md,
error = 0;
if (strcmp(verb, "label") == 0) {
if (*nargs < 4) {
gctl_error(req, "Invalid number of arguments.");
return (-1);
@ -2511,13 +2510,11 @@ g_raid_md_ctl_ddf(struct g_raid_md_object *md,
return (0);
}
if (strcmp(verb, "add") == 0) {
gctl_error(req, "`add` command is not applicable, "
"use `label` instead.");
return (-99);
}
if (strcmp(verb, "delete") == 0) {
nodename = gctl_get_asciiparam(req, "arg0");
if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0)
nodename = NULL;

View File

@ -261,7 +261,6 @@ static struct g_raid_md_class g_raid_md_intel_class = {
.mdc_priority = 100
};
static struct intel_raid_map *
intel_get_map(struct intel_raid_vol *mvol, int i)
{
@ -1454,7 +1453,7 @@ g_raid_md_get_label(struct g_consumer *cp, char *serial, int serlen)
{
char serial_buffer[DISK_IDENT_SIZE];
int len, error;
len = sizeof(serial_buffer);
error = g_io_getattr("GEOM::ident", cp, &len, serial_buffer);
if (error != 0)
@ -1712,7 +1711,6 @@ g_raid_md_ctl_intel(struct g_raid_md_object *md,
nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
error = 0;
if (strcmp(verb, "label") == 0) {
if (*nargs < 4) {
gctl_error(req, "Invalid number of arguments.");
return (-1);
@ -1921,7 +1919,6 @@ g_raid_md_ctl_intel(struct g_raid_md_object *md,
return (0);
}
if (strcmp(verb, "add") == 0) {
if (*nargs != 3) {
gctl_error(req, "Invalid number of arguments.");
return (-1);
@ -2108,7 +2105,6 @@ g_raid_md_ctl_intel(struct g_raid_md_object *md,
return (0);
}
if (strcmp(verb, "delete") == 0) {
nodename = gctl_get_asciiparam(req, "arg0");
if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0)
nodename = NULL;

View File

@ -527,7 +527,6 @@ g_raid_md_jmicron_start_disk(struct g_raid_disk *disk)
/* Welcome the new disk. */
g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE);
TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) {
/*
* Different disks may have different sizes/offsets,
* especially in concat mode. Update.
@ -1044,7 +1043,6 @@ g_raid_md_ctl_jmicron(struct g_raid_md_object *md,
nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
error = 0;
if (strcmp(verb, "label") == 0) {
if (*nargs < 4) {
gctl_error(req, "Invalid number of arguments.");
return (-1);
@ -1238,7 +1236,6 @@ g_raid_md_ctl_jmicron(struct g_raid_md_object *md,
return (0);
}
if (strcmp(verb, "delete") == 0) {
/* Check if some volume is still open. */
force = gctl_get_paraml(req, "force", sizeof(*force));
if (force != NULL && *force == 0 &&

View File

@ -535,7 +535,6 @@ g_raid_md_nvidia_start_disk(struct g_raid_disk *disk)
// else
// g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED);
TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) {
/*
* Different disks may have different sizes,
* in concat mode. Update from real disk size.
@ -1048,7 +1047,6 @@ g_raid_md_ctl_nvidia(struct g_raid_md_object *md,
nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
error = 0;
if (strcmp(verb, "label") == 0) {
if (*nargs < 4) {
gctl_error(req, "Invalid number of arguments.");
return (-1);
@ -1243,7 +1241,6 @@ g_raid_md_ctl_nvidia(struct g_raid_md_object *md,
return (0);
}
if (strcmp(verb, "delete") == 0) {
/* Check if some volume is still open. */
force = gctl_get_paraml(req, "force", sizeof(*force));
if (force != NULL && *force == 0 &&

View File

@ -189,7 +189,6 @@ static struct g_raid_md_class g_raid_md_promise_class = {
.mdc_priority = 100
};
static void
g_raid_md_promise_print(struct promise_raid_conf *meta)
{
@ -1281,7 +1280,6 @@ g_raid_md_ctl_promise(struct g_raid_md_object *md,
nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
error = 0;
if (strcmp(verb, "label") == 0) {
if (*nargs < 4) {
gctl_error(req, "Invalid number of arguments.");
return (-1);
@ -1502,13 +1500,11 @@ g_raid_md_ctl_promise(struct g_raid_md_object *md,
return (0);
}
if (strcmp(verb, "add") == 0) {
gctl_error(req, "`add` command is not applicable, "
"use `label` instead.");
return (-99);
}
if (strcmp(verb, "delete") == 0) {
nodename = gctl_get_asciiparam(req, "arg0");
if (nodename != NULL && strcasecmp(sc->sc_name, nodename) != 0)
nodename = NULL;

View File

@ -586,7 +586,6 @@ g_raid_md_sii_start_disk(struct g_raid_disk *disk)
else
g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED);
TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) {
/*
* Different disks may have different sizes,
* in concat mode. Update from real disk size.
@ -1132,7 +1131,6 @@ g_raid_md_ctl_sii(struct g_raid_md_object *md,
nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
error = 0;
if (strcmp(verb, "label") == 0) {
if (*nargs < 4) {
gctl_error(req, "Invalid number of arguments.");
return (-1);
@ -1325,7 +1323,6 @@ g_raid_md_ctl_sii(struct g_raid_md_object *md,
return (0);
}
if (strcmp(verb, "delete") == 0) {
/* Check if some volume is still open. */
force = gctl_get_paraml(req, "force", sizeof(*force));
if (force != NULL && *force == 0 &&

View File

@ -123,7 +123,6 @@ g_raid_tr_update_state_concat(struct g_raid_volume *vol)
s = G_RAID_VOLUME_S_BROKEN;
}
if (s != vol->v_state) {
/*
* Some metadata modules may not know CONCAT volume
* mediasize until all disks connected. Recalculate.

View File

@ -401,7 +401,6 @@ g_raid_tr_raid1_rebuild_start(struct g_raid_tr_object *tr)
g_raid_tr_raid1_rebuild_some(tr);
}
static void
g_raid_tr_raid1_maybe_rebuild(struct g_raid_tr_object *tr,
struct g_raid_subdisk *sd)
@ -409,7 +408,7 @@ g_raid_tr_raid1_maybe_rebuild(struct g_raid_tr_object *tr,
struct g_raid_volume *vol;
struct g_raid_tr_raid1_object *trs;
int na, nr;
/*
* If we're stopping, don't do anything. If we don't have at least one
* good disk and one bad disk, we don't do anything. And if there's a
@ -683,7 +682,6 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_object *tr,
*/
if (trs->trso_type == TR_RAID1_REBUILD) {
if (bp->bio_cmd == BIO_READ) {
/* Immediately abort rebuild, if requested. */
if (trs->trso_flags & TR_RAID1_F_ABORT) {
trs->trso_flags &= ~TR_RAID1_F_DOING_SOME;

View File

@ -560,7 +560,7 @@ g_raid_tr_raid1e_maybe_rebuild(struct g_raid_tr_object *tr,
struct g_raid_volume *vol;
struct g_raid_tr_raid1e_object *trs;
int nr;
vol = tr->tro_volume;
trs = (struct g_raid_tr_raid1e_object *)tr;
if (trs->trso_stopping)
@ -899,7 +899,6 @@ g_raid_tr_iodone_raid1e(struct g_raid_tr_object *tr,
if (trs->trso_type == TR_RAID1E_REBUILD) {
nsd = trs->trso_failed_sd;
if (bp->bio_cmd == BIO_READ) {
/* Immediately abort rebuild, if requested. */
if (trs->trso_flags & TR_RAID1E_F_ABORT) {
trs->trso_flags &= ~TR_RAID1E_F_DOING_SOME;

View File

@ -117,7 +117,6 @@ struct g_class g_raid3_class = {
.fini = g_raid3_fini
};
static void g_raid3_destroy_provider(struct g_raid3_softc *sc);
static int g_raid3_update_disk(struct g_raid3_disk *disk, u_int state);
static void g_raid3_update_device(struct g_raid3_softc *sc, boolean_t force);
@ -127,7 +126,6 @@ static void g_raid3_sync_stop(struct g_raid3_softc *sc, int type);
static int g_raid3_register_request(struct bio *pbp);
static void g_raid3_sync_release(struct g_raid3_softc *sc);
static const char *
g_raid3_disk_state2str(int state)
{

View File

@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$");
#include <sys/kthread.h>
#include <geom/raid3/g_raid3.h>
static struct g_raid3_softc *
g_raid3_find_device(struct g_class *mp, const char *name)
{

View File

@ -27,4 +27,3 @@
*/
void g_uzip_wrkthr(void *);

View File

@ -61,14 +61,13 @@ static void gv_attach(struct gv_softc *, struct gctl_req *);
static void gv_detach(struct gv_softc *, struct gctl_req *);
static void gv_parityop(struct gv_softc *, struct gctl_req *);
static void
gv_orphan(struct g_consumer *cp)
{
struct g_geom *gp;
struct gv_softc *sc;
struct gv_drive *d;
g_topology_assert();
KASSERT(cp != NULL, ("gv_orphan: null cp"));
@ -89,7 +88,7 @@ gv_start(struct bio *bp)
{
struct g_geom *gp;
struct gv_softc *sc;
gp = bp->bio_to->geom;
sc = gp->softc;
@ -114,7 +113,7 @@ gv_done(struct bio *bp)
{
struct g_geom *gp;
struct gv_softc *sc;
KASSERT(bp != NULL, ("NULL bp"));
gp = bp->bio_from->geom;
@ -133,7 +132,7 @@ gv_access(struct g_provider *pp, int dr, int dw, int de)
struct gv_softc *sc;
struct gv_drive *d, *d2;
int error;
gp = pp->geom;
sc = gp->softc;
/*
@ -367,7 +366,6 @@ gv_create(struct g_geom *gp, struct gctl_req *req)
goto error;
}
d = g_malloc(sizeof(*d), M_WAITOK | M_ZERO);
bcopy(d2, d, sizeof(*d));
@ -513,7 +511,7 @@ gv_config(struct gctl_req *req, struct g_class *mp, char const *verb)
} else if (!strcmp(verb, "rename")) {
gv_rename(gp, req);
} else if (!strcmp(verb, "resetconfig")) {
gv_post_event(sc, GV_EVENT_RESET_CONFIG, sc, NULL, 0, 0);
@ -581,7 +579,6 @@ gv_parityop(struct gv_softc *sc, struct gctl_req *req)
gv_post_event(sc, GV_EVENT_PARITY_CHECK, p, NULL, 0, 0);
}
static struct g_geom *
gv_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
{

View File

@ -77,7 +77,6 @@ void gv_rm_drive(struct gv_softc *, struct gv_drive *, int);
void gv_rm_plex(struct gv_softc *, struct gv_plex *);
void gv_rm_vol(struct gv_softc *, struct gv_volume *);
/* geom_vinum_state.c */
int gv_sdstatemap(struct gv_plex *);
void gv_setstate(struct g_geom *, struct gctl_req *);

View File

@ -71,7 +71,6 @@ static int gv_legacy_header_type(uint8_t *, int);
* format uses big-endian (network order).
*/
/* Checks for legacy format depending on platform. */
static int
gv_legacy_header_type(uint8_t *hdr, int bigendian)

View File

@ -241,7 +241,6 @@ gv_sync(struct gv_volume *v)
sc = v->vinumconf;
KASSERT(sc != NULL, ("gv_sync: NULL sc on %s", v->name));
up = gv_find_good_plex(v);
if (up == NULL)
return (ENXIO);

View File

@ -228,7 +228,7 @@ gv_lv(struct g_geom *gp, struct gctl_req *req, struct sbuf *sb)
LIST_FOREACH(v, &sc->volumes, volume)
i++;
sbuf_printf(sb, "%d volume%s:\n", i, i == 1 ? "" : "s");
if (i) {
@ -374,7 +374,7 @@ gv_ls(struct g_geom *gp, struct gctl_req *req, struct sbuf *sb)
LIST_FOREACH(s, &sc->subdisks, sd)
i++;
sbuf_printf(sb, "%d subdisk%s:\n", i, i == 1 ? "" : "s");
if (i) {
@ -449,7 +449,7 @@ gv_ld(struct g_geom *gp, struct gctl_req *req, struct sbuf *sb)
LIST_FOREACH(d, &sc->drives, drive)
i++;
sbuf_printf(sb, "%d drive%s:\n", i, i == 1 ? "" : "s");
if (i) {

View File

@ -78,7 +78,7 @@ gv_plex_start(struct gv_plex *p, struct bio *bp)
wp = gv_raid5_start(p, bp, addr, boff, bcount);
if (wp == NULL)
return;
len = wp->length;
if (TAILQ_EMPTY(&wp->bits))
@ -499,7 +499,6 @@ gv_check_parity(struct gv_plex *p, struct bio *bp, struct gv_raid5_packet *wp)
bp->bio_parent->bio_inbed++;
g_destroy_bio(pbp);
}
}
return (finished);
@ -776,7 +775,6 @@ gv_grow_complete(struct gv_plex *p, struct bio *bp)
}
}
/*
* Create an initialization BIO and send it off to the consumer. Assume that
* we're given initialization data as parameter.
@ -1019,7 +1017,7 @@ gv_rebuild_complete(struct gv_plex *p, struct bio *bp)
g_topology_lock();
gv_access(p->vol_sc->provider, -1, -1, 0);
g_topology_unlock();
G_VINUM_DEBUG(0, "rebuild of %s failed at offset %jd errno: %d",
p->name, (intmax_t)offset, error);
p->flags &= ~GV_PLEX_REBUILDING;
@ -1035,7 +1033,7 @@ gv_rebuild_complete(struct gv_plex *p, struct bio *bp)
g_topology_lock();
gv_access(p->vol_sc->provider, -1, -1, 0);
g_topology_unlock();
G_VINUM_DEBUG(1, "rebuild of %s finished", p->name);
gv_save_config(p->vinumconf);
p->flags &= ~GV_PLEX_REBUILDING;

View File

@ -80,7 +80,7 @@ gv_raid5_start(struct gv_plex *p, struct bio *bp, caddr_t addr, off_t boff,
g_free(wp);
return (NULL);
}
/*
* Building the sub-request failed, we probably need to clean up a lot.
*/

View File

@ -80,9 +80,8 @@ gv_tokenize(char *cptr, char *token[], int maxtoken)
{
int tokennr; /* Index of this token. */
char delim; /* Delimiter for searching for the partner. */
for (tokennr = 0; tokennr < maxtoken;) {
for (tokennr = 0; tokennr < maxtoken;) {
/* Skip leading white space. */
while (iswhite(*cptr))
cptr++;
@ -137,7 +136,6 @@ gv_tokenize(char *cptr, char *token[], int maxtoken)
return maxtoken;
}
/*
* Take a number with an optional scale factor and convert it to a number of
* bytes.
@ -159,7 +157,7 @@ gv_sizespec(char *spec)
uint64_t size;
char *s;
int sign;
size = 0;
sign = 1;
if (spec != NULL) { /* we have a parameter */
@ -171,7 +169,6 @@ gv_sizespec(char *spec)
/* It's numeric. */
if ((*s >= '0') && (*s <= '9')) {
/* It's numeric. */
while ((*s >= '0') && (*s <= '9'))
/* Convert it. */
@ -599,8 +596,6 @@ gv_new_plex(int max, char *token[])
return (p);
}
/* Get a new subdisk object. */
struct gv_sd *
gv_new_sd(int max, char *token[])
@ -707,7 +702,7 @@ const char *
gv_roughlength(off_t bytes, int lj)
{
static char desc[16];
/* Gigabytes. */
if (bytes > (off_t)MEGABYTE * 10000)
snprintf(desc, sizeof(desc), lj ? "%jd GB" : "%10jd GB",

View File

@ -130,7 +130,7 @@ gv_set_drive_state(struct gv_drive *d, int newstate, int flags)
KASSERT(d != NULL, ("gv_set_drive_state: NULL d"));
oldstate = d->state;
if (newstate == oldstate)
return (0);
@ -166,7 +166,7 @@ gv_set_sd_state(struct gv_sd *s, int newstate, int flags)
/* We are optimistic and assume it will work. */
status = 0;
if (newstate == oldstate)
return (0);
@ -385,7 +385,7 @@ gv_update_sd_state(struct gv_sd *s)
KASSERT(d != NULL, ("gv_update_sd_state: NULL d"));
oldstate = s->state;
/* If our drive isn't up we cannot be up either. */
if (d->state != GV_DRIVE_UP) {
s->state = GV_SD_DOWN;
@ -401,7 +401,7 @@ gv_update_sd_state(struct gv_sd *s)
s->state = GV_SD_STALE;
} else
s->state = GV_SD_UP;
if (s->state != oldstate)
G_VINUM_DEBUG(1, "subdisk %s state change: %s -> %s", s->name,
gv_sdstate(oldstate), gv_sdstate(s->state));
@ -425,7 +425,7 @@ gv_update_plex_state(struct gv_plex *p)
/* First, check the state of our subdisks. */
sdstates = gv_sdstatemap(p);
/* If all subdisks are up, our plex can be up, too. */
if (sdstates == GV_SD_UPSTATE)
p->state = GV_PLEX_UP;
@ -440,7 +440,6 @@ gv_update_plex_state(struct gv_plex *p)
/* Some of our subdisks are initializing. */
} else if (sdstates & GV_SD_INITSTATE) {
if (p->flags & GV_PLEX_SYNCING ||
p->flags & GV_PLEX_REBUILDING)
p->state = GV_PLEX_DEGRADED;
@ -507,7 +506,7 @@ gv_sdstatemap(struct gv_plex *p)
int statemap;
KASSERT(p != NULL, ("gv_sdstatemap: NULL p"));
statemap = 0;
p->sddown = 0; /* No subdisks down yet. */

View File

@ -648,7 +648,6 @@ gv_sd_to_drive(struct gv_sd *s, struct gv_drive *d)
/* No drive offset given, try to calculate it. */
if (s->drive_offset == -1) {
/* Add offsets and sizes from other subdisks on this drive. */
LIST_FOREACH(s2, &d->subdisks, from_drive) {
s->drive_offset = s2->drive_offset + s2->size;
@ -784,7 +783,6 @@ gv_free_sd(struct gv_sd *s)
/* If there is no free slot behind this subdisk, so create one. */
if (fl == NULL) {
fl = g_malloc(sizeof(*fl), M_WAITOK | M_ZERO);
fl->size = s->size;
fl->offset = s->drive_offset;
@ -835,7 +833,6 @@ gv_adjust_freespace(struct gv_sd *s, off_t remainder)
/* If there is no free slot behind this subdisk, so create one. */
if (fl == NULL) {
fl = g_malloc(sizeof(*fl), M_WAITOK | M_ZERO);
fl->size = remainder;
fl->offset = s->drive_offset + s->size - remainder;

View File

@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
#include <geom/virstor/binstream.h>
/* "Open" a binary stream for reading */
void
bs_open(bin_stream_t * bs, void *data)
@ -45,7 +44,6 @@ bs_open(bin_stream_t * bs, void *data)
bs->pos = 0;
}
/* "Reset" position in binary stream to zero */
void
bs_reset(bin_stream_t * bs)
@ -66,7 +64,6 @@ bs_write_str(bin_stream_t * bs, char *data)
return bs->pos;
}
/* Write an arbitrary buffer; return next position */
unsigned
bs_write_buf(bin_stream_t * bs, char *data, unsigned data_size)
@ -78,7 +75,6 @@ bs_write_buf(bin_stream_t * bs, char *data, unsigned data_size)
return bs->pos;
}
/* Write a 8bit uint; return next position. */
unsigned
bs_write_u8(bin_stream_t * bs, uint8_t data)
@ -87,7 +83,6 @@ bs_write_u8(bin_stream_t * bs, uint8_t data)
return ++(bs->pos);
}
/* Write a 16bit uint; return next position. */
unsigned
bs_write_u16(bin_stream_t * bs, uint16_t data)
@ -96,7 +91,6 @@ bs_write_u16(bin_stream_t * bs, uint16_t data)
return (bs->pos += 2);
}
/* Write a 32bit uint; return next position. */
unsigned
bs_write_u32(bin_stream_t * bs, uint32_t data)
@ -105,7 +99,6 @@ bs_write_u32(bin_stream_t * bs, uint32_t data)
return (bs->pos += 4);
}
/* Write a 64bit uint; return next position. */
unsigned
bs_write_u64(bin_stream_t * bs, uint64_t data)
@ -114,7 +107,6 @@ bs_write_u64(bin_stream_t * bs, uint64_t data)
return (bs->pos += 8);
}
/* Read a 8bit uint & return it */
uint8_t
bs_read_u8(bin_stream_t * bs)
@ -124,7 +116,6 @@ bs_read_u8(bin_stream_t * bs)
return data;
}
/*
* Read a null-terminated string from stream into a buffer; buf_size is size
* of the buffer, including the final \0. Returns buf pointer or NULL if
@ -145,7 +136,6 @@ bs_read_str(bin_stream_t * bs, char *buf, unsigned buf_size)
return buf;
}
/* Read an arbitrary buffer. */
void
bs_read_buf(bin_stream_t * bs, char *buf, unsigned buf_size)
@ -156,7 +146,6 @@ bs_read_buf(bin_stream_t * bs, char *buf, unsigned buf_size)
bs->pos += buf_size;
}
/* Read a 16bit uint & return it */
uint16_t
bs_read_u16(bin_stream_t * bs)
@ -166,7 +155,6 @@ bs_read_u16(bin_stream_t * bs)
return data;
}
/* Read a 32bit uint & return it */
uint32_t
bs_read_u32(bin_stream_t * bs)
@ -176,7 +164,6 @@ bs_read_u32(bin_stream_t * bs)
return data;
}
/* Read a 64bit uint & return it */
uint64_t
bs_read_u64(bin_stream_t * bs)

View File

@ -30,7 +30,6 @@
// $Id: binstream.h,v 1.1 2006/07/05 10:47:54 ivoras Exp $
#ifndef _BIN_STREAM_
#define _BIN_STREAM_
@ -43,14 +42,12 @@ typedef struct {
int pos;
} bin_stream_t;
/* "Open" a binary stream for reading */
void bs_open (bin_stream_t * bs, void *data);
/* "Reset" position in binary stream to zero */
void bs_reset (bin_stream_t * bs);
/* Write a zero-terminated string; return next position */
unsigned bs_write_str(bin_stream_t * bs, char *data);
@ -69,7 +66,6 @@ unsigned bs_write_u32(bin_stream_t * bs, uint32_t data);
/* Write a 64bit uint; return next position. */
unsigned bs_write_u64(bin_stream_t * bs, uint64_t data);
/*
* Read a null-terminated string from stream into a buffer; buf_size is size
* of the buffer, including the final \0. Returns buf pointer or NULL if

View File

@ -397,7 +397,6 @@ virstor_ctl_add(struct gctl_req *req, struct g_class *cp)
* incremented */
sc->n_components++;
added++;
}
/* This call to update_metadata() is critical. In case there's a
* power failure in the middle of it and some components are updated
@ -683,7 +682,7 @@ g_virstor_destroy_geom(struct gctl_req *req __unused, struct g_class *mp,
sc = gp->softc;
KASSERT(sc != NULL, ("%s: NULL sc", __func__));
exitval = 0;
LOG_MSG(LVL_DEBUG, "%s called for %s, sc=%p", __func__, gp->name,
gp->softc);

View File

@ -33,7 +33,6 @@
#define G_VIRSTOR_CLASS_NAME "VIRSTOR"
#define VIRSTOR_MAP_ALLOCATED 1
struct virstor_map_entry {
uint16_t flags;
@ -70,7 +69,6 @@ struct virstor_map_entry {
/* superfluous debug info (large volumes of data) */
#define LVL_MOREDEBUG 15
/* Component data */
struct g_virstor_component {
struct g_consumer *gcons;
@ -82,7 +80,6 @@ struct g_virstor_component {
unsigned int flags;
};
/* Internal geom instance data */
struct g_virstor_softc {
struct g_geom *geom;
@ -109,7 +106,6 @@ struct g_virstor_bio_q {
STAILQ_ENTRY(g_virstor_bio_q) linkage;
};
#endif /* _KERNEL */
#endif /* !_G_VIRSTOR_H_ */

View File

@ -63,7 +63,6 @@ virstor_metadata_encode(struct g_virstor_metadata *md, unsigned char *data)
bs_write_u16(&bs, md->flags);
}
/*
* Decode data from endian-independant byte stream into g_virstor_metadata
* structure.

View File

@ -28,7 +28,6 @@
* $FreeBSD$
*/
#ifndef _G_VIRSTOR_MD_H_
#define _G_VIRSTOR_MD_H_

View File

@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <geom/geom.h>
#define G_ZERO_CLASS_NAME "ZERO"
static int g_zero_clear_sysctl(SYSCTL_HANDLER_ARGS);