View | Details | Raw Unified | Return to bug 210823 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/exfat-utils/Makefile (-21 / +21 lines)
Lines 1-41 Link Here
1
# Created by: Alex Samorukov <samm@os2.kiev.ua>
1
# Created by: Alex Samorukov <samm@os2.kiev.ua>
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	exfat-utils
4
PORTNAME=	exfat
5
PORTVERSION=	1.0.1
5
DISTVERSIONPREFIX=	v
6
DISTVERSION=	1.2.4
6
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
7
MASTER_SITES=	GOOGLE_CODE
8
PKGNAMESUFFIX=	-utils
8
9
9
MAINTAINER=	samm@os2.kiev.ua
10
MAINTAINER=	samm@os2.kiev.ua
10
COMMENT=	Utilities to create, check, label and dump exFAT filesystem
11
COMMENT=	Utilities to create, check, label and dump exFAT filesystem
11
12
12
LICENSE=	Microsoft-exFAT
13
LICENSE=	GPLv2+ MSPAT
13
LICENSE_NAME=	Microsoft exFAT License
14
LICENSE_COMB=	multi
14
LICENSE_TEXT=	Requires license from Microsoft, please see \
15
LICENSE_FILE_GPLv2+ =	${WRKSRC}/COPYING
15
		http://www.microsoft.com/en-us/legal/intellectualproperty/IPLicensing/Programs/exFATFileSystem.aspx
16
LICENSE_NAME_MSPAT=	Microsoft exFAT Patent License
16
LICENSE_PERMS=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
17
LICENSE_TEXT_MSPAT=	It is important to note that open source and other publicly \
18
			available implementations of exFAT do not include a patent \
19
			license from Microsoft. A license is required in order to \
20
			implement exFAT and use it in a product or device. \
21
	https://www.microsoft.com/en-us/legal/intellectualproperty/mtl/exfat-licensing.aspx
22
LICENSE_PERMS_MSPAT=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
17
23
18
LIB_DEPENDS=	libublio.so:devel/libublio
24
LIB_DEPENDS=	libublio.so:devel/libublio
19
25
20
PROJECTHOST=	exfat
26
USE_GITHUB=	yes
27
GH_ACCOUNT=	relan
21
28
22
USES=		scons
29
USES=		autoreconf localbase pkgconfig
30
GNU_CONFIGURE=	yes
23
31
24
PLIST_FILES=	sbin/exfatlabel sbin/dumpexfat sbin/exfatfsck sbin/mkexfatfs \
32
PLIST_FILES=	sbin/exfatlabel sbin/dumpexfat sbin/exfatfsck sbin/mkexfatfs \
33
		sbin/fsck.exfat sbin/mkfs.exfat \
25
		man/man8/exfatlabel.8.gz man/man8/mkexfatfs.8.gz man/man8/exfatfsck.8.gz \
34
		man/man8/exfatlabel.8.gz man/man8/mkexfatfs.8.gz man/man8/exfatfsck.8.gz \
26
		man/man8/dumpexfat.8.gz
35
		man/man8/dumpexfat.8.gz
27
36
28
do-install:
29
	${INSTALL_PROGRAM} ${WRKSRC}/label/exfatlabel ${STAGEDIR}${PREFIX}/sbin
30
	${INSTALL_PROGRAM} ${WRKSRC}/dump/dumpexfat ${STAGEDIR}${PREFIX}/sbin
31
	${INSTALL_PROGRAM} ${WRKSRC}/fsck/exfatfsck ${STAGEDIR}${PREFIX}/sbin
32
	${INSTALL_PROGRAM} ${WRKSRC}/mkfs/mkexfatfs ${STAGEDIR}${PREFIX}/sbin
33
	${INSTALL_MAN} ${WRKSRC}/label/exfatlabel.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
34
	${INSTALL_MAN} ${WRKSRC}/mkfs/mkexfatfs.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
35
	${INSTALL_MAN} ${WRKSRC}/dump/dumpexfat.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
36
	${INSTALL_MAN} ${WRKSRC}/fsck/exfatfsck.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
37
38
post-patch:
37
post-patch:
39
	@${REINPLACE_CMD} -e 's|/usr/local/|${PREFIX}/|' ${WRKSRC}/SConstruct
38
	@${REINPLACE_CMD} -e '/fuse/d' ${WRKSRC}/configure.ac
