Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jul 2016 20:26:08 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r418745 - in branches/2016Q3/sysutils: exfat-utils exfat-utils/files fusefs-exfat fusefs-exfat/files
Message-ID:  <201607182026.u6IKQ8PD012698@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Mon Jul 18 20:26:08 2016
New Revision: 418745
URL: https://svnweb.freebsd.org/changeset/ports/418745

Log:
  MFH: r418728
  
  sysutils/*exfat*: update to 1.2.4
  
  - Chase project move to GitHub
  - Chase patent licensing URL [1]
  - Restore GPLv2 after r328060 [2]
  - Fix build on DragonFly
  - Drop unused iconv dependency
  
  PR:		199874, 210823
  PR:		210162 [1]
  Suggested by:	decke, tijl [2] (via bug 193629)
  Approved by:	maintainer timeout (2 weeks)
  Approved by:	ports-secteam (feld)

Added:
  branches/2016Q3/sysutils/exfat-utils/files/patch-libexfat_platform.h
     - copied unchanged from r418728, head/sysutils/exfat-utils/files/patch-libexfat_platform.h
  branches/2016Q3/sysutils/exfat-utils/files/patch-ublio
     - copied unchanged from r418728, head/sysutils/exfat-utils/files/patch-ublio
  branches/2016Q3/sysutils/fusefs-exfat/files/patch-libexfat_platform.h
     - copied unchanged from r418728, head/sysutils/fusefs-exfat/files/patch-libexfat_platform.h
  branches/2016Q3/sysutils/fusefs-exfat/files/patch-ublio
     - copied unchanged from r418728, head/sysutils/fusefs-exfat/files/patch-ublio
Deleted:
  branches/2016Q3/sysutils/exfat-utils/files/patch-SConstruct
  branches/2016Q3/sysutils/fusefs-exfat/files/patch-SConstruct
Modified:
  branches/2016Q3/sysutils/exfat-utils/Makefile
  branches/2016Q3/sysutils/exfat-utils/distinfo
  branches/2016Q3/sysutils/exfat-utils/pkg-descr
  branches/2016Q3/sysutils/fusefs-exfat/Makefile
  branches/2016Q3/sysutils/fusefs-exfat/distinfo
  branches/2016Q3/sysutils/fusefs-exfat/pkg-descr
Directory Properties:
  branches/2016Q3/   (props changed)

Modified: branches/2016Q3/sysutils/exfat-utils/Makefile
==============================================================================
--- branches/2016Q3/sysutils/exfat-utils/Makefile	Mon Jul 18 20:15:17 2016	(r418744)
+++ branches/2016Q3/sysutils/exfat-utils/Makefile	Mon Jul 18 20:26:08 2016	(r418745)
@@ -1,41 +1,41 @@
 # Created by: Alex Samorukov <samm@os2.kiev.ua>
 # $FreeBSD$
 
-PORTNAME=	exfat-utils
-PORTVERSION=	1.0.1
+PORTNAME=	exfat
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.2.4
 CATEGORIES=	sysutils
-MASTER_SITES=	GOOGLE_CODE
+PKGNAMESUFFIX=	-utils
 
 MAINTAINER=	samm@os2.kiev.ua
 COMMENT=	Utilities to create, check, label and dump exFAT filesystem
 
-LICENSE=	Microsoft-exFAT
-LICENSE_NAME=	Microsoft exFAT License
-LICENSE_TEXT=	Requires license from Microsoft, please see \
-		http://www.microsoft.com/en-us/legal/intellectualproperty/IPLicensing/Programs/exFATFileSystem.aspx
-LICENSE_PERMS=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
+LICENSE=	GPLv2+ MSPAT
+LICENSE_COMB=	multi
+LICENSE_FILE_GPLv2+ =	${WRKSRC}/COPYING
+LICENSE_NAME_MSPAT=	Microsoft exFAT Patent License
+LICENSE_TEXT_MSPAT=	It is important to note that open source and other publicly \
+			available implementations of exFAT do not include a patent \
+			license from Microsoft. A license is required in order to \
+			implement exFAT and use it in a product or device. \
+	https://www.microsoft.com/en-us/legal/intellectualproperty/mtl/exfat-licensing.aspx
+LICENSE_PERMS_MSPAT=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
 
 LIB_DEPENDS=	libublio.so:devel/libublio
 
-PROJECTHOST=	exfat
+USE_GITHUB=	yes
+GH_ACCOUNT=	relan
 
-USES=		scons
+USES=		autoreconf localbase pkgconfig
+GNU_CONFIGURE=	yes
 
 PLIST_FILES=	sbin/exfatlabel sbin/dumpexfat sbin/exfatfsck sbin/mkexfatfs \
+		sbin/fsck.exfat sbin/mkfs.exfat \
 		man/man8/exfatlabel.8.gz man/man8/mkexfatfs.8.gz man/man8/exfatfsck.8.gz \
 		man/man8/dumpexfat.8.gz
 
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/label/exfatlabel ${STAGEDIR}${PREFIX}/sbin
-	${INSTALL_PROGRAM} ${WRKSRC}/dump/dumpexfat ${STAGEDIR}${PREFIX}/sbin
-	${INSTALL_PROGRAM} ${WRKSRC}/fsck/exfatfsck ${STAGEDIR}${PREFIX}/sbin
-	${INSTALL_PROGRAM} ${WRKSRC}/mkfs/mkexfatfs ${STAGEDIR}${PREFIX}/sbin
-	${INSTALL_MAN} ${WRKSRC}/label/exfatlabel.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
-	${INSTALL_MAN} ${WRKSRC}/mkfs/mkexfatfs.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
-	${INSTALL_MAN} ${WRKSRC}/dump/dumpexfat.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
-	${INSTALL_MAN} ${WRKSRC}/fsck/exfatfsck.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
-
 post-patch:
-	@${REINPLACE_CMD} -e 's|/usr/local/|${PREFIX}/|' ${WRKSRC}/SConstruct
+	@${REINPLACE_CMD} -e '/fuse/d' ${WRKSRC}/configure.ac
+	@${REINPLACE_CMD} -e 's/ fuse//' ${WRKSRC}/Makefile.am
 
 .include <bsd.port.mk>

Modified: branches/2016Q3/sysutils/exfat-utils/distinfo
==============================================================================
--- branches/2016Q3/sysutils/exfat-utils/distinfo	Mon Jul 18 20:15:17 2016	(r418744)
+++ branches/2016Q3/sysutils/exfat-utils/distinfo	Mon Jul 18 20:26:08 2016	(r418745)
@@ -1,2 +1,2 @@
-SHA256 (exfat-utils-1.0.1.tar.gz) = eeacedca1878065dc3886674ae39cd51149c37bd7d6d7e9325c971a1d1acdab3
-SIZE (exfat-utils-1.0.1.tar.gz) = 51905
+SHA256 (relan-exfat-v1.2.4_GH0.tar.gz) = e65ca1b47f35421a1663b93c66e48abfd737c3e2f0c7f7154128ce2d30ecd0d8
+SIZE (relan-exfat-v1.2.4_GH0.tar.gz) = 55172

Copied: branches/2016Q3/sysutils/exfat-utils/files/patch-libexfat_platform.h (from r418728, head/sysutils/exfat-utils/files/patch-libexfat_platform.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q3/sysutils/exfat-utils/files/patch-libexfat_platform.h	Mon Jul 18 20:26:08 2016	(r418745, copy of r418728, head/sysutils/exfat-utils/files/patch-libexfat_platform.h)
@@ -0,0 +1,11 @@
+--- libexfat/platform.h.orig	2016-06-03 05:30:35 UTC
++++ libexfat/platform.h
+@@ -46,7 +46,7 @@
+ #define EXFAT_LITTLE_ENDIAN LITTLE_ENDIAN
+ #define EXFAT_BIG_ENDIAN BIG_ENDIAN
+ 
+-#elif defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ 
+ #include <sys/endian.h>
+ #define exfat_bswap16(x) bswap16(x)

Copied: branches/2016Q3/sysutils/exfat-utils/files/patch-ublio (from r418728, head/sysutils/exfat-utils/files/patch-ublio)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q3/sysutils/exfat-utils/files/patch-ublio	Mon Jul 18 20:26:08 2016	(r418745, copy of r418728, head/sysutils/exfat-utils/files/patch-ublio)
@@ -0,0 +1,176 @@
+# Revert 3959f7d to restore ublio support and add autoconf glue.
+
+diff --git README.md README.md
+index 60d5c71..81446a6 100644
+--- README.md
++++ README.md
+@@ -7,6 +7,7 @@ Supported operating systems:
+ 
+ * GNU/Linux
+ * Mac OS X 10.5 or later
++* FreeBSD
+ * OpenBSD
+ 
+ Most GNU/Linux distributions already have fuse-exfat and exfat-utils in their repositories, so you can just install and use them. The next chapter describes how to compile them from source.
+diff --git configure.ac configure.ac
+index b45db3f..2bcda4b 100644
+--- configure.ac
++++ configure.ac
+@@ -31,6 +31,12 @@ AC_PROG_CC_C99
+ AC_PROG_RANLIB
+ AM_PROG_AR
+ AC_SYS_LARGEFILE
++PKG_CHECK_MODULES([UBLIO], [libublio], [
++  CFLAGS="$CFLAGS $UBLIO_CFLAGS"
++  LIBS="$LIBS $UBLIO_LIBS"
++  AC_DEFINE([USE_UBLIO], [1],
++    [Define if block devices are not supported.])
++], [:])
+ PKG_CHECK_MODULES([FUSE], [fuse])
+ AC_CONFIG_HEADERS([libexfat/config.h])
+ AC_CONFIG_FILES([
+diff --git libexfat/io.c libexfat/io.c
+index 60f28e2..14c0151 100644
+--- libexfat/io.c
++++ libexfat/io.c
+@@ -37,12 +37,20 @@
+ #include <sys/ioctl.h>
+ #endif
+ #include <sys/mount.h>
++#ifdef USE_UBLIO
++#include <sys/uio.h>
++#include <ublio.h>
++#endif
+ 
+ struct exfat_dev
+ {
+ 	int fd;
+ 	enum exfat_mode mode;
+ 	off_t size; /* in bytes */
++#ifdef USE_UBLIO
++	off_t pos;
++	ublio_filehandle_t ufh;
++#endif
+ };
+ 
+ static int open_ro(const char* spec)
+@@ -74,6 +82,9 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
+ {
+ 	struct exfat_dev* dev;
+ 	struct stat stbuf;
++#ifdef USE_UBLIO
++	struct ublio_param up;
++#endif
+ 
+ 	dev = malloc(sizeof(struct exfat_dev));
+ 	if (dev == NULL)
+@@ -211,6 +222,24 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
+ 		}
+ 	}
+ 
++#ifdef USE_UBLIO
++	memset(&up, 0, sizeof(struct ublio_param));
++	up.up_blocksize = 256 * 1024;
++	up.up_items = 64;
++	up.up_grace = 32;
++	up.up_priv = &dev->fd;
++
++	dev->pos = 0;
++	dev->ufh = ublio_open(&up);
++	if (dev->ufh == NULL)
++	{
++		close(dev->fd);
++		free(dev);
++		exfat_error("failed to initialize ublio");
++		return NULL;
++	}
++#endif
++
+ 	return dev;
+ }
+ 
+@@ -218,6 +247,13 @@ int exfat_close(struct exfat_dev* dev)
+ {
+ 	int rc = 0;
+ 
++#ifdef USE_UBLIO
++	if (ublio_close(dev->ufh) != 0)
++	{
++		exfat_error("failed to close ublio");
++		rc = -EIO;
++	}
++#endif
+ 	if (close(dev->fd) != 0)
+ 	{
+ 		exfat_error("failed to close device: %s", strerror(errno));
+@@ -231,6 +267,13 @@ int exfat_fsync(struct exfat_dev* dev)
+ {
+ 	int rc = 0;
+ 
++#ifdef USE_UBLIO
++	if (ublio_fsync(dev->ufh) != 0)
++	{
++		exfat_error("ublio fsync failed");
++		rc = -EIO;
++	}
++#endif
+ 	if (fsync(dev->fd) != 0)
+ 	{
+ 		exfat_error("fsync failed: %s", strerror(errno));
+@@ -251,29 +294,56 @@ off_t exfat_get_size(const struct exfat_dev* dev)
+ 
+ off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence)
+ {
++#ifdef USE_UBLIO
++	/* XXX SEEK_CUR will be handled incorrectly */
++	return dev->pos = lseek(dev->fd, offset, whence);
++#else
+ 	return lseek(dev->fd, offset, whence);
++#endif
+ }
+ 
+ ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size)
+ {
++#ifdef USE_UBLIO
++	ssize_t result = ublio_pread(dev->ufh, buffer, size, dev->pos);
++	if (result >= 0)
++		dev->pos += size;
++	return result;
++#else
+ 	return read(dev->fd, buffer, size);
++#endif
+ }
+ 
+ ssize_t exfat_write(struct exfat_dev* dev, const void* buffer, size_t size)
+ {
++#ifdef USE_UBLIO
++	ssize_t result = ublio_pwrite(dev->ufh, buffer, size, dev->pos);
++	if (result >= 0)
++		dev->pos += size;
++	return result;
++#else
+ 	return write(dev->fd, buffer, size);
++#endif
+ }
+ 
+ ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size,
+ 		off_t offset)
+ {
++#ifdef USE_UBLIO
++	return ublio_pread(dev->ufh, buffer, size, offset);
++#else
+ 	return pread(dev->fd, buffer, size, offset);
++#endif
+ }
+ 
+ ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size,
+ 		off_t offset)
+ {
++#ifdef USE_UBLIO
++	return ublio_pwrite(dev->ufh, buffer, size, offset);
++#else
+ 	return pwrite(dev->fd, buffer, size, offset);
++#endif
+ }
+ 
+ ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,

