|
ru.unix.bsd- RU.UNIX.BSD ------------------------------------------------------------------ From : Eugene Grosbein 2:5006/1 17 Apr 2007 23:05:44 To : Alex Bakhtin Subject : Re: копирование -------------------------------------------------------------------------------- 17 апр 2007, вторник, в 18:18 KRAST, Alex Bakhtin написал(а): EG>> Кажися flock тут не причем (он постоянно в процессе пытается EG>> stderr залочить зачем-то). dd if=source bs=8m of=/dev/null точно EG>> так же прочитывает только 1032667136 байт из 13917569024 и выходит, EG>> а разница между этими циферками ровнехонько 12*1024*1024*1024. EG>> Кажися бага в поддержке ntfs. AB> Ты эта, что делаешь-то? С NTFSа файлы больше 4G не копируюца, если я AB> правильно помню... В current вроде починили. Hу блин, в ноябре починили, до сих пор MFC нету. Вот, сделал (протестировано): - --- ntfs_subr.h.orig Tue Apr 17 23:57:24 2007 +++ ntfs_subr.h Tue Apr 17 23:58:01 2007 @@ -45,8 +45,8 @@ u_int32_t va_compression; u_int32_t va_compressalg; - u_int32_t va_datalen; - u_int32_t va_allocated; + u_int64_t va_datalen; + u_int64_t va_allocated; cn_t va_vcnstart; cn_t va_vcnend; u_int16_t va_index; - --- ntfs_subr.c.orig Tue Apr 17 23:57:24 2007 +++ ntfs_subr.c Tue Apr 17 23:59:17 2007 @@ -584,7 +584,7 @@ memcpy(vap->va_datap, (caddr_t) rap + rap->a_r.a_dataoff, rap->a_r.a_datalen); } - ddprintf((", len: %d", vap->va_datalen)); + ddprintf((", len: %lld", vap->va_datalen)); if (error) FREE(vap, M_NTFSNTVATTR); @@ -889,7 +889,7 @@ cn_t cn; /* VCN in current attribute */ caddr_t rdbuf; /* Buffer to read directory's blocks */ u_int32_t blsize; - u_int32_t rdsize; /* Length of data to read from current block */ + u_int64_t rdsize; /* Length of data to read from current block */ struct attr_indexentry *iep; int error, res, anamelen, fnamelen; const char *fname,*aname; @@ -927,7 +927,7 @@ break; } - dprintf(("ntfs_ntlookupfile: blksz: %d, rdsz: %d\n", blsize, rdsize)); + dprintf(("ntfs_ntlookupfile: blksz: %d, rdsz: %jd\n", blsize, rdsize)); MALLOC(rdbuf, caddr_t, blsize, M_TEMP, M_WAITOK); @@ -1175,7 +1175,7 @@ goto fail; } cpbl = ntfs_btocn(blsize + ntfs_cntob(1) - 1); - dprintf(("ntfs_ntreaddir: indexalloc: %d, cpbl: %d\n", + dprintf(("ntfs_ntreaddir: indexalloc: %jd, cpbl: %d\n", iavap->va_datalen, cpbl)); } else { dprintf(("ntfs_ntreadidir: w/o BitMap and IndexAllocation\n")); @@ -1388,7 +1388,7 @@ ntfs_btocn(off), &vap); if (error) return (error); - towrite = min(left, ntfs_cntob(vap->va_vcnend + 1) - off); + towrite = MIN(left, ntfs_cntob(vap->va_vcnend + 1) - off); ddprintf(("ntfs_writeattr_plain: o: %d, s: %d (%d - %d)\n", (u_int32_t) off, (u_int32_t) towrite, (u_int32_t) vap->va_vcnstart, @@ -1433,7 +1433,7 @@ struct uio *uio) { int error = 0; - int off; + off_t off; int cnt; cn_t ccn, ccl, cn, left, cl; caddr_t data = rdata; @@ -1483,7 +1483,7 @@ * blocks at the same disk offsets to avoid * confusing the buffer cache. */ - tocopy = min(left, ntfs_cntob(1) - off); + tocopy = MIN(left, ntfs_cntob(1) - off); cl = ntfs_btocl(tocopy + off); KASSERT(cl == 1 && tocopy <= ntfs_cntob(1), ("single cluster limit mistake")); @@ -1544,7 +1544,7 @@ struct uio *uio) { int error = 0; - int off; + off_t off; *initp = 0; if (vap->va_flag & NTFS_AF_INRUN) { @@ -1589,7 +1589,7 @@ * same disk offsets to avoid * confusing the buffer cache. */ - tocopy = min(left, + tocopy = MIN(left, ntfs_cntob(1) - off); cl = ntfs_btocl(tocopy + off); KASSERT(cl == 1 && @@ -1628,7 +1628,7 @@ ccl -= cl; } } else { - tocopy = min(left, ntfs_cntob(ccl) - off); + tocopy = MIN(left, ntfs_cntob(ccl) - off); ddprintf(("ntfs_readntvattr_plain: " "hole: ccn: 0x%x ccl: %d, off: %d, " \ " len: %d, left: %d\n", @@ -1690,7 +1690,7 @@ ntfs_btocn(off), &vap); if (error) return (error); - toread = min(left, ntfs_cntob(vap->va_vcnend + 1) - off); + toread = MIN(left, ntfs_cntob(vap->va_vcnend + 1) - off); ddprintf(("ntfs_readattr_plain: o: %d, s: %d (%d - %d)\n", (u_int32_t) off, (u_int32_t) toread, (u_int32_t) vap->va_vcnstart, @@ -1775,7 +1775,7 @@ if (error) break; - tocopy = min(left, ntfs_cntob(NTFS_COMPUNIT_CL) - off); + tocopy = MIN(left, ntfs_cntob(NTFS_COMPUNIT_CL) - off); if (init == ntfs_cntob(NTFS_COMPUNIT_CL)) { if (uio) - --- ntfs_vnops.c.orig Tue Apr 17 23:57:24 2007 +++ ntfs_vnops.c Tue Apr 17 23:58:01 2007 @@ -138,7 +138,7 @@ if (uio->uio_offset > fp->f_size) return (0); - resid = min(uio->uio_resid, fp->f_size - uio->uio_offset); + resid = MIN(uio->uio_resid, fp->f_size - uio->uio_offset); dprintf((", resid: %d\n", resid)); @@ -147,7 +147,7 @@ cn = ntfs_btocn(uio->uio_offset); off = ntfs_btocnoff(uio->uio_offset); - toread = min(off + resid, ntfs_cntob(1)); + toread = MIN(off + resid, ntfs_cntob(1)); error = bread(vp, cn, ntfs_cntob(1), NOCRED, &bp); if (error) { @@ -285,7 +285,7 @@ (u_int32_t)bp->b_offset,(u_int32_t)bp->b_blkno, (u_int32_t)bp->b_lblkno)); - dprintf(("strategy: bcount: %d flags: 0x%lx\n", + dprintf(("strategy: bcount: %d flags: 0x%x\n", (u_int32_t)bp->b_bcount,bp->b_flags)); if (bp->b_iocmd == BIO_READ) { @@ -295,7 +295,7 @@ clrbuf(bp); error = 0; } else { - toread = min(bp->b_bcount, + toread = MIN(bp->b_bcount, fp->f_size-ntfs_cntob(bp->b_blkno)); dprintf(("ntfs_strategy: toread: %d, fsize: %d\n", toread,(u_int32_t)fp->f_size)); @@ -321,7 +321,7 @@ bp->b_error = error = EFBIG; bp->b_ioflags |= BIO_ERROR; } else { - towrite = min(bp->b_bcount, + towrite = MIN(bp->b_bcount, fp->f_size-ntfs_cntob(bp->b_blkno)); dprintf(("ntfs_strategy: towrite: %d, fsize: %d\n", towrite,(u_int32_t)fp->f_size)); @@ -367,7 +367,7 @@ return (EFBIG); } - towrite = min(uio->uio_resid, fp->f_size - uio->uio_offset); + towrite = MIN(uio->uio_resid, fp->f_size - uio->uio_offset); dprintf((", towrite: %d\n",(u_int32_t)towrite)); Eugene -- A totz cels de la vila, car en Symos moric, Venc aitals aventura que l'escurs esclarzic. Гильем из Туделы (Коровьев-Фагот) --- slrn/0.9.8.0 (FreeBSD) * Origin: Svyaz Service JSC (2:5006/1@fidonet) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.unix.bsd/2609383b2ef33.html, оценка из 5, голосов 10
|