39
	@${REINPLACE_CMD} -e 's/ fuse//' ${WRKSRC}/Makefile.am
40
40
41
.include <bsd.port.mk>
41
.include <bsd.port.mk>
(-)sysutils/exfat-utils/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (exfat-utils-1.0.1.tar.gz) = eeacedca1878065dc3886674ae39cd51149c37bd7d6d7e9325c971a1d1acdab3
1
SHA256 (relan-exfat-v1.2.4_GH0.tar.gz) = e65ca1b47f35421a1663b93c66e48abfd737c3e2f0c7f7154128ce2d30ecd0d8
2
SIZE (exfat-utils-1.0.1.tar.gz) = 51905
2
SIZE (relan-exfat-v1.2.4_GH0.tar.gz) = 55172
(-)sysutils/exfat-utils/files/patch-SConstruct (-14 lines)
Lines 1-14 Link Here
1
--- SConstruct.orig	2013-02-02 14:14:34 UTC
2
+++ SConstruct
3
@@ -22,10 +22,7 @@ import os
4
 import platform
5
 import SCons
6
 
7
-env = Environment(**ARGUMENTS)
8
-for var in ['PATH', 'SYSROOT']:
9
-	if var in os.environ:
10
-		env['ENV'][var] = os.environ[var]
11
+env = Environment(ENV = os.environ, **ARGUMENTS)
12
 
13
 destdir = env.get('DESTDIR', '/sbin');
14
 libs = ['exfat']
(-)sysutils/exfat-utils/files/patch-libexfat_platform.h (+11 lines)
Line 0 Link Here
1
--- libexfat/platform.h.orig	2016-06-03 05:30:35 UTC
2
+++ libexfat/platform.h
3
@@ -46,7 +46,7 @@
4
 #define EXFAT_LITTLE_ENDIAN LITTLE_ENDIAN
5
 #define EXFAT_BIG_ENDIAN BIG_ENDIAN
6
 
7
-#elif defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
8
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
9
 
10
 #include <sys/endian.h>
11
 #define exfat_bswap16(x) bswap16(x)
(-)sysutils/exfat-utils/files/patch-ublio (+176 lines)
Line 0 Link Here
1
# Revert 3959f7d to restore ublio support and add autoconf glue.
2
3
diff --git README.md README.md
4
index 60d5c71..81446a6 100644
5
--- README.md
6
+++ README.md
7
@@ -7,6 +7,7 @@ Supported operating systems:
8
 
9
 * GNU/Linux
10
 * Mac OS X 10.5 or later
11
+* FreeBSD
12
 * OpenBSD
13
 
14
 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.
15
diff --git configure.ac configure.ac
16
index b45db3f..2bcda4b 100644
17
--- configure.ac
18
+++ configure.ac
19
@@ -31,6 +31,12 @@ AC_PROG_CC_C99
20
 AC_PROG_RANLIB
21
 AM_PROG_AR
22
 AC_SYS_LARGEFILE
23
+PKG_CHECK_MODULES([UBLIO], [libublio], [
24
+  CFLAGS="$CFLAGS $UBLIO_CFLAGS"
25
+  LIBS="$LIBS $UBLIO_LIBS"
26
+  AC_DEFINE([USE_UBLIO], [1],
27
+    [Define if block devices are not supported.])
28
+], [:])
29
 PKG_CHECK_MODULES([FUSE], [fuse])
30
 AC_CONFIG_HEADERS([libexfat/config.h])
