diff options
author | phk <phk@FreeBSD.org> | 2002-10-20 19:18:07 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-20 19:18:07 +0000 |
commit | 5df21f9258160fffb5804123fe9aaa50bad6be01 (patch) | |
tree | e5862f7e08664b410047651c04c18a85f96a64f8 /sys/geom/geom_slice.c | |
parent | 6539d532098bbfd2bef664a338eed9447e734f60 (diff) | |
download | FreeBSD-src-5df21f9258160fffb5804123fe9aaa50bad6be01.zip FreeBSD-src-5df21f9258160fffb5804123fe9aaa50bad6be01.tar.gz |
Make the sectorsize a property of providers so we can include it in the XML
output.
Sponsored by: DARPA & NAI Labs
Diffstat (limited to 'sys/geom/geom_slice.c')
-rw-r--r-- | sys/geom/geom_slice.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 2cfc998..64745bf 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -118,7 +118,6 @@ g_slice_access(struct g_provider *pp, int dr, int dw, int de) if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1) de--; error = g_access_rel(cp, dr, dw, de); - pp->mediasize = gsp->slices[pp->index].length; return (error); } @@ -228,7 +227,7 @@ g_slice_dumpconf(struct sbuf *sb, char *indent, struct g_geom *gp, struct g_cons } int -g_slice_config(struct g_geom *gp, int index, int how, off_t offset, off_t length, char *fmt, ...) +g_slice_config(struct g_geom *gp, int index, int how, off_t offset, off_t length, u_int sectorsize, char *fmt, ...) { struct g_provider *pp; struct g_slicer *gsp; @@ -261,6 +260,7 @@ g_slice_config(struct g_geom *gp, int index, int how, off_t offset, off_t length return (0); gsl->length = length; gsl->offset = offset; + gsl->sectorsize = sectorsize; if (length != 0 && pp != NULL) return (0); if (length == 0 && pp == NULL) @@ -277,6 +277,8 @@ g_slice_config(struct g_geom *gp, int index, int how, off_t offset, off_t length sbuf_finish(sb); pp = g_new_providerf(gp, sbuf_data(sb)); pp->index = index; + pp->mediasize = gsl->length; + pp->sectorsize = gsl->sectorsize; gsl->provider = pp; gsp->nprovider++; g_error_provider(pp, 0); @@ -285,7 +287,7 @@ g_slice_config(struct g_geom *gp, int index, int how, off_t offset, off_t length } struct g_provider * -g_slice_addslice(struct g_geom *gp, int index, off_t offset, off_t length, char *fmt, ...) +g_slice_addslice(struct g_geom *gp, int index, off_t offset, off_t length, u_int sectorsize, char *fmt, ...) { struct g_provider *pp; struct g_slicer *gsp; @@ -305,6 +307,9 @@ g_slice_addslice(struct g_geom *gp, int index, off_t offset, off_t length, char gsp->slices[index].length = length; gsp->slices[index].offset = offset; gsp->slices[index].provider = pp; + gsp->slices[index].sectorsize = sectorsize; + pp->mediasize = gsp->slices[index].length; + pp->sectorsize = gsp->slices[index].sectorsize; sbuf_delete(sb); return(pp); } |