Modified: branches/2016Q3/sysutils/exfat-utils/pkg-descr
==============================================================================
--- branches/2016Q3/sysutils/exfat-utils/pkg-descr	Mon Jul 18 20:15:17 2016	(r418744)
+++ branches/2016Q3/sysutils/exfat-utils/pkg-descr	Mon Jul 18 20:26:08 2016	(r418745)
@@ -4,4 +4,4 @@ It contains dumpexfat to dump properties
 errors found on a exFAT filesystem, exfatlabel to label a exFAT filesystem and
 mkexfatfs to create a exFAT filesystem.
 
-WWW: http://code.google.com/p/exfat/
+WWW: https://github.com/relan/exfat

Modified: branches/2016Q3/sysutils/fusefs-exfat/Makefile
==============================================================================
--- branches/2016Q3/sysutils/fusefs-exfat/Makefile	Mon Jul 18 20:15:17 2016	(r418744)
+++ branches/2016Q3/sysutils/fusefs-exfat/Makefile	Mon Jul 18 20:26:08 2016	(r418745)
@@ -2,33 +2,34 @@
 # $FreeBSD$
 
 PORTNAME=	exfat
-PORTVERSION=	1.0.1
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.2.4
 CATEGORIES=	sysutils
-MASTER_SITES=	GOOGLE_CODE
 PKGNAMEPREFIX=	fusefs-