31
 AC_CONFIG_FILES([
32
diff --git libexfat/io.c libexfat/io.c
33
index 60f28e2..14c0151 100644
34
--- libexfat/io.c
35
+++ libexfat/io.c
36
@@ -37,12 +37,20 @@
37
 #include <sys/ioctl.h>
38
 #endif
39
 #include <sys/mount.h>
40
+#ifdef USE_UBLIO
41
+#include <sys/uio.h>
42
+#include <ublio.h>
43
+#endif
44
 
45
 struct exfat_dev
46
 {
47
 	int fd;
48
 	enum exfat_mode mode;
49
 	off_t size; /* in bytes */
50
+#ifdef USE_UBLIO
51
+	off_t pos;
52
+	ublio_filehandle_t ufh;
53
+#endif
54
 };
55
 
56
 static int open_ro(const char* spec)
57
@@ -74,6 +82,9 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
58
 {
59
 	struct exfat_dev* dev;
60
 	struct stat stbuf;
61
+#ifdef USE_UBLIO
62
+	struct ublio_param up;
63
+#endif
64
 
65
 	dev = malloc(sizeof(struct exfat_dev));
66
 	if (dev == NULL)
67
@@ -211,6 +222,24 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
68
 		}
69
 	}
70
 
71
+#ifdef USE_UBLIO
72
+	memset(&up, 0, sizeof(struct ublio_param));
73
+	up.up_blocksize = 256 * 1024;
74
+	up.up_items = 64;
75
+	up.up_grace = 32;
76
+	up.up_priv = &dev->fd;
77
+
78
+	dev->pos = 0;
79
+	dev->ufh = ublio_open(&up);
80
+	if (dev->ufh == NULL)
81
+	{
82
+		close(dev->fd);
83
+		free(dev);
84
+		exfat_error("failed to initialize ublio");
85
+		return NULL;
86
+	}
87
+#endif
88
+
89
 	return dev;
90
 }
91
 
92
@@ -218,6 +247,13 @@ int exfat_close(struct exfat_dev* dev)
93
 {
94
 	int rc = 0;
95
 
96
+#ifdef USE_UBLIO
97
+	if (ublio_close(dev->ufh) != 0)
98
+	{
99
+		exfat_error("failed to close ublio");
100
+		rc = -EIO;
101
+	}
102
+#endif
103
 	if (close(dev->fd) != 0)
104
 	{
105
 		exfat_error("failed to close device: %s", strerror(errno));
106
@@ -231,6 +267,13 @@ int exfat_fsync(struct exfat_dev* dev)
107
 {
108
 	int rc = 0;
109
 
110
+#ifdef USE_UBLIO
111
+	if (ublio_fsync(dev->ufh) != 0)
112
+	{
113
+		exfat_error("ublio fsync failed");
114
+		rc = -EIO;
115
+	}
116
+#endif
117
 	if (fsync(dev->fd) != 0)
118
 	{
119
 		exfat_error("fsync failed: %s", strerror(errno));
120
@@ -251,29 +294,56 @@ off_t exfat_get_size(const struct exfat_dev* dev)
121
 
122
 off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence)
123
 {
124
+#ifdef USE_UBLIO
125
+	/* XXX SEEK_CUR will be handled incorrectly */
126
+	return dev->pos = lseek(dev->fd, offset, whence);
127
+#else
128
 	return lseek(dev->fd, offset, whence);
129
+#endif
130
 }
131
 
132
 ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size)
133
 {
134
+#ifdef USE_UBLIO
135
+	ssize_t result = ublio_pread(dev->ufh, buffer, size, dev->pos);
136
+	if (result >= 0)
137
+		dev->pos += size;
138
+	return result;
139
+#else
140
 	return read(dev->fd, buffer, size);
141
+#endif
142
 }
143
 
144
 ssize_t exfat_write(struct exfat_dev* dev, const void* buffer, size_t size)
145
 {
146
+#ifdef USE_UBLIO
147
+	ssize_t result = ublio_pwrite(dev->ufh, buffer, size, dev->pos);
148
+	if (result >= 0)
149
+		dev->pos += size;
150
+	return result;
151
+#else
152
 	return write(dev->fd, buffer, size);
153
+#endif
154
 }
155
 
156
 ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size,
157
 		off_t offset)
158
 {
159
+#ifdef USE_UBLIO
160
+	return ublio_pread(dev->ufh, buffer, size, offset);
161
+#else
162
 	return pread(dev->fd, buffer, size, offset);
163
+#endif
164
 }
165
 
166
 ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size,
167
 		off_t offset)
168
 {
169
+#ifdef USE_UBLIO
170
+	return ublio_pwrite(dev->ufh, buffer, size, offset);
171
+#else
172
 	return pwrite(dev->fd, buffer, size, offset);
173
+#endif
174
 }
175
 
176
 ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,
