From: Herbert Poetzl Subject: Re: [RFC][PATCH 11/27] sys_symlinkat() collapse one more if () Date: Thu, 8 Jun 2006 12:49:41 +0200 Message-ID: <20060608104941.GG11996@MAIL.13thfloor.at> References: <20060608001013.0D041507@localhost.localdomain> <20060608001023.6189AD37@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, viro@ftp.linux.org.uk, hch@infradead.org, trond.myklebust@fys.uio.no Return-path: Received: from MAIL.13thfloor.at ([212.16.62.50]:34184 "EHLO mail.13thfloor.at") by vger.kernel.org with ESMTP id S932220AbWFHKtm (ORCPT ); Thu, 8 Jun 2006 06:49:42 -0400 To: Dave Hansen Content-Disposition: inline In-Reply-To: <20060608001023.6189AD37@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Jun 07, 2006 at 05:10:23PM -0700, Dave Hansen wrote: > > Collapse another if() to make way for a new condition. > > This patch should make no functional changes. Acked-by: Herbert Poetzl > Signed-off-by: Dave Hansen > --- > > lxc-dave/fs/namei.c | 10 ++++++---- > 1 files changed, 6 insertions(+), 4 deletions(-) > > diff -puN fs/namei.c~elevate-writers-vfs_symlink-part2 fs/namei.c > --- lxc/fs/namei.c~elevate-writers-vfs_symlink-part2 2006-06-07 16:53:18.000000000 -0700 > +++ lxc-dave/fs/namei.c 2006-06-07 16:53:18.000000000 -0700 > @@ -2186,10 +2186,12 @@ asmlinkage long sys_symlinkat(const char > goto out; > dentry = lookup_create(&nd, 0); > error = PTR_ERR(dentry); > - if (!IS_ERR(dentry)) { > - error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO); > - dput(dentry); > - } > + if (IS_ERR(dentry)) > + goto out_unlock; > + > + error = vfs_symlink(nd.dentry->d_inode, dentry, from, S_IALLUGO); > + dput(dentry); > +out_unlock: > mutex_unlock(&nd.dentry->d_inode->i_mutex); > path_release(&nd); > out: > _