Lines Matching refs:d
652 struct xbsd_disklabel *d; in xbsd_edit_disklabel() local
654 d = &xbsd_dlabel; in xbsd_edit_disklabel()
657 d->d_secsize = edit_int(d->d_secsize , "bytes/sector"); in xbsd_edit_disklabel()
658 d->d_nsectors = edit_int(d->d_nsectors , "sectors/track"); in xbsd_edit_disklabel()
659 d->d_ntracks = edit_int(d->d_ntracks , "tracks/cylinder"); in xbsd_edit_disklabel()
660 d->d_ncylinders = edit_int(d->d_ncylinders , "cylinders"); in xbsd_edit_disklabel()
665 d->d_secpercyl = edit_int(d->d_nsectors * d->d_ntracks, in xbsd_edit_disklabel()
667 if (d->d_secpercyl <= d->d_nsectors * d->d_ntracks) in xbsd_edit_disklabel()
672 d->d_rpm = edit_int(d->d_rpm , "rpm"); in xbsd_edit_disklabel()
673 d->d_interleave = edit_int(d->d_interleave, "interleave"); in xbsd_edit_disklabel()
674 d->d_trackskew = edit_int(d->d_trackskew , "trackskew"); in xbsd_edit_disklabel()
675 d->d_cylskew = edit_int(d->d_cylskew , "cylinderskew"); in xbsd_edit_disklabel()
676 d->d_headswitch = edit_int(d->d_headswitch, "headswitch"); in xbsd_edit_disklabel()
677 d->d_trkseek = edit_int(d->d_trkseek , "track-to-track seek"); in xbsd_edit_disklabel()
679 d->d_secperunit = d->d_secpercyl * d->d_ncylinders; in xbsd_edit_disklabel()
719 char *d, *p, *e; in xbsd_write_bootstrap() local
737 d = &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE]; in xbsd_write_bootstrap()
738 memmove(&dl, d, sizeof(struct xbsd_disklabel)); in xbsd_write_bootstrap()
741 memset(d, 0, sizeof(struct xbsd_disklabel)); in xbsd_write_bootstrap()
748 e = d + sizeof(struct xbsd_disklabel); in xbsd_write_bootstrap()
749 for (p = d; p < e; p++) in xbsd_write_bootstrap()
755 memmove(d, &dl, sizeof(struct xbsd_disklabel)); in xbsd_write_bootstrap()
853 struct xbsd_disklabel *d = &xbsd_dlabel; in xbsd_initlabel() local
857 memset(d, 0, sizeof(struct xbsd_disklabel)); in xbsd_initlabel()
859 d->d_magic = BSD_DISKMAGIC; in xbsd_initlabel()
862 d->d_type = BSD_DTYPE_SCSI; in xbsd_initlabel()
864 d->d_type = BSD_DTYPE_ST506; in xbsd_initlabel()
867 d->d_flags = BSD_D_DOSPART; in xbsd_initlabel()
869 d->d_flags = 0; in xbsd_initlabel()
871 d->d_secsize = SECTOR_SIZE; /* bytes/sector */ in xbsd_initlabel()
872 d->d_nsectors = g_sectors; /* sectors/track */ in xbsd_initlabel()
873 d->d_ntracks = g_heads; /* tracks/cylinder (heads) */ in xbsd_initlabel()
874 d->d_ncylinders = g_cylinders; in xbsd_initlabel()
875 d->d_secpercyl = g_sectors * g_heads;/* sectors/cylinder */ in xbsd_initlabel()
876 if (d->d_secpercyl == 0) in xbsd_initlabel()
877 d->d_secpercyl = 1; /* avoid segfaults */ in xbsd_initlabel()
878 d->d_secperunit = d->d_secpercyl * d->d_ncylinders; in xbsd_initlabel()
880 d->d_rpm = 3600; in xbsd_initlabel()
881 d->d_interleave = 1; in xbsd_initlabel()
882 d->d_trackskew = 0; in xbsd_initlabel()
883 d->d_cylskew = 0; in xbsd_initlabel()
884 d->d_headswitch = 0; in xbsd_initlabel()
885 d->d_trkseek = 0; in xbsd_initlabel()
887 d->d_magic2 = BSD_DISKMAGIC; in xbsd_initlabel()
888 d->d_bbsize = BSD_BBSIZE; in xbsd_initlabel()
889 d->d_sbsize = BSD_SBSIZE; in xbsd_initlabel()
892 d->d_npartitions = 4; in xbsd_initlabel()
893 pp = &d->d_partitions[2]; /* Partition C should be NetBSD partition */ in xbsd_initlabel()
898 pp = &d->d_partitions[3]; /* Partition D should be whole disk */ in xbsd_initlabel()
901 pp->p_size = d->d_secperunit; in xbsd_initlabel()
904 d->d_npartitions = 3; in xbsd_initlabel()
905 pp = &d->d_partitions[2]; /* Partition C should be the whole disk */ in xbsd_initlabel()
907 pp->p_size = d->d_secperunit; in xbsd_initlabel()
921 struct xbsd_disklabel *d; in xbsd_readlabel() local
927 d = &xbsd_dlabel; in xbsd_readlabel()
940 memmove(d, &disklabelbuffer[BSD_LABELSECTOR * SECTOR_SIZE + BSD_LABELOFFSET], in xbsd_readlabel()
943 if (d->d_magic != BSD_DISKMAGIC || d->d_magic2 != BSD_DISKMAGIC) in xbsd_readlabel()
946 for (t = d->d_npartitions; t < BSD_MAXPARTITIONS; t++) { in xbsd_readlabel()
947 d->d_partitions[t].p_size = 0; in xbsd_readlabel()
948 d->d_partitions[t].p_offset = 0; in xbsd_readlabel()
949 d->d_partitions[t].p_fstype = BSD_FS_UNUSED; in xbsd_readlabel()
952 if (d->d_npartitions > BSD_MAXPARTITIONS) in xbsd_readlabel()
954 d->d_npartitions, BSD_MAXPARTITIONS); in xbsd_readlabel()
961 struct xbsd_disklabel *d = &xbsd_dlabel; in xbsd_writelabel() local
971 d->d_checksum = 0; in xbsd_writelabel()
972 d->d_checksum = xbsd_dkcksum(d); in xbsd_writelabel()
978 d, sizeof(struct xbsd_disklabel)); in xbsd_writelabel()
987 xwrite(dev_fd, d, sizeof(*d)); in xbsd_writelabel()