From patchwork Mon Jul 1 19:17:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 256212 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 38BC72C008F for ; Tue, 2 Jul 2013 05:35:43 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9B0F24A127; Mon, 1 Jul 2013 21:35:17 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cLkGaS+x1n7P; Mon, 1 Jul 2013 21:35:17 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33D854A128; Mon, 1 Jul 2013 21:34:43 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 67D9E4A028 for ; Mon, 1 Jul 2013 21:23:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mOHrhuUQVRtS for ; Mon, 1 Jul 2013 21:23:53 +0200 (CEST) X-Greylist: delayed 441 seconds by postgrey-1.27 at theia; Mon, 01 Jul 2013 21:23:40 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.102]) by theia.denx.de (Postfix) with ESMTP id 259B94A0B7 for ; Mon, 1 Jul 2013 21:23:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id 43AF7337653 for ; Mon, 1 Jul 2013 21:16:24 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kmu-office.ch Received: from mail.kmu-office.ch ([127.0.0.1]) by localhost (mail.kmu-office.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KytspLBKV+8d for ; Mon, 1 Jul 2013 21:16:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.kmu-office.ch (Postfix) with ESMTP id BF3073378B6 for ; Mon, 1 Jul 2013 21:16:23 +0200 (CEST) Received: from webmail.kmu-office.ch (unknown [178.209.48.103]) (Authenticated sender: stefan@agner.ch) by mail.kmu-office.ch (Postfix) with ESMTPSA id AF333337653 for ; Mon, 1 Jul 2013 21:16:23 +0200 (CEST) MIME-Version: 1.0 Date: Mon, 01 Jul 2013 21:17:09 +0200 From: Stefan Agner To: u-boot@lists.denx.de Message-ID: <49f547ebb6030eea9bb11b5eb7cc7bb5@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/0.9.1 X-Mailman-Approved-At: Mon, 01 Jul 2013 21:34:37 +0200 Subject: [U-Boot] =?utf-8?q?=5BPATCH_3/3=5D_btrfs=3A_removed_btrfs=5Fmangl?= =?utf-8?q?e=5Fname?= X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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;