diff options
-rw-r--r-- | sysutils/fusefs-ntfs/Makefile | 7 | ||||
-rw-r--r-- | sysutils/fusefs-ntfs/files/patch-libntfs-3g__unix_io.c | 32 | ||||
-rw-r--r-- | sysutils/fusefs-ntfs/files/pkg-message.in | 9 |
3 files changed, 27 insertions, 21 deletions
diff --git a/sysutils/fusefs-ntfs/Makefile b/sysutils/fusefs-ntfs/Makefile index 1f05112ba41a..348cc35de344 100644 --- a/sysutils/fusefs-ntfs/Makefile +++ b/sysutils/fusefs-ntfs/Makefile @@ -21,11 +21,10 @@ BUILD_DEPENDS= fusefs-libs>=2.6.0:${PORTSDIR}/sysutils/fusefs-libs LIB_DEPENDS= fuse.2:${PORTSDIR}/sysutils/fusefs-libs RUN_DEPENDS= ${LOCALBASE}/modules/fuse.ko:${PORTSDIR}/sysutils/fusefs-kmod -ONLY_FOR_ARCHS= i386 amd64 USE_LDCONFIG= yes USE_AUTOTOOLS= libtool:15 CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL} -CONFIGURE_ARGS= --exec-prefix=${PREFIX} +CONFIGURE_ARGS= --exec-prefix=${PREFIX} --mandir=${MANPREFIX}/man OPTIONS= LOCK "Lock the device when mounting (avoids access)" off \ UBLIO "Enable user space cache for improved speed" on @@ -36,6 +35,10 @@ UBLIO_SRC= libublio-20070103 .include <bsd.port.pre.mk> +.if ${OSVERSION} < 600000 +IGNORE= depends on kernel module that requires FreeBSD 6 or later +.endif + .if defined(WITH_LOCK) CFLAGS+= -DUSE_LOCK .endif diff --git a/sysutils/fusefs-ntfs/files/patch-libntfs-3g__unix_io.c b/sysutils/fusefs-ntfs/files/patch-libntfs-3g__unix_io.c index a1759380abf0..0c729a687e13 100644 --- a/sysutils/fusefs-ntfs/files/patch-libntfs-3g__unix_io.c +++ b/sysutils/fusefs-ntfs/files/patch-libntfs-3g__unix_io.c @@ -1,5 +1,5 @@ ---- libntfs-3g/unix_io.c.orig Fri Jun 8 23:35:33 2007 -+++ libntfs-3g/unix_io.c Mon Jul 16 07:58:02 2007 +--- libntfs-3g/unix_io.c.orig Fri Jun 8 18:35:33 2007 ++++ libntfs-3g/unix_io.c Wed Jul 11 17:55:03 2007 @@ -54,6 +54,22 @@ #include <linux/fd.h> #endif @@ -264,7 +264,7 @@ if (!NDevOpen(dev)) { errno = EBADF; -@@ -160,12 +330,19 @@ +@@ -160,12 +330,18 @@ return -1; } @@ -274,7 +274,6 @@ flk.l_whence = SEEK_SET; flk.l_start = flk.l_len = 0LL; - if (fcntl(DEV_FD(dev), F_SETLK, &flk)) -+ + if (!NDevBlock(dev) && fcntl(DEV_FD(dev), F_SETLK, &flk)) ntfs_log_perror("Could not unlock %s", dev->d_name); +#endif @@ -285,7 +284,7 @@ if (close(DEV_FD(dev))) { ntfs_log_perror("Failed to close device %s", dev->d_name); return -1; -@@ -189,9 +366,234 @@ +@@ -189,9 +365,234 @@ static s64 ntfs_device_unix_io_seek(struct ntfs_device *dev, s64 offset, int whence) { @@ -520,7 +519,7 @@ /** * ntfs_device_unix_io_read - Read from the device, from the current location * @dev: -@@ -205,6 +607,29 @@ +@@ -205,6 +606,29 @@ static s64 ntfs_device_unix_io_read(struct ntfs_device *dev, void *buf, s64 count) { @@ -550,7 +549,7 @@ return read(DEV_FD(dev), buf, count); } -@@ -226,6 +651,28 @@ +@@ -226,6 +650,28 @@ return -1; } NDevSetDirty(dev); @@ -579,7 +578,7 @@ return write(DEV_FD(dev), buf, count); } -@@ -243,6 +690,13 @@ +@@ -243,6 +689,13 @@ static s64 ntfs_device_unix_io_pread(struct ntfs_device *dev, void *buf, s64 count, s64 offset) { @@ -593,7 +592,7 @@ return pread(DEV_FD(dev), buf, count, offset); } -@@ -265,6 +719,13 @@ +@@ -265,6 +718,13 @@ return -1; } NDevSetDirty(dev); @@ -607,17 +606,18 @@ return pwrite(DEV_FD(dev), buf, count, offset); } -@@ -281,6 +742,13 @@ +@@ -281,7 +741,14 @@ int res = 0; if (!NDevReadOnly(dev)) { +#if USE_UBLIO -+ if (DEV_HANDLE(dev)->ublio_fh) { -+ res = ublio_fsync(DEV_HANDLE(dev)->ublio_fh); -+ if (res) -+ return res; -+ } -+#endif ++ if (DEV_HANDLE(dev)->ublio_fh) ++ res = ublio_fsync(DEV_HANDLE(dev)->ublio_fh); ++ if (!DEV_HANDLE(dev)->ublio_fh || !res) ++ res = fsync(DEV_FD(dev)); ++#else res = fsync(DEV_FD(dev)); ++#endif if (res) ntfs_log_perror("Failed to sync device %s", dev->d_name); + else diff --git a/sysutils/fusefs-ntfs/files/pkg-message.in b/sysutils/fusefs-ntfs/files/pkg-message.in index 91ee0d56d0c1..f3abf199d3f8 100644 --- a/sysutils/fusefs-ntfs/files/pkg-message.in +++ b/sysutils/fusefs-ntfs/files/pkg-message.in @@ -20,11 +20,10 @@ UBLIO_BLOCKSIZE - 1048576 (1MB). Larger improves reading/writing speed of (creation, deletion, moving, find(1)) perform faster. Try 2/4MB and 512/256KB for the different approaches. Note that after that points performance descreases again. -UBLIO_ITEMS - 64. When greater, increases speed of filesystem operations, - but consumes more memory. Try 128. +UBLIO_ITEMS - 64. Higher increases speed of filesystem operations. Try 128. UBLIO_GRACE - 32. Makes the cache items have more chances to be reused. UBLIO_SYNC_IO - 0. If enabled, highly decreases writing speed, but the data - is written immediatly to the disk. + is immediatly written to the disk. For example (improves performance over large files): @@ -34,4 +33,8 @@ It is also possible to enforce block aligned I/O on regular files by setting the FORCE_ALIGNED_IO variable (it will be set to 512 bytes), but this is only useful for testing purposes and in practice has no use. +Note that higher values for UBLIO_BLOCKSIZE and UBLIO_ITEMS increase the +memory usage by their product in bytes. By default it consumes 64MB. To +decrease it to 16MB set UBLIO_BLOCKSIZE to 256KB for example. + ============================================================================== |