(-)sysutils/exfat-utils/pkg-descr (-1 / +1 lines)
Lines 4-7 It contains dumpexfat to dump properties of the fi Link Here
4
errors found on a exFAT filesystem, exfatlabel to label a exFAT filesystem and
4
errors found on a exFAT filesystem, exfatlabel to label a exFAT filesystem and
5
mkexfatfs to create a exFAT filesystem.
5
mkexfatfs to create a exFAT filesystem.
6
6
7
WWW: http://code.google.com/p/exfat/
7
WWW: https://github.com/relan/exfat
(-)sysutils/fusefs-exfat/Makefile (-17 / +18 lines)
Lines 2-34 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	exfat
4
PORTNAME=	exfat
5
PORTVERSION=	1.0.1
5
DISTVERSIONPREFIX=	v
6
DISTVERSION=	1.2.4
6
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
7
MASTER_SITES=	GOOGLE_CODE
8
PKGNAMEPREFIX=	fusefs-
8
PKGNAMEPREFIX=	fusefs-
9
DISTNAME=	fuse-${PORTNAME}-${PORTVERSION}
10
9
11
MAINTAINER=	samm@os2.kiev.ua
10
MAINTAINER=	samm@os2.kiev.ua
12
COMMENT=	Full-featured exFAT FS implementation as a FUSE module
11
COMMENT=	Full-featured exFAT FS implementation as a FUSE module
13
12
14
LICENSE=	Microsoft-exFAT
13
LICENSE=	GPLv2+ MSPAT
15
LICENSE_NAME=	Microsoft exFAT License
14
LICENSE_COMB=	multi
16
LICENSE_TEXT=	Requires license from Microsoft, please see \
15
LICENSE_FILE_GPLv2+ =	${WRKSRC}/COPYING
17
		http://www.microsoft.com/en-us/legal/intellectualproperty/IPLicensing/Programs/exFATFileSystem.aspx
16
LICENSE_NAME_MSPAT=	Microsoft exFAT Patent License
18
LICENSE_PERMS=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
17
LICENSE_TEXT_MSPAT=	It is important to note that open source and other publicly \
18
			available implementations of exFAT do not include a patent \
19
			license from Microsoft. A license is required in order to \
20
			implement exFAT and use it in a product or device. \
21
	https://www.microsoft.com/en-us/legal/intellectualproperty/mtl/exfat-licensing.aspx
22
LICENSE_PERMS_MSPAT=	no-dist-mirror no-dist-sell no-pkg-mirror no-pkg-sell
19
23
20
LIB_DEPENDS=	libublio.so:devel/libublio
24
LIB_DEPENDS=	libublio.so:devel/libublio
21
25
22
USES=		fuse iconv scons
26
USE_GITHUB=	yes
27
GH_ACCOUNT=	relan
23
28
24
PLIST_FILES=	bin/mount.exfat-fuse bin/mount.exfat man/man8/mount.exfat-fuse.8.gz
29
USES=		autoreconf fuse localbase pkgconfig
30
GNU_CONFIGURE=	yes
31
MAKE_ARGS=	SUBDIRS="libexfat fuse"
25
32
26
do-install:
33
PLIST_FILES=	sbin/mount.exfat-fuse sbin/mount.exfat man/man8/mount.exfat-fuse.8.gz
27
	${INSTALL_PROGRAM} ${WRKSRC}/fuse/mount.exfat-fuse ${STAGEDIR}${PREFIX}/bin
28
	${LN} -s ${PREFIX}/bin/mount.exfat-fuse ${STAGEDIR}${PREFIX}/bin/mount.exfat
29
	${INSTALL_MAN} ${WRKSRC}/fuse/mount.exfat-fuse.8 ${STAGEDIR}${MAN8PREFIX}/man/man8
30
34
31
post-patch:
32
	@${REINPLACE_CMD} -e 's|/usr/local/|${PREFIX}/|' ${WRKSRC}/SConstruct
33
34
.include <bsd.port.mk>
35
.include <bsd.port.mk>
(-)sysutils/fusefs-exfat/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (fuse-exfat-1.0.1.tar.gz) = 12ac1ba1b7d4343bef64e7898176705a41cfe3b5a7a179e28549d242e2854758
1
SHA256 (relan-exfat-v1.2.4_GH0.tar.gz) = e65ca1b47f35421a1663b93c66e48abfd737c3e2f0c7f7154128ce2d30ecd0d8
2
SIZE (fuse-exfat-1.0.1.tar.gz) = 39627
2
SIZE (relan-exfat-v1.2.4_GH0.tar.gz) = 55172
(-)sysutils/fusefs-exfat/files/patch-SConstruct (-14 lines)
Lines 1-14 Link Here
1
--- SConstruct.orig	2015-04-13 20:50:01.073662000 +0300
2
+++ SConstruct	2015-04-13 20:54:33.231753000 +0300
3
@@ -22,10 +22,7 @@
4
 import platform
