Patchwork [U-Boot,3/3] btrfs: removed btrfs_mangle_name

login
register
mail settings
Submitter Stefan Agner
Date July 1, 2013, 7:17 p.m.
Message ID <49f547ebb6030eea9bb11b5eb7cc7bb5@agner.ch>
Download mbox | patch
Permalink /patch/256212/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Stefan Agner - July 1, 2013, 7:17 p.m.
The function btrfs_mangle_name limited path lenght to 20 characters. 
Since
the command parsing already checks spaces, the function is not needed at 
all.
---
  fs/btrfs/btrfs.c | 44 +-------------------------------------------
  1 file changed, 1 insertion(+), 43 deletions(-)

Patch

diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
index e4dfd67..84184f1 100644
--- a/fs/btrfs/btrfs.c
+++ b/fs/btrfs/btrfs.c
@@ -906,46 +906,6 @@  void btrfs_close_file(struct file *file)
  	free_file(file);
  }

-void btrfs_mangle_name(char *dst, const char *src)
-{
-	char *p = dst, ch, len;
-	int i = BTRFS_FILENAME_MAX-1;
-
-	len = strlen(src);
-	ch = *src;
-	while (!isspace(ch)) {
-		if (*src == '/') {
-			if (src[1] == '/') {
-				src++;
-				i--;
-				continue;
-			}
-		}
-		if (!len)
-			break;
-		i--;
-		len--;
-		*dst++ = *src++;
-		ch = *src;
-	}
-	while (1) {
-		if (dst == p)
-			break;
-		if (dst[-1] != '/')
-			break;
-		if ((dst[-1] == '/') && ((dst - 1) == p))
-			break;
-
-		dst--;
-		i++;
-	}
-
-	i++;
-	for (; i > 0; i--)
-		*dst++ = '\0';
-
-}
-
  int searchdir(const char *name)
  {
  	struct inode *inode = NULL;
@@ -1088,10 +1048,8 @@  int btrfs_open_file(const char *name, struct 
com32_filedata *filedata)
  {
  	int rv;
  	struct file *file;
-	char mangled_name[BTRFS_FILENAME_MAX];

-	btrfs_mangle_name(mangled_name, name);
-	rv = searchdir(mangled_name);
+	rv = searchdir(name);
  	if (rv < 0)
  		return rv;