FreeBSD Bugzilla – Attachment 104643 Details for
Bug 144852
[patch] sysutils/ntfsprogs - improvements to mkntfs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch-libntfs-unix_io_2.c
patch-libntfs-unix_io_2.c (text/x-csrc; charset=US-ASCII), 1.56 KB, created by
Samuel Martín Moro
on 2010-03-23 16:27:00 UTC
(
hide
)
Description:
patch-libntfs-unix_io_2.c
Filename:
MIME Type:
Creator:
Samuel Martín Moro
Created:
2010-03-23 16:27:00 UTC
Size:
1.56 KB
patch
obsolete
>--- libntfs/unix_io.c.orig 2010-03-23 16:24:36.000000000 +0100 >+++ libntfs/unix_io.c 2010-03-23 16:24:06.000000000 +0100 >@@ -183,6 +183,7 @@ > #if USE_UBLIO > struct ublio_param up; > int use_ublio = 0; >+ u_int secpt = 0, medsz; > char *xenv, *xgarbage; > #endif > >@@ -220,7 +221,35 @@ > if ((xenv = getenv("UBLIO_BLOCKSIZE"))) > up.up_blocksize = strtoul(xenv, &xgarbage, 10); > if (!xenv || *xgarbage != '\0') >- up.up_blocksize = UBLIO_DEFAULT_BLOCKSIZE; >+ { >+#ifdef DIOCGFWSECTORS >+ secpt = 0; >+ if (ioctl(ufh->fd, DIOCGFWSECTORS, &secpt) == 0) { >+ /* >+ * I have seen strange behaviours with USB sticks. >+ * I noticed (in my tests) that, with a 4Gb device, I had to set >+ * `blksize = (secpt - 1) * 512' >+ * The correct value should be `blksize = secpt * 512' >+ * Whatever, I'm not sure the (secpt - 1) would be always true, so, in >+ * case of "small" partition (and so, most likely USB sticks) I'm >+ * forcing blksize to 512, that shouldaalways be coherent >+ * >+ * `18.000.000.000' is an approximation to 16Gb (actual medsize would be >+ * something like 16.059.797.504) >+ * So >16Gb drives would deal with 'actual' geometry, hoping it was >+ * correct. But, writing 16Gb, by 512b, is already quite stupid... >+ */ >+ if (ioctl(ufh->fd, DIOCGMEDIASIZE, &medsz) == 0) { >+ if (medsz < 18000000000) >+ secpt = 1; >+ } >+ } >+ if (secpt != 0) >+ up.up_blocksize = secpt * 512; >+ else >+#endif >+ up.up_blocksize = UBLIO_DEFAULT_BLOCKSIZE; >+ } > if ((xenv = getenv("UBLIO_ITEMS"))) > up.up_items = strtoul(xenv, &xgarbage, 10); > if (!xenv || *xgarbage != '\0')
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 144852
:
104642
| 104643 |
104644
|
104645
|
104646