5
 import SCons
6
 
7
-env = Environment(**ARGUMENTS)
8
-for var in ['PATH', 'SYSROOT']:
9
-	if var in os.environ:
10
-		env['ENV'][var] = os.environ[var]
11
+env = Environment(ENV = os.environ, **ARGUMENTS)
12
 
13
 destdir = env.get('DESTDIR', '/sbin');
14
 libs = ['exfat']
(-)sysutils/fusefs-exfat/files/patch-libexfat_platform.h (+11 lines)
Line 0 Link Here
1
--- libexfat/platform.h.orig	2016-06-03 05:30:35 UTC
2
+++ libexfat/platform.h
3
@@ -46,7 +46,7 @@
4
 #define EXFAT_LITTLE_ENDIAN LITTLE_ENDIAN
5
 #define EXFAT_BIG_ENDIAN BIG_ENDIAN
6
 
7
-#elif defined(__FreeBSD__) || defined(__DragonFlyBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
8
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) || defined(__OpenBSD__)
9
 
10
 #include <sys/endian.h>
11
 #define exfat_bswap16(x) bswap16(x)
(-)sysutils/fusefs-exfat/files/patch-ublio (+176 lines)
Line 0 Link Here
1
# Revert 3959f7d to restore ublio support and add autoconf glue.
2
3
diff --git README.md README.md
4
index 60d5c71..81446a6 100644
5
--- README.md
6
+++ README.md
7
@@ -7,6 +7,7 @@ Supported operating systems:
8
 
9
 * GNU/Linux
10
 * Mac OS X 10.5 or later
11
+* FreeBSD
12
 * OpenBSD
13
 
14
 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.
15
diff --git configure.ac configure.ac
16
index b45db3f..2bcda4b 100644
17
--- configure.ac
18
+++ configure.ac
19
@@ -31,6 +31,12 @@ AC_PROG_CC_C99
20
 AC_PROG_RANLIB
21
 AM_PROG_AR
22
 AC_SYS_LARGEFILE
23
+PKG_CHECK_MODULES([UBLIO], [libublio], [
24
+  CFLAGS="$CFLAGS $UBLIO_CFLAGS"
25
+  LIBS="$LIBS $UBLIO_LIBS"
26
+  AC_DEFINE([USE_UBLIO], [1],
27
+    [Define if block devices are not supported.])
28
+], [:])
29
 PKG_CHECK_MODULES([FUSE], [fuse])
30
 AC_CONFIG_HEADERS([libexfat/config.h])
31
 AC_CONFIG_FILES([
32
diff --git libexfat/io.c libexfat/io.c
33
index 60f28e2..14c0151 100644
34
--- libexfat/io.c
35
+++ libexfat/io.c
36
@@ -37,12 +37,20 @@
37
 #include <sys/ioctl.h>
38
 #endif
39
 #include <sys/mount.h>
40
+#ifdef USE_UBLIO
41
+#include <sys/uio.h>
42
+#include <ublio.h>
43
+#endif
44
 
45
 struct exfat_dev
46
 {
47
 	int fd;
48
 	enum exfat_mode mode;
49
 	off_t size; /* in bytes */
50
+#ifdef USE_UBLIO
51
+	off_t pos;
52
+	ublio_filehandle_t ufh;
53
+#endif
54
 };
55
 
56
 static int open_ro(const char* spec)
57
@@ -74,6 +82,9 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
58
 {
59
 	struct exfat_dev* dev;
60
 	struct stat stbuf;
61
+#ifdef USE_UBLIO
62
+	struct ublio_param up;
63
+#endif
64
 
65
 	dev = malloc(sizeof(struct exfat_dev));
66
 	if (dev == NULL)
67
@@ -211,6 +222,24 @@ struct exfat_dev* exfat_open(const char* spec, enum exfat_mode mode)
68
 		}
69
 	}
70
 
71
+#ifdef USE_UBLIO
72
+	memset(&up, 0, sizeof(struct ublio_param));
73
+	up.up_blocksize = 256 * 1024;
74
+	up.up_items = 64;
75
+	up.up_grace = 32;
76
+	up.up_priv = &dev->fd;
77
+
78
+	dev->pos = 0;
79
+	dev->ufh = ublio_open(&up);
80
+	if (dev->ufh == NULL)
81
+	{
82
+		close(dev->fd);
83
+		free(dev);
84
+		exfat_error("failed to initialize ublio");
85
+		return NULL;
86
+	}
87
+#endif
88
+
89
 	return dev;
90
 }
