[packages/fuse-exfat] - up to 1.1.0

adwol adwol at pld-linux.org
Fri Jun 26 00:19:30 CEST 2015


commit 997c8ed43aec467de10533d027c95fc9d81b6d26
Author: Adam Osuchowski <adwol at pld-linux.org>
Date:   Fri Jun 26 00:19:07 2015 +0200

    - up to 1.1.0

 exfat-svn-fuse.patch     | 212 -----------------------------------------------
 exfat-svn-libexfat.patch | 122 ---------------------------
 2 files changed, 334 deletions(-)
---
diff --git a/exfat-svn-fuse.patch b/exfat-svn-fuse.patch
deleted file mode 100644
index bf0d195..0000000
--- a/exfat-svn-fuse.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-Index: main.c
-===================================================================
---- main.c	(wersja 342)
-+++ main.c	(wersja 353)
-@@ -80,7 +80,7 @@
- 	if (rc != 0)
- 		return rc;
- 
--	rc = exfat_truncate(&ef, node, size);
-+	rc = exfat_truncate(&ef, node, size, true);
- 	exfat_put_node(&ef, node);
- 	return rc;
- }
-@@ -242,15 +242,25 @@
- 	return 0;
- }
- 
--#ifdef __APPLE__
- static int fuse_exfat_chmod(const char* path, mode_t mode)
- {
-+	const mode_t VALID_MODE_MASK = S_IFREG | S_IFDIR |
-+			S_IRWXU | S_IRWXG | S_IRWXO;
-+
- 	exfat_debug("[%s] %s 0%ho", __func__, path, mode);
--	/* make OS X utilities happy */
-+	if (mode & ~VALID_MODE_MASK)
-+		return -EPERM;
- 	return 0;
- }
--#endif
- 
-+static int fuse_exfat_chown(const char* path, uid_t uid, gid_t gid)
-+{
-+	exfat_debug("[%s] %s %u:%u", __func__, path, uid, gid);
-+	if (uid != ef.uid || gid != ef.gid)
-+		return -EPERM;
-+	return 0;
-+}
-+
- static int fuse_exfat_statfs(const char* path, struct statvfs* sfs)
- {
- 	exfat_debug("[%s]", __func__);
-@@ -292,7 +302,7 @@
- 
- static void usage(const char* prog)
- {
--	fprintf(stderr, "Usage: %s [-d] [-o options] [-v] <device> <dir>\n", prog);
-+	fprintf(stderr, "Usage: %s [-d] [-o options] [-V] <device> <dir>\n", prog);
- 	exit(1);
- }
- 
-@@ -311,9 +321,8 @@
- 	.mkdir		= fuse_exfat_mkdir,
- 	.rename		= fuse_exfat_rename,
- 	.utimens	= fuse_exfat_utimens,
--#ifdef __APPLE__
- 	.chmod		= fuse_exfat_chmod,
--#endif
-+	.chown		= fuse_exfat_chown,
- 	.statfs		= fuse_exfat_statfs,
- 	.init		= fuse_exfat_init,
- 	.destroy	= fuse_exfat_destroy,
-@@ -344,21 +353,6 @@
- 	return options;
- }
- 
--static char* add_fsname_option(char* options, const char* spec)
--{
--	char* spec_abs = realpath(spec, NULL);
--
--	if (spec_abs == NULL)
--	{
--		free(options);
--		exfat_error("failed to get absolute path for `%s'", spec);
--		return NULL;
--	}
--	options = add_option(options, "fsname", spec_abs);
--	free(spec_abs);
--	return options;
--}
--
- static char* add_user_option(char* options)
- {
- 	struct passwd* pw;
-@@ -390,7 +384,7 @@
- 
- static char* add_fuse_options(char* options, const char* spec)
- {
--	options = add_fsname_option(options, spec);
-+	options = add_option(options, "fsname", spec);
- 	if (options == NULL)
- 		return NULL;
- 	options = add_user_option(options);
-@@ -413,7 +407,7 @@
- 	int debug = 0;
- 	struct fuse_chan* fc = NULL;
- 	struct fuse* fh = NULL;
--	char** pp;
-+	int opt;
- 
- 	printf("FUSE exfat %u.%u.%u\n",
- 			EXFAT_VERSION_MAJOR, EXFAT_VERSION_MINOR, EXFAT_VERSION_PATCH);
-@@ -425,40 +419,39 @@
- 		return 1;
- 	}
- 
--	for (pp = argv + 1; *pp; pp++)
-+	while ((opt = getopt(argc, argv, "dno:Vv")) != -1)
- 	{
--		if (strcmp(*pp, "-o") == 0)
-+		switch (opt)
- 		{
--			pp++;
--			if (*pp == NULL)
--				usage(argv[0]);
--			mount_options = add_option(mount_options, *pp, NULL);
-+		case 'd':
-+			debug = 1;
-+			break;
-+		case 'n':
-+			break;
-+		case 'o':
-+			mount_options = add_option(mount_options, optarg, NULL);
- 			if (mount_options == NULL)
- 				return 1;
--		}
--		else if (strcmp(*pp, "-d") == 0)
--			debug = 1;
--		else if (strcmp(*pp, "-v") == 0)
--		{
-+			break;
-+		case 'V':
- 			free(mount_options);
- 			puts("Copyright (C) 2010-2013  Andrew Nayenko");
- 			return 0;
--		}
--		else if (spec == NULL)
--			spec = *pp;
--		else if (mount_point == NULL)
--			mount_point = *pp;
--		else
--		{
-+		case 'v':
-+			break;
-+		default:
- 			free(mount_options);
- 			usage(argv[0]);
-+			break;
- 		}
- 	}
--	if (spec == NULL || mount_point == NULL)
-+	if (argc - optind != 2)
- 	{
- 		free(mount_options);
- 		usage(argv[0]);
- 	}
-+	spec = argv[optind];
-+	mount_point = argv[optind + 1];
- 
- 	if (exfat_mount(&ef, spec, mount_options) != 0)
- 	{
-Index: mount.exfat-fuse.8
-===================================================================
---- mount.exfat-fuse.8	(wersja 342)
-+++ mount.exfat-fuse.8	(wersja 353)
-@@ -9,10 +9,16 @@
- .B \-d
- ]
- [
-+.B \-n
-+]
-+[
- .B \-o
- .I options
- ]
- [
-+.B \-V
-+]
-+[
- .B \-v
- ]
- .I device dir
-@@ -21,7 +27,7 @@
- .B mount.exfat-fuse
- is a free exFAT file system implementation with write support. exFAT is a
- simple file system created by Microsoft. It is intended to replace FAT32
--removing some of it's limitations. exFAT is a standard FS for SDXC memory
-+removing some of its limitations. exFAT is a standard FS for SDXC memory
- cards.
- 
- .SH COMMAND LINE OPTIONS
-@@ -30,13 +36,19 @@
- .BI \-d
- Enable debug logging and do not detach from shell.
- .TP
-+.BI \-n
-+Ignored.
-+.TP
- .BI \-o " options"
- File system specific options. For more details see
- .B FILE SYSTEM OPTIONS
- section below.
- .TP
-+.BI \-V
-+Print version and copyright.
-+.TP
- .BI \-v
--Print version and copyright.
-+Ignored.
- 
- .SH FILE SYSTEM OPTIONS
- .TP
diff --git a/exfat-svn-libexfat.patch b/exfat-svn-libexfat.patch
deleted file mode 100644
index 4ebe69f..0000000
--- a/exfat-svn-libexfat.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-Index: cluster.c
-===================================================================
---- cluster.c	(wersja 342)
-+++ cluster.c	(wersja 353)
-@@ -134,7 +134,7 @@
- 	ef->cmap.dirty = false;
- }
- 
--static void set_next_cluster(const struct exfat* ef, int contiguous,
-+static void set_next_cluster(const struct exfat* ef, bool contiguous,
- 		cluster_t current, cluster_t next)
- {
- 	off_t fat_offset;
-@@ -187,7 +187,7 @@
- 	cluster_t c;
- 
- 	for (c = first; c < last; c++)
--		set_next_cluster(ef, 0, c, c + 1);
-+		set_next_cluster(ef, false, c, c + 1);
- }
- 
- static int shrink_file(struct exfat* ef, struct exfat_node* node,
-@@ -344,7 +344,8 @@
- 	return 0;
- }
- 
--int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size)
-+int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size,
-+		bool erase)
- {
- 	uint32_t c1 = bytes2clusters(ef, node->size);
- 	uint32_t c2 = bytes2clusters(ef, size);
-@@ -364,9 +365,12 @@
- 	if (rc != 0)
- 		return rc;
- 
--	rc = erase_range(ef, node, node->size, size);
--	if (rc != 0)
--		return rc;
-+	if (erase)
-+	{
-+		rc = erase_range(ef, node, node->size, size);
-+		if (rc != 0)
-+			return rc;
-+	}
- 
- 	exfat_update_mtime(node);
- 	node->size = size;
-Index: node.c
-===================================================================
---- node.c	(wersja 342)
-+++ node.c	(wersja 353)
-@@ -56,7 +56,7 @@
- 		if (node->flags & EXFAT_ATTRIB_UNLINKED)
- 		{
- 			/* free all clusters and node structure itself */
--			exfat_truncate(ef, node, 0);
-+			exfat_truncate(ef, node, 0, true);
- 			free(node);
- 		}
- 		if (ef->cmap.dirty)
-@@ -627,7 +627,7 @@
- 		new_size = CLUSTER_SIZE(*ef->sb);
- 	if (new_size == dir->size)
- 		return 0;
--	rc = exfat_truncate(ef, dir, new_size);
-+	rc = exfat_truncate(ef, dir, new_size, true);
- 	if (rc != 0)
- 		return rc;
- 	return 0;
-@@ -673,7 +673,7 @@
- {
- 	return exfat_truncate(ef, dir,
- 			DIV_ROUND_UP(asize + difference, CLUSTER_SIZE(*ef->sb))
--				* CLUSTER_SIZE(*ef->sb));
-+				* CLUSTER_SIZE(*ef->sb), true);
- }
- 
- static int find_slot(struct exfat* ef, struct exfat_node* dir,
-@@ -826,7 +826,7 @@
- 	if (rc != 0)
- 		return 0;
- 	/* directories always have at least one cluster */
--	rc = exfat_truncate(ef, node, CLUSTER_SIZE(*ef->sb));
-+	rc = exfat_truncate(ef, node, CLUSTER_SIZE(*ef->sb), true);
- 	if (rc != 0)
- 	{
- 		delete(ef, node);
-Index: io.c
-===================================================================
---- io.c	(wersja 342)
-+++ io.c	(wersja 353)
-@@ -351,9 +351,12 @@
- 	const char* bufp = buffer;
- 	off_t lsize, loffset, remainder;
- 
--	if (offset + size > node->size)
--		if (exfat_truncate(ef, node, offset + size) != 0)
--			return -1;
-+ 	if (offset > node->size)
-+ 		if (exfat_truncate(ef, node, offset, true) != 0)
-+ 			return -1;
-+  	if (offset + size > node->size)
-+ 		if (exfat_truncate(ef, node, offset + size, false) != 0)
-+ 			return -1;
- 	if (size == 0)
- 		return 0;
- 
-Index: exfat.h
-===================================================================
---- exfat.h	(wersja 342)
-+++ exfat.h	(wersja 353)
-@@ -164,7 +164,8 @@
- cluster_t exfat_advance_cluster(const struct exfat* ef,
- 		struct exfat_node* node, uint32_t count);
- void exfat_flush_cmap(struct exfat* ef);
--int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size);
-+int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size,
-+		bool erase);
- uint32_t exfat_count_free_clusters(const struct exfat* ef);
- int exfat_find_used_sectors(const struct exfat* ef, off_t* a, off_t* b);
- 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/fuse-exfat.git/commitdiff/997c8ed43aec467de10533d027c95fc9d81b6d26



More information about the pld-cvs-commit mailing list