From patchwork Tue Apr 29 23:32:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 344025 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 056721400E9 for ; Wed, 30 Apr 2014 09:32:45 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751636AbaD2Xcm (ORCPT ); Tue, 29 Apr 2014 19:32:42 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34504 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751286AbaD2Xcl (ORCPT ); Tue, 29 Apr 2014 19:32:41 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 46162AD13; Tue, 29 Apr 2014 23:32:40 +0000 (UTC) Received: by quack.suse.cz (Postfix, from userid 1000) id 252A480BAA; Wed, 30 Apr 2014 01:32:39 +0200 (CEST) From: Jan Kara To: T Makphaibulchoke Cc: linux-ext4@vger.kernel.org, Jan Kara Subject: [PATCH 1/2] ext4: Use sbi in ext4_orphan_del() Date: Wed, 30 Apr 2014 01:32:32 +0200 Message-Id: <1398814353-11904-2-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1398814353-11904-1-git-send-email-jack@suse.cz> References: <1398814353-11904-1-git-send-email-jack@suse.cz> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Use sbi pointer consistently in ext4_orphan_del() instead of opencoding it sometimes. Signed-off-by: Jan Kara --- fs/ext4/namei.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 1cb84f78909e..411957326827 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2622,22 +2622,20 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode) { struct list_head *prev; struct ext4_inode_info *ei = EXT4_I(inode); - struct ext4_sb_info *sbi; + struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); __u32 ino_next; struct ext4_iloc iloc; int err = 0; - if ((!EXT4_SB(inode->i_sb)->s_journal) && - !(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_ORPHAN_FS)) + if (!sbi->s_journal && !(sbi->s_mount_state & EXT4_ORPHAN_FS)) return 0; - mutex_lock(&EXT4_SB(inode->i_sb)->s_orphan_lock); + mutex_lock(&sbi->s_orphan_lock); if (list_empty(&ei->i_orphan)) goto out; ino_next = NEXT_ORPHAN(inode); prev = ei->i_orphan.prev; - sbi = EXT4_SB(inode->i_sb); jbd_debug(4, "remove inode %lu from orphan list\n", inode->i_ino); @@ -2683,7 +2681,7 @@ int ext4_orphan_del(handle_t *handle, struct inode *inode) out_err: ext4_std_error(inode->i_sb, err); out: - mutex_unlock(&EXT4_SB(inode->i_sb)->s_orphan_lock); + mutex_unlock(&sbi->s_orphan_lock); return err; out_brelse: