From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YW8cL-000825-BF for mharc-qemu-trivial@gnu.org; Thu, 12 Mar 2015 15:18:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW8cI-00081O-QC for qemu-trivial@nongnu.org; Thu, 12 Mar 2015 15:17:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YW8cD-0001BX-Df for qemu-trivial@nongnu.org; Thu, 12 Mar 2015 15:17:58 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:37803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW8cC-0001B1-Rb for qemu-trivial@nongnu.org; Thu, 12 Mar 2015 15:17:53 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Mar 2015 00:47:48 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 13 Mar 2015 00:47:46 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 48D9E125842B; Thu, 12 Mar 2015 19:03:45 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay03.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2CDQq0E23199812; Thu, 12 Mar 2015 19:02:17 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2C9sFw3026693; Thu, 12 Mar 2015 15:24:15 +0530 Received: from skywalker.linux.vnet.ibm.com (skywalker.in.ibm.com [9.193.66.152]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t2C9s0Ug025577 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 12 Mar 2015 15:24:08 +0530 From: "Aneesh Kumar K.V" To: Michael Tokarev , qemu-devel@nongnu.org In-Reply-To: <1426143150-5641-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1426143150-5641-1-git-send-email-mjt@msgid.tls.msk.ru> User-Agent: Notmuch/0.19+30~gd241a48 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 12 Mar 2015 15:23:55 +0530 Message-ID: <8761a6bky4.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15031219-0025-0000-0000-000003C03742 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 122.248.162.7 Cc: qemu-trivial@nongnu.org, Michael Tokarev Subject: Re: [Qemu-trivial] [PATCH v2] 9pfs-local: simplify/optimize local_mapped_attr_path() X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 19:17:59 -0000 Michael Tokarev writes: > Omit one unnecessary memory allocation for components > of the path and create the resulting path directly given > lengths of the components. > > Do not use basename(3) because there are 2 versions of > this function which differs when argument ends with > slash character, use strrchr() instead so we have > consistent result. This also makes sure the function > will do the right thing in corner cases (eg, empty > pathname is given), when basename(3) return entirely > another string. > > Signed-off-by: Michael Tokarev Applied. Thanks -aneesh From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW8cO-00085X-JP for qemu-devel@nongnu.org; Thu, 12 Mar 2015 15:18:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YW8cD-0001Bc-EU for qemu-devel@nongnu.org; Thu, 12 Mar 2015 15:18:04 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:37804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW8cC-0001B2-SB for qemu-devel@nongnu.org; Thu, 12 Mar 2015 15:17:53 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Mar 2015 00:47:48 +0530 From: "Aneesh Kumar K.V" In-Reply-To: <1426143150-5641-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1426143150-5641-1-git-send-email-mjt@msgid.tls.msk.ru> Date: Thu, 12 Mar 2015 15:23:55 +0530 Message-ID: <8761a6bky4.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2] 9pfs-local: simplify/optimize local_mapped_attr_path() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org Michael Tokarev writes: > Omit one unnecessary memory allocation for components > of the path and create the resulting path directly given > lengths of the components. > > Do not use basename(3) because there are 2 versions of > this function which differs when argument ends with > slash character, use strrchr() instead so we have > consistent result. This also makes sure the function > will do the right thing in corner cases (eg, empty > pathname is given), when basename(3) return entirely > another string. > > Signed-off-by: Michael Tokarev Applied. Thanks -aneesh