summaryrefslogtreecommitdiffstats
path: root/sys/geom/label
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-01-18 11:03:20 +0000
committerpjd <pjd@FreeBSD.org>2006-01-18 11:03:20 +0000
commitaae482441a986d2524f45854785b22e997884a7c (patch)
tree1d5901b6eb72a97fbc721f751b9f057f79c45954 /sys/geom/label
parent4f41f4bf9d6fe6cd1d586600a43d988edd5c6def (diff)
downloadFreeBSD-src-aae482441a986d2524f45854785b22e997884a7c.zip
FreeBSD-src-aae482441a986d2524f45854785b22e997884a7c.tar.gz
Style cleanups.
X-MFC-after: Already MFCed to RELENG_6 by accident.
Diffstat (limited to 'sys/geom/label')
-rw-r--r--sys/geom/label/g_label_ntfs.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c
index a5711c9..4781d7d 100644
--- a/sys/geom/label/g_label_ntfs.c
+++ b/sys/geom/label/g_label_ntfs.c
@@ -45,45 +45,44 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size)
{
struct g_provider *pp;
struct bootfile *bf;
- struct attr *atr;
- char *filerecp = NULL, *ap, vnchar;
struct filerec *fr;
- char mftrecsz;
- int recsize;
- int j;
- off_t voloff;
+ struct attr *atr;
+ off_t voloff;
+ char *filerecp, *ap;
+ char mftrecsz, vnchar;
+ int recsize, j;
+
g_topology_assert_not();
- pp = cp->provider;
+
label[0] = '\0';
-
- bf = (struct bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL);
+ pp = cp->provider;
+ filerecp = NULL;
- if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) {
+ bf = (struct bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL);
+ if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0)
goto done;
- }
-
+
mftrecsz = (char)bf->bf_mftrecsz;
recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz);
- if(recsize % pp->sectorsize != 0)
+ if (recsize % pp->sectorsize != 0)
goto done;
-
+
voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps +
- recsize * NTFS_VOLUMEINO;
- if(voloff % pp->sectorsize != 0)
+ recsize * NTFS_VOLUMEINO;
+ if (voloff % pp->sectorsize != 0)
goto done;
filerecp = g_read_data(cp, voloff, recsize, NULL);
if (filerecp == NULL)
goto done;
-
fr = (struct filerec *)filerecp;
- if(fr->fr_fixup.fh_magic != NTFS_FILEMAGIC){
- label[0] = 0;
+ if (fr->fr_fixup.fh_magic != NTFS_FILEMAGIC)
goto done;
- }
- for (ap = filerecp + fr->fr_attroff; atr = (struct attr *)ap, atr->a_hdr.a_type != -1; ap += atr->a_hdr.reclen) {
+ for (ap = filerecp + fr->fr_attroff;
+ atr = (struct attr *)ap, atr->a_hdr.a_type != -1;
+ ap += atr->a_hdr.reclen) {
if (atr->a_hdr.a_type == NTFS_A_VOLUMENAME) {
if(atr->a_r.a_datalen >= size *2){
label[0] = 0;
@@ -95,7 +94,7 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size)
*/
for (j = 0; j < atr->a_r.a_datalen; j++) {
vnchar = *(ap + atr->a_r.a_dataoff + j);
- if ((j & 1)) {
+ if (j & 1) {
if (vnchar) {
label[0] = 0;
goto done;
@@ -113,8 +112,6 @@ done:
g_free(bf);
if (filerecp != NULL)
g_free(filerecp);
- return;
-
}
const struct g_label_desc g_label_ntfs = {
OpenPOWER on IntegriCloud