91
 
92
@@ -218,6 +247,13 @@ int exfat_close(struct exfat_dev* dev)
93
 {
94
 	int rc = 0;
95
 
96
+#ifdef USE_UBLIO
97
+	if (ublio_close(dev->ufh) != 0)
98
+	{
99
+		exfat_error("failed to close ublio");
100
+		rc = -EIO;
101
+	}
102
+#endif
103
 	if (close(dev->fd) != 0)
104
 	{
105
 		exfat_error("failed to close device: %s", strerror(errno));
106
@@ -231,6 +267,13 @@ int exfat_fsync(struct exfat_dev* dev)
107
 {
108
 	int rc = 0;
109
 
110
+#ifdef USE_UBLIO
111
+	if (ublio_fsync(dev->ufh) != 0)
112
+	{
113
+		exfat_error("ublio fsync failed");
114
+		rc = -EIO;
115
+	}
116
+#endif
117
 	if (fsync(dev->fd) != 0)
118
 	{
119
 		exfat_error("fsync failed: %s", strerror(errno));
120
@@ -251,29 +294,56 @@ off_t exfat_get_size(const struct exfat_dev* dev)
121
 
122
 off_t exfat_seek(struct exfat_dev* dev, off_t offset, int whence)
123
 {
124
+#ifdef USE_UBLIO
125
+	/* XXX SEEK_CUR will be handled incorrectly */
126
+	return dev->pos = lseek(dev->fd, offset, whence);
127
+#else
128
 	return lseek(dev->fd, offset, whence);
129
+#endif
130
 }
131
 
132
 ssize_t exfat_read(struct exfat_dev* dev, void* buffer, size_t size)
133
 {
134
+#ifdef USE_UBLIO
135
+	ssize_t result = ublio_pread(dev->ufh, buffer, size, dev->pos);
136
+	if (result >= 0)
137
+		dev->pos += size;
138
+	return result;
139
+#else
140
 	return read(dev->fd, buffer, size);
141
+#endif
142
 }
143
 
144
 ssize_t exfat_write(struct exfat_dev* dev, const void* buffer, size_t size)
145
 {
146
+#ifdef USE_UBLIO
147
+	ssize_t result = ublio_pwrite(dev->ufh, buffer, size, dev->pos);
148
+	if (result >= 0)
149
+		dev->pos += size;
150
+	return result;
151
+#else
152
 	return write(dev->fd, buffer, size);
153
+#endif
154
 }
155
 
156
 ssize_t exfat_pread(struct exfat_dev* dev, void* buffer, size_t size,
157
 		off_t offset)
158
 {
159
+#ifdef USE_UBLIO
160
+	return ublio_pread(dev->ufh, buffer, size, offset);
161
+#else
162
 	return pread(dev->fd, buffer, size, offset);
163
+#endif
164
 }
165
 
166
 ssize_t exfat_pwrite(struct exfat_dev* dev, const void* buffer, size_t size,
167
 		off_t offset)
168
 {
169
+#ifdef USE_UBLIO
170
+	return ublio_pwrite(dev->ufh, buffer, size, offset);
171
+#else
172
 	return pwrite(dev->fd, buffer, size, offset);
173
+#endif
174
 }
175
 
176
 ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,
(-)sysutils/fusefs-exfat/pkg-descr (-1 / +1 lines)
Lines 3-6 exFAT is a simple file system created by Microsoft Link Here
3
replace FAT32 removing some of it's limitations. exFAT is a standard FS for
3
replace FAT32 removing some of it's limitations. exFAT is a standard FS for
4
SDXC memory cards.
4
SDXC memory cards.
5
5
6
WWW: http://code.google.com/p/exfat/
6
WWW: https://github.com/relan/exfat

Return to bug 210823