-DISTNAME=	fuse-${PORTNAME}-${PORTVERSION}
 
 MAINTAINER=	samm@os2.kiev.ua
 COMMENT=	Full-featured exFAT FS implementation as a FUSE module
 
-LICENSE=	Microsoft-exFAT
-LICENSE_NAME=	Microsoft exFAT License
-LICENSE_TEXT=	Requires license from Microsoft, please see \
-		http://www.microsoft.com/en-us/legal/intellectualproperty/IPLicensing/Programs/exFATFileSystem.aspx
-LICENSE_PERMS=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
+LICENSE=	GPLv2+ MSPAT
+LICENSE_COMB=	multi
+LICENSE_FILE_GPLv2+ =	${WRKSRC}/COPYING
+LICENSE_NAME_MSPAT=	Microsoft exFAT Patent License
+LICENSE_TEXT_MSPAT=	It is important to note that open source and other publicly \
+			available implementations of exFAT do not include a patent \
+			license from Microsoft. A license is required in order to \
+			implement exFAT and use it in a product or device. \
+	https://www.microsoft.com/en-us/legal/intellectualproperty/mtl/exfat-licensing.aspx
+LICENSE_PERMS_MSPAT=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
 
 LIB_DEPENDS=	libublio.so:devel/libublio
 
