public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] btrfs: removed btrfs_mangle_name
Date: Mon, 01 Jul 2013 21:17:09 +0200	[thread overview]
Message-ID: <49f547ebb6030eea9bb11b5eb7cc7bb5@agner.ch> (raw)

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(-)

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;

-- 
1.8.3.1

                 reply	other threads:[~2013-07-01 19:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49f547ebb6030eea9bb11b5eb7cc7bb5@agner.ch \
    --to=stefan@agner.ch \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox