Index: sys/sys/mdioctl.h =================================================================== RCS file: /private/FreeBSD/src/sys/sys/mdioctl.h,v retrieving revision 1.16 diff -u -p -r1.16 mdioctl.h --- sys/sys/mdioctl.h 9 Aug 2004 06:45:20 -0000 1.16 +++ sys/sys/mdioctl.h 14 Sep 2004 18:16:41 -0000 @@ -55,10 +55,10 @@ struct md_ioctl { unsigned md_unit; /* unit number */ enum md_types md_type ; /* type of disk */ char *md_file; /* pathname of file to mount */ - unsigned md_size; /* size of disk in DEV_BSIZE units */ + off_t md_mediasize; /* size of disk in bytes */ + unsigned md_sectorsize; /* sectorsize */ unsigned md_options; /* options */ u_int64_t md_base; /* base address */ - int md_secsize; /* sectorsize */ int md_fwheads; /* firmware heads */ int md_fwsectors; /* firmware sectors */ int md_pad[MDNPAD]; /* padding for future ideas */ Index: sys/dev/md/md.c =================================================================== RCS file: /private/FreeBSD/src/sys/dev/md/md.c,v retrieving revision 1.134 diff -u -p -r1.134 md.c --- sys/dev/md/md.c 14 Sep 2004 19:55:07 -0000 1.134 +++ sys/dev/md/md.c 14 Sep 2004 20:19:07 -0000 @@ -153,9 +153,9 @@ struct md_s { struct mtx queue_mtx; struct cdev *dev; enum md_types type; - unsigned nsect; + off_t mediasize; + unsigned sectorsize; unsigned opencount; - unsigned secsize; unsigned fwheads; unsigned fwsectors; unsigned flags; @@ -170,7 +170,7 @@ struct md_s { /* MD_PRELOAD related fields */ u_char *pl_ptr; - unsigned pl_len; + size_t pl_len; /* MD_VNODE related fields */ struct vnode *vnode; @@ -178,7 +178,6 @@ struct md_s { /* MD_SWAP related fields */ vm_object_t object; - unsigned npage; }; static int mddestroy(struct md_s *sc, struct thread *td); @@ -374,14 +373,10 @@ g_md_start(struct bio *bp) struct md_s *sc; sc = bp->bio_to->geom->softc; - - bp->bio_pblkno = bp->bio_offset / sc->secsize; - bp->bio_bcount = bp->bio_length; mtx_lock(&sc->queue_mtx); bioq_disksort(&sc->bio_queue, bp); - mtx_unlock(&sc->queue_mtx); - wakeup(sc); + mtx_unlock(&sc->queue_mtx); } @@ -391,11 +386,11 @@ mdstart_malloc(struct md_s *sc, struct b { int i, error; u_char *dst; - unsigned secno, nsec, uc; + off_t secno, nsec, uc; uintptr_t sp, osp; - nsec = bp->bio_bcount / sc->secsize; - secno = bp->bio_pblkno; + nsec = bp->bio_length / sc->sectorsize; + secno = bp->bio_offset / sc->sectorsize; dst = bp->bio_data; error = 0; while (nsec--) { @@ -405,38 +400,38 @@ mdstart_malloc(struct md_s *sc, struct b error = s_write(sc->indir, secno, 0); } else if (bp->bio_cmd == BIO_READ) { if (osp == 0) - bzero(dst, sc->secsize); + bzero(dst, sc->sectorsize); else if (osp <= 255) - for (i = 0; i < sc->secsize; i++) + for (i = 0; i < sc->sectorsize; i++) dst[i] = osp; else - bcopy((void *)osp, dst, sc->secsize); + bcopy((void *)osp, dst, sc->sectorsize); osp = 0; } else if (bp->bio_cmd == BIO_WRITE) { if (sc->flags & MD_COMPRESS) { uc = dst[0]; - for (i = 1; i < sc->secsize; i++) + for (i = 1; i < sc->sectorsize; i++) if (dst[i] != uc) break; } else { i = 0; uc = 0; } - if (i == sc->secsize) { + if (i == sc->sectorsize) { if (osp != uc) error = s_write(sc->indir, secno, uc); } else { if (osp <= 255) { - sp = (uintptr_t) uma_zalloc( - sc->uma, M_NOWAIT); + sp = (uintptr_t)uma_zalloc(sc->uma, + M_NOWAIT); if (sp == 0) { error = ENOSPC; break; } - bcopy(dst, (void *)sp, sc->secsize); + bcopy(dst, (void *)sp, sc->sectorsize); error = s_write(sc->indir, secno, sp); } else { - bcopy(dst, (void *)osp, sc->secsize); + bcopy(dst, (void *)osp, sc->sectorsize); osp = 0; } } @@ -448,7 +443,7 @@ mdstart_malloc(struct md_s *sc, struct b if (error) break; secno++; - dst += sc->secsize; + dst += sc->sectorsize; } bp->bio_resid = 0; return (error); @@ -458,11 +453,13 @@ static int mdstart_preload(struct md_s *sc, struct bio *bp) { - if (bp->bio_cmd == BIO_DELETE) { - } else if (bp->bio_cmd == BIO_READ) { - bcopy(sc->pl_ptr + (bp->bio_pblkno << DEV_BSHIFT), bp->bio_data, bp->bio_bcount); - } else { - bcopy(bp->bio_data, sc->pl_ptr + (bp->bio_pblkno << DEV_BSHIFT), bp->bio_bcount); + switch (bp->bio_cmd) { + case BIO_READ: + bcopy(sc->pl_ptr + bp->bio_offset, bp->bio_data, bp->bio_length); + break; + case BIO_WRITE: + bcopy(bp->bio_data, sc->pl_ptr + bp->bio_offset, bp->bio_length); + break; } bp->bio_resid = 0; return (0); @@ -487,10 +484,10 @@ mdstart_vnode(struct md_s *sc, struct bi bzero(&auio, sizeof(auio)); aiov.iov_base = bp->bio_data; - aiov.iov_len = bp->bio_bcount; + aiov.iov_len = bp->bio_length; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; - auio.uio_offset = (vm_ooffset_t)bp->bio_pblkno * sc->secsize; + auio.uio_offset = (vm_ooffset_t)bp->bio_offset; auio.uio_segflg = UIO_SYSSPACE; if(bp->bio_cmd == BIO_READ) auio.uio_rw = UIO_READ; @@ -498,7 +495,7 @@ mdstart_vnode(struct md_s *sc, struct bi auio.uio_rw = UIO_WRITE; else panic("wrong BIO_OP in mdstart_vnode"); - auio.uio_resid = bp->bio_bcount; + auio.uio_resid = bp->bio_length; auio.uio_td = curthread; /* * When reading set IO_DIRECT to try to avoid double-caching @@ -619,7 +616,9 @@ md_kthread(void *arg) for (;;) { mtx_lock(&sc->queue_mtx); - bp = bioq_takefirst(&sc->bio_queue); + bp = bioq_first(&sc->bio_queue); + if (bp) + bioq_remove(&sc->bio_queue, bp); if (!bp) { if (sc->flags & MD_SHUTDOWN) { mtx_unlock(&sc->queue_mtx); @@ -727,14 +726,13 @@ mdinit(struct md_s *sc) gp = g_new_geomf(&g_md_class, "md%d", sc->unit); gp->softc = sc; pp = g_new_providerf(gp, "md%d", sc->unit); - pp->mediasize = (off_t)sc->nsect * sc->secsize; - pp->sectorsize = sc->secsize; + pp->mediasize = sc->mediasize; + pp->sectorsize = sc->sectorsize; sc->gp = gp; sc->pp = pp; g_error_provider(pp, 0); g_topology_unlock(); - if (sc->type != MD_PRELOAD) - g_waitidle(); + g_waitidle(); PICKUP_GIANT(); } @@ -744,98 +742,63 @@ mdinit(struct md_s *sc) */ static int -mdcreate_preload(struct md_ioctl *mdio) +mdcreate_preload(struct md_s *sc, struct md_ioctl *mdio) { - struct md_s *sc; - if (mdio->md_size == 0) - return (EINVAL); - if (mdio->md_options & ~(MD_AUTOUNIT)) + if (mdio->md_options & ~(MD_AUTOUNIT | MD_FORCE)) return (EINVAL); - if (mdio->md_options & MD_AUTOUNIT) { - sc = mdnew(-1); - if (sc == NULL) - return (ENOMEM); - mdio->md_unit = sc->unit; - } else { - sc = mdnew(mdio->md_unit); - if (sc == NULL) - return (EBUSY); - } sc->type = MD_PRELOAD; - sc->secsize = DEV_BSIZE; - sc->nsect = mdio->md_size; sc->flags = mdio->md_options & MD_FORCE; /* Cast to pointer size, then to pointer to avoid warning */ sc->pl_ptr = (u_char *)(uintptr_t)mdio->md_base; - sc->pl_len = (mdio->md_size << DEV_BSHIFT); - mdinit(sc); + sc->pl_len = (size_t)sc->mediasize; return (0); } static int -mdcreate_malloc(struct md_ioctl *mdio) +mdcreate_malloc(struct md_s *sc, struct md_ioctl *mdio) { - struct md_s *sc; - off_t u; uintptr_t sp; int error; + off_t u; error = 0; - if (mdio->md_size == 0) - return (EINVAL); if (mdio->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE)) return (EINVAL); - if (mdio->md_secsize != 0 && !powerof2(mdio->md_secsize)) + if (mdio->md_sectorsize != 0 && !powerof2(mdio->md_sectorsize)) return (EINVAL); /* Compression doesn't make sense if we have reserved space */ if (mdio->md_options & MD_RESERVE) mdio->md_options &= ~MD_COMPRESS; - if (mdio->md_options & MD_AUTOUNIT) { - sc = mdnew(-1); - if (sc == NULL) - return (ENOMEM); - mdio->md_unit = sc->unit; - } else { - sc = mdnew(mdio->md_unit); - if (sc == NULL) - return (EBUSY); - } sc->type = MD_MALLOC; - if (mdio->md_secsize != 0) - sc->secsize = mdio->md_secsize; - else - sc->secsize = DEV_BSIZE; + if (sc->sectorsize == 0) + sc->sectorsize = DEV_BSIZE; if (mdio->md_fwsectors != 0) sc->fwsectors = mdio->md_fwsectors; if (mdio->md_fwheads != 0) sc->fwheads = mdio->md_fwheads; - sc->nsect = (mdio->md_size * DEV_BSIZE) / sc->secsize; sc->flags = mdio->md_options & (MD_COMPRESS | MD_FORCE); - sc->indir = dimension(sc->nsect); - sc->uma = uma_zcreate(sc->name, sc->secsize, - NULL, NULL, NULL, NULL, 0x1ff, 0); + sc->indir = dimension(sc->mediasize / sc->sectorsize); + sc->uma = uma_zcreate(sc->name, sc->sectorsize, NULL, NULL, NULL, NULL, + 0x1ff, 0); if (mdio->md_options & MD_RESERVE) { - for (u = 0; u < sc->nsect; u++) { - sp = (uintptr_t) uma_zalloc(sc->uma, M_NOWAIT | M_ZERO); + off_t nsectors; + + nsectors = sc->mediasize / sc->sectorsize; + for (u = 0; u < nsectors; u++) { + sp = (uintptr_t)uma_zalloc(sc->uma, M_NOWAIT | M_ZERO); if (sp != 0) error = s_write(sc->indir, u, sp); else error = ENOMEM; - if (error) + if (error != 0) break; } } - if (error) { + if (error != 0) uma_zdestroy(sc->uma); - mddestroy(sc, NULL); - return (error); - } - mdinit(sc); - if (!(mdio->md_options & MD_RESERVE)) - sc->pp->flags |= G_PF_CANDELETE; - return (0); + return (error); } @@ -861,11 +824,11 @@ mdsetcred(struct md_s *sc, struct ucred struct uio auio; struct iovec aiov; - tmpbuf = malloc(sc->secsize, M_TEMP, M_WAITOK); + tmpbuf = malloc(sc->sectorsize, M_TEMP, M_WAITOK); bzero(&auio, sizeof(auio)); aiov.iov_base = tmpbuf; - aiov.iov_len = sc->secsize; + aiov.iov_len = sc->sectorsize; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = 0; @@ -881,9 +844,8 @@ mdsetcred(struct md_s *sc, struct ucred } static int -mdcreate_vnode(struct md_ioctl *mdio, struct thread *td) +mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) { - struct md_s *sc; struct vattr vattr; struct nameidata nd; int error, flags; @@ -905,22 +867,11 @@ mdcreate_vnode(struct md_ioctl *mdio, st if (nd.ni_vp->v_type != VREG || (error = VOP_GETATTR(nd.ni_vp, &vattr, td->td_ucred, td))) { VOP_UNLOCK(nd.ni_vp, 0, td); - (void) vn_close(nd.ni_vp, flags, td->td_ucred, td); + (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); return (error ? error : EINVAL); } VOP_UNLOCK(nd.ni_vp, 0, td); - if (mdio->md_options & MD_AUTOUNIT) { - sc = mdnew(-1); - mdio->md_unit = sc->unit; - } else { - sc = mdnew(mdio->md_unit); - } - if (sc == NULL) { - (void) vn_close(nd.ni_vp, flags, td->td_ucred, td); - return (EBUSY); - } - if (mdio->md_fwsectors != 0) sc->fwsectors = mdio->md_fwsectors; if (mdio->md_fwheads != 0) @@ -929,28 +880,14 @@ mdcreate_vnode(struct md_ioctl *mdio, st sc->flags = mdio->md_options & (MD_FORCE | MD_ASYNC); if (!(flags & FWRITE)) sc->flags |= MD_READONLY; - sc->secsize = DEV_BSIZE; + sc->sectorsize = mdio->md_sectorsize; sc->vnode = nd.ni_vp; - /* - * If the size is specified, override the file attributes. - */ - if (mdio->md_size) - sc->nsect = mdio->md_size; - else - sc->nsect = vattr.va_size / sc->secsize; /* XXX: round up ? */ - if (sc->nsect == 0) { - (void) vn_close(nd.ni_vp, flags, td->td_ucred, td); - mddestroy(sc, td); - return (EINVAL); - } error = mdsetcred(sc, td->td_ucred); - if (error) { - (void) vn_close(nd.ni_vp, flags, td->td_ucred, td); - mddestroy(sc, td); + if (error != 0) { + (void)vn_close(nd.ni_vp, flags, td->td_ucred, td); return (error); } - mdinit(sc); return (0); } @@ -1000,58 +937,39 @@ mddestroy(struct md_s *sc, struct thread } static int -mdcreate_swap(struct md_ioctl *mdio, struct thread *td) +mdcreate_swap(struct md_s *sc, struct md_ioctl *mdio, struct thread *td) { + off_t npage; int error; - struct md_s *sc; GIANT_REQUIRED; - if (mdio->md_options & MD_AUTOUNIT) { - sc = mdnew(-1); - mdio->md_unit = sc->unit; - } else { - sc = mdnew(mdio->md_unit); - } - if (sc == NULL) - return (EBUSY); - sc->type = MD_SWAP; - /* * Range check. Disallow negative sizes or any size less then the * size of a page. Then round to a page. */ - - if (mdio->md_size == 0) { - mddestroy(sc, td); + if (sc->mediasize == 0 || (sc->mediasize % PAGE_SIZE) != 0) return (EDOM); - } /* * Allocate an OBJT_SWAP object. * - * sc_nsect is in units of DEV_BSIZE. - * sc_npage is in units of PAGE_SIZE. - * * Note the truncation. */ - sc->secsize = DEV_BSIZE; - sc->npage = mdio->md_size / (PAGE_SIZE / DEV_BSIZE); - sc->nsect = sc->npage * (PAGE_SIZE / DEV_BSIZE); + npage = mdio->md_mediasize / PAGE_SIZE; if (mdio->md_fwsectors != 0) sc->fwsectors = mdio->md_fwsectors; if (mdio->md_fwheads != 0) sc->fwheads = mdio->md_fwheads; - sc->object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * - (vm_offset_t)sc->npage, VM_PROT_DEFAULT, 0); + sc->object = vm_pager_allocate(OBJT_SWAP, NULL, + PAGE_SIZE * (vm_offset_t)npage, VM_PROT_DEFAULT, 0); sc->flags = mdio->md_options & MD_FORCE; if (mdio->md_options & MD_RESERVE) { - if (swap_pager_reserve(sc->object, 0, sc->npage) < 0) { + if (swap_pager_reserve(sc->object, 0, npage) < 0) { vm_object_deallocate(sc->object); sc->object = NULL; - mddestroy(sc, td); return (EDOM); } } @@ -1059,13 +977,8 @@ mdcreate_swap(struct md_ioctl *mdio, str if (error) { vm_object_deallocate(sc->object); sc->object = NULL; - mddestroy(sc, td); - return (error); } - mdinit(sc); - if (!(mdio->md_options & MD_RESERVE)) - sc->pp->flags |= G_PF_CANDELETE; - return (0); + return (error); } static int @@ -1094,7 +1007,7 @@ mdctlioctl(struct cdev *dev, u_long cmd, { struct md_ioctl *mdio; struct md_s *sc; - int i; + int error, i; if (md_debug) printf("mdctlioctl(%s %lx %p %x %p)\n", @@ -1112,22 +1025,42 @@ mdctlioctl(struct cdev *dev, u_long cmd, case MDIOCATTACH: if (mdio->md_version != MDIOVERSION) return (EINVAL); + if (mdio->md_options & MD_AUTOUNIT) { + sc = mdnew(-1); + mdio->md_unit = sc->unit; + } else { + sc = mdnew(mdio->md_unit); + } + if (sc == NULL) + return (EBUSY); + sc->mediasize = mdio->md_mediasize; + sc->sectorsize = mdio->md_sectorsize; switch (mdio->md_type) { case MD_MALLOC: - return (mdcreate_malloc(mdio)); + error = mdcreate_malloc(sc, mdio); + break; case MD_PRELOAD: - return (mdcreate_preload(mdio)); + error = mdcreate_preload(sc, mdio); + break; case MD_VNODE: - return (mdcreate_vnode(mdio, td)); + error = mdcreate_vnode(sc, mdio, td); + break; case MD_SWAP: - return (mdcreate_swap(mdio, td)); + error = mdcreate_swap(sc, mdio, td); + break; default: - return (EINVAL); + error = EINVAL; + } + if (error != 0) { + mddestroy(sc, td); + return (error); } + mdinit(sc); + return (0); case MDIOCDETACH: if (mdio->md_version != MDIOVERSION) return (EINVAL); - if (mdio->md_file != NULL || mdio->md_size != 0 || + if (mdio->md_file != NULL || mdio->md_mediasize != 0 || mdio->md_options != 0) return (EINVAL); return (mddetach(mdio->md_unit, td)); @@ -1139,22 +1072,11 @@ mdctlioctl(struct cdev *dev, u_long cmd, return (ENOENT); mdio->md_type = sc->type; mdio->md_options = sc->flags; - switch (sc->type) { - case MD_MALLOC: - mdio->md_size = sc->nsect; - break; - case MD_PRELOAD: - mdio->md_size = sc->nsect; - mdio->md_base = (uint64_t)(intptr_t)sc->pl_ptr; - break; - case MD_SWAP: - mdio->md_size = sc->nsect; - break; - case MD_VNODE: - mdio->md_size = sc->nsect; + mdio->md_mediasize = sc->mediasize; + mdio->md_sectorsize = sc->sectorsize; + if (sc->type == MD_VNODE) { /* XXX fill this in */ mdio->md_file = NULL; - break; } return (0); case MDIOCLIST: @@ -1174,7 +1096,7 @@ mdctlioctl(struct cdev *dev, u_long cmd, } static void -md_preloaded(u_char *image, unsigned length) +md_preloaded(u_char *image, size_t length) { struct md_s *sc; @@ -1182,8 +1104,8 @@ md_preloaded(u_char *image, unsigned len if (sc == NULL) return; sc->type = MD_PRELOAD; - sc->secsize = DEV_BSIZE; - sc->nsect = length / DEV_BSIZE; + sc->mediasize = length; + sc->sectorsize = DEV_BSIZE; sc->pl_ptr = image; sc->pl_len = length; #ifdef MD_ROOT Index: sbin/mdconfig/mdconfig.c =================================================================== RCS file: /private/FreeBSD/src/sbin/mdconfig/mdconfig.c,v retrieving revision 1.33 diff -u -p -r1.33 mdconfig.c --- sbin/mdconfig/mdconfig.c 9 Aug 2004 06:45:20 -0000 1.33 +++ sbin/mdconfig/mdconfig.c 14 Sep 2004 20:00:00 -0000 @@ -14,13 +14,16 @@ #include #include #include +#include #include #include + #include #include #include #include #include +#include #include #include @@ -55,6 +58,7 @@ main(int argc, char **argv) char *p; int cmdline = 0; + bzero(&mdio, sizeof(mdio)); for (;;) { ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:x:y:"); if (ch == -1) @@ -116,6 +120,13 @@ main(int argc, char **argv) fd = open(optarg, O_RDONLY); if (fd < 0) err(1, "could not open %s", optarg); + else if (mdio.md_mediasize == 0) { + struct stat sb; + + if (fstat(fd, &sb) == -1) + err(1, "could not stat %s", optarg); + mdio.md_mediasize = sb.st_size; + } close(fd); break; case 'o': @@ -147,21 +158,24 @@ main(int argc, char **argv) case 'S': if (cmdline != 2) usage(); - mdio.md_secsize = strtoul(optarg, &p, 0); + mdio.md_sectorsize = strtoul(optarg, &p, 0); break; case 's': if (cmdline != 2) usage(); - mdio.md_size = strtoul(optarg, &p, 0); + mdio.md_mediasize = (off_t)strtoumax(optarg, &p, 0); if (p == NULL || *p == '\0') - ; + mdio.md_mediasize *= DEV_BSIZE; else if (*p == 'k' || *p == 'K') - mdio.md_size *= (1024 / DEV_BSIZE); + mdio.md_mediasize <<= 10; else if (*p == 'm' || *p == 'M') - mdio.md_size *= (1024 * 1024 / DEV_BSIZE); + mdio.md_mediasize <<= 20; else if (*p == 'g' || *p == 'G') - mdio.md_size *= (1024 * 1024 * 1024 / DEV_BSIZE); - else + mdio.md_mediasize <<= 30; + else if (*p == 't' || *p == 'T') { + mdio.md_mediasize <<= 30; + mdio.md_mediasize <<= 10; + } else errx(1, "Unknown suffix on -s argument"); break; case 'u': @@ -198,7 +212,7 @@ main(int argc, char **argv) err(1, "open(/dev/%s)", MDCTL_NAME); if (cmdline == 2 && (mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP)) - if (mdio.md_size == 0) + if (mdio.md_mediasize == 0) errx(1, "must specify -s for -t malloc or -t swap"); if (cmdline == 2 && mdio.md_type == MD_VNODE) if (mdio.md_file == NULL) @@ -264,20 +278,20 @@ query(const int fd, const int unit) switch (mdio.md_type) { case MD_MALLOC: - (void)printf("%s%d\tmalloc\t%d KBytes\n", MD_NAME, - mdio.md_unit, mdio.md_size / 2); + (void)printf("%s%d\tmalloc\t%jd KBytes\n", MD_NAME, + mdio.md_unit, (intmax_t)(mdio.md_mediasize / 1024)); break; case MD_PRELOAD: - (void)printf("%s%d\tpreload\t%d KBytes\n", MD_NAME, - mdio.md_unit, mdio.md_size / 2); + (void)printf("%s%d\tpreload\t%jd KBytes\n", MD_NAME, + mdio.md_unit, (intmax_t)(mdio.md_mediasize / 1024)); break; case MD_SWAP: - (void)printf("%s%d\tswap\t%d KBytes\n", MD_NAME, - mdio.md_unit, mdio.md_size / 2); + (void)printf("%s%d\tswap\t%jd KBytes\n", MD_NAME, + mdio.md_unit, (intmax_t)(mdio.md_mediasize / 1024)); break; case MD_VNODE: - (void)printf("%s%d\tvnode\t%d KBytes\n", MD_NAME, - mdio.md_unit, mdio.md_size / 2); + (void)printf("%s%d\tvnode\t%jd KBytes\n", MD_NAME, + mdio.md_unit, (intmax_t)(mdio.md_mediasize / 1024)); break; }