-USES=		fuse iconv scons
+USE_GITHUB=	yes
+GH_ACCOUNT=	relan
 
-PLIST_FILES=	bin/mount.exfat-fuse bin/mount.exfat man/man8/mount.exfat-fuse.8.gz
+USES=		autoreconf fuse localbase pkgconfig
+GNU_CONFIGURE=	yes
+MAKE_ARGS=	SUBDIRS="libexfat fuse"
 
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/fuse/mount.exfat-fuse ${STAGEDIR}${PREFIX}/bin
-	${LN} -s ${PREFIX}/bin/mount.exfat-fuse ${STAGEDIR}${PREFIX}/bin/mount.exfat
-	${INSTALL_MAN} ${WRKSRC}/fuse/mount.exfat-fuse.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|/usr/local/|${PREFIX}/|' ${WRKSRC}/SConstruct
+PLIST_FILES=	sbin/mount.exfat-fuse sbin/mount.exfat man/man8/mount.exfat-fuse.8.gz
 
 .include <bsd.port.mk>

Modified: branches/2016Q3/sysutils/fusefs-exfat/distinfo
==============================================================================
--- branches/2016Q3/sysutils/fusefs-exfat/distinfo	Mon Jul 18 20:15:17 2016	(r418744)
+++ branches/2016Q3/sysutils/fusefs-exfat/distinfo	Mon Jul 18 20:26:08 2016	(r418745)
@@ -1,2 +1,2 @@
-SHA256 (fuse-exfat-1.0.1.tar.gz) = 12ac1ba1b7d4343bef64e7898176705a41cfe3b5a7a179e28549d242e2854758
-SIZE (fuse-exfat-1.0.1.tar.gz) = 39627
+SHA256 (relan-exfat-v1.2.4_GH0.tar.gz) = e65ca1b47f35421a1663b93c66e48abfd737c3e2f0c7f7154128ce2d30ecd0d8
+SIZE (relan-exfat-v1.2.4_GH0.tar.gz) = 55172

Copied: branches/2016Q3/sysutils/fusefs-exfat/files/patch-libexfat_platform.h (from r418728, head/sysutils/fusefs-exfat/files/patch-libexfat_platform.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q3/sysutils/fusefs-exfat/files/patch-libexfat_platform.h	Mon Jul 18 20:26:08 2016	(r418745, copy of r418728, head/sysutils/fusefs-exfat/files/patch-libexfat_platform.h)
@@ -0,0 +1,11 @@
+--- libexfat/platform.h.orig	2016-06-03 05:30:35 UTC
++++ libexfat/platform.h
+@@ -46,7 +46,7 @@
+ #define EXFAT_LITTLE_ENDIAN LITTLE_ENDIAN
+ #define EXFAT_BIG_ENDIAN BIG_ENDIAN
+ 
+-#elif defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ 
+ #include <sys/endian.h>
+ #define exfat_bswap16(x) bswap16(x)

Copied: branches/2016Q3/sysutils/fusefs-exfat/files/patch-ublio (from r418728, head/sysutils/fusefs-exfat/files/patch-ublio)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q3/sysutils/fusefs-exfat/files/patch-ublio	Mon Jul 18 20:26:08 2016	(r418745, copy of r418728, head/sysutils/fusefs-exfat/files/patch-ublio)
@@ -0,0 +1,176 @@
+# Revert 3959f7d to restore ublio support and add autoconf glue.
+
+diff --git README.md README.md
+index 60d5c71..81446a6 100644
+--- README.md
++++ README.md
+@@ -7,6 +7,7 @@ Supported operating systems:
+ 
+ * GNU/Linux
+ * Mac OS X 10.5 or later
++* FreeBSD
+ * OpenBSD
+ 
+ Most GNU/Linux distributions already have fuse-exfat and exfat-utils in their repositories, so you can just install and use them. The next chapter describes how to compile them from source.
+diff --git configure.ac configure.ac
+index b45db3f..2bcda4b 100644
+--- configure.ac
++++ configure.ac
+@@ -31,6 +31,12 @@ AC_PROG_CC_C99
+ AC_PROG_RANLIB
+ AM_PROG_AR
+ AC_SYS_LARGEFILE
++PKG_CHECK_MODULES([UBLIO], [libublio], [
++  CFLAGS="$CFLAGS $UBLIO_CFLAGS"
++  LIBS="$LIBS $UBLIO_LIBS"
++  AC_DEFINE([USE_UBLIO], [1],
++    [Define if block devices are not supported.])
++], [:])
+ PKG_CHECK_MODULES([FUSE], [fuse])
+ AC_CONFIG_HEADERS([libexfat/config.h])
+ AC_CONFIG_FILES([
+diff --git libexfat/io.c libexfat/io.c
+index 60f28e2..14c0151 100644
+--- libexfat/io.c
++++ libexfat/io.c
+@@ -37,12 +37,20 @@
+ #include <sys/ioctl.h>
+ #endif
+ #include <sys/mount.h>
++#ifdef USE_UBLIO
++#include <sys/uio.h>
++#include <ublio.h>
++#endif
+ 
+ struct exfat_dev
+ {
+ 	int fd;
+ 	enum exfat_mode mode;
+ 	off_t size; /* in bytes */
++#ifdef USE_UBLIO
++	off_t pos;
++	ublio_filehandle_t ufh;
++#endif
+ };
+ 
+ static int open_ro(const char* spec)
+@@ -74,6 +82,9 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
+ {
+ 	struct exfat_dev* dev;
+ 	struct stat stbuf;
++#ifdef USE_UBLIO
++	struct ublio_param up;
++#endif
+ 
+ 	dev = malloc(sizeof(struct exfat_dev));
+ 	if (dev == NULL)
+@@ -211,6 +222,24 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
+ 		}
+ 	}
+ 
++#ifdef USE_UBLIO
++	memset(&up, 0, sizeof(struct ublio_param));
++	up.up_blocksize = 256 * 1024;
++	up.up_items = 64;
++	up.up_grace = 32;
++	up.up_priv = &dev->fd;
++
++	dev->pos = 0;
++	dev->ufh = ublio_open(&up);
++	if (dev->ufh == NULL)
++	{
++		close(dev->fd);
++		free(dev);
++		exfat_error("failed to initialize ublio");
++		return NULL;
++	}
++#endif
++
+ 	return dev;
+ }
+ 
+@@ -218,6 +247,13 @@ int exfat_close(struct exfat_dev* dev)
+ {
+ 	int rc = 0;
+ 
++#ifdef USE_UBLIO
++	if (ublio_close(dev->ufh) != 0)
++	{
++		exfat_error("failed to close ublio");
++		rc = -EIO;
++	}
++#endif
+ 	if (close(dev->fd) != 0)
+ 	{
+ 		exfat_error("failed to close device: %s", strerror(errno));
+@@ -231,6 +267,13 @@ int exfat_fsync(struct exfat_dev* dev)
+ {
+ 	int rc = 0;
+ 
++#ifdef USE_UBLIO
++	if (ublio_fsync(dev->ufh) != 0)
++	{
++		exfat_error("ublio fsync failed");
++		rc = -EIO;
++	}
++#endif
+ 	if (fsync(dev->fd) != 0)
+ 	{
+ 		exfat_error("fsync failed: %s", strerror(errno));
+@@ -251,29 +294,56 @@ off_t exfat_get_size(const struct exfat_dev* dev)
+ 
+ off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence)
+ {
++#ifdef USE_UBLIO
++	/* XXX SEEK_CUR will be handled incorrectly */
++	return dev->pos = lseek(dev->fd, offset, whence);
++#else
+ 	return lseek(dev->fd, offset, whence);
++#endif
+ }
+ 
+ ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size)
+ {
++#ifdef USE_UBLIO
++	ssize_t result = ublio_pread(dev->ufh, buffer, size, dev->pos);
++	if (result >= 0)
++		dev->pos += size;
++	return result;
++#else
+ 	return read(dev->fd, buffer, size);
++#endif
+ }
+ 
+ ssize_t exfat_write(struct exfat_dev* dev, const void* buffer, size_t size)
+ {
++#ifdef USE_UBLIO
++	ssize_t result = ublio_pwrite(dev->ufh, buffer, size, dev->pos);
++	if (result >= 0)
++		dev->pos += size;
++	return result;
++#else
+ 	return write(dev->fd, buffer, size);
++#endif
+ }
+ 
+ ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size,
+ 		off_t offset)
+ {
++#ifdef USE_UBLIO
++	return ublio_pread(dev->ufh, buffer, size, offset);
++#else
+ 	return pread(dev->fd, buffer, size, offset);
++#endif
+ }
+ 
+ ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size,
+ 		off_t offset)
+ {
++#ifdef USE_UBLIO
++	return ublio_pwrite(dev->ufh, buffer, size, offset);
++#else
+ 	return pwrite(dev->fd, buffer, size, offset);
++#endif
+ }
+ 
+ ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,

Modified: branches/2016Q3/sysutils/fusefs-exfat/pkg-descr
==============================================================================
--- branches/2016Q3/sysutils/fusefs-exfat/pkg-descr	Mon Jul 18 20:15:17 2016	(r418744)
+++ branches/2016Q3/sysutils/fusefs-exfat/pkg-descr	Mon Jul 18 20:26:08 2016	(r418745)
@@ -3,4 +3,4 @@ exFAT is a simple file system created by
 replace FAT32 removing some of it's limitations. exFAT is a standard FS for
 SDXC memory cards.
 
-WWW: http://code.google.com/p/exfat/
+WWW: https://github.com/relan/exfat



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607182026.u6IKQ8PD012698>