From patchwork Fri Feb 17 14:42:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9579961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C6365600F6 for ; Fri, 17 Feb 2017 14:43:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B6436286F4 for ; Fri, 17 Feb 2017 14:43:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAF0D286F6; Fri, 17 Feb 2017 14:43:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5540B286F4 for ; Fri, 17 Feb 2017 14:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934375AbdBQOn4 (ORCPT ); Fri, 17 Feb 2017 09:43:56 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35205 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934293AbdBQOnv (ORCPT ); Fri, 17 Feb 2017 09:43:51 -0500 Received: by mail-wm0-f68.google.com with SMTP id u63so2924747wmu.2 for ; Fri, 17 Feb 2017 06:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=80rZAOAymYiboy8qQmOBEfFu18KL9oQo3h+lLFnyaFo=; b=iE5lXwpmPFK6M6RxTPR+msVxHpFXk/aaXr/LXpRtsqzGCkH4Hzi3FGj0UiXn+OkhQ+ NjjkKrLVH7pNt9MLZ3yWbB9I3XXjs4uez0VmgKqw5jWIzT9uyppjw8J4eS02lvi+s02R FO2HkF0WlW6hSSFzS/vy+HvxclFrSmEAFUrteScGpHGIvDIErl0Y+ubUhQ2TSpDn1anA xC+Le7OwhOauY/lmts0LmTo54GHbvrhav/Y4Dw5Ndi3yhUHs6Uxx/YLOZAH2x/fYXORK piFzUeDiCPJf0OvUzbx48F4U88lgM9laEcnDeFfkd74Vc/GIJVFJpXshIGrk8lcm9srH 9y5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=80rZAOAymYiboy8qQmOBEfFu18KL9oQo3h+lLFnyaFo=; b=C4oBTc57m9fz5yAQTZbEJ0pNGM8ossql/X92y7s9IrtmZpWC4siqO6nqn0ykRUlI9u zzbEB1PkdmCuzdFRDCgaYMgcvliUFB4mBT2psxAyGsDHW4KWqoi8+81Wf55XVGvjx565 O0QNTv2HQvQrmM2Y4NRZ1FZnCUZaIVWob88iNXT42GQunlOVq4URUvzdBv0rOHDMK2hV ymNeZkr66GkJKLf3DM1e98sBGqdID0RYXjIeg/QfdyrwPwgyib4rmY7VDPbIHmjfxuE8 1SaB49WUwb1DGO2LXyaJI12qgqDuADK1gI9mqLymJ072CyLlV6N/no0hKK/5uFTMqkG2 JPxg== X-Gm-Message-State: AMke39n/DuF+e+aHgaxbGJk7XwMccWiU3fUq07tsKXE7dr84YcCNSbnB9RcDJudzzewU4Q== X-Received: by 10.28.11.83 with SMTP id 80mr2397667wml.71.1487342630474; Fri, 17 Feb 2017 06:43:50 -0800 (PST) Received: from fisk.suse.de (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id y126sm1932713wmg.19.2017.02.17.06.43.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 06:43:49 -0800 (PST) From: Nikolay Borisov X-Google-Original-From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCH 03/38] btrfs: make btrfs_set_inode_index_count take btrfs_inode Date: Fri, 17 Feb 2017 16:42:54 +0200 Message-Id: <1487342609-20652-4-git-send-email-nborisov@suse.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487342609-20652-1-git-send-email-nborisov@suse.com> References: <1487342609-20652-1-git-send-email-nborisov@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nikolay Borisov --- fs/btrfs/inode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index f438257be5a0..c8796391eed3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5977,15 +5977,15 @@ static int btrfs_update_time(struct inode *inode, struct timespec *now, * and then set the in-memory index_cnt variable to reflect * free sequence numbers */ -static int btrfs_set_inode_index_count(struct inode *inode) +static int btrfs_set_inode_index_count(struct btrfs_inode *inode) { - struct btrfs_root *root = BTRFS_I(inode)->root; + struct btrfs_root *root = inode->root; struct btrfs_key key, found_key; struct btrfs_path *path; struct extent_buffer *leaf; int ret; - key.objectid = btrfs_ino(BTRFS_I(inode)); + key.objectid = btrfs_ino(inode); key.type = BTRFS_DIR_INDEX_KEY; key.offset = (u64)-1; @@ -6008,7 +6008,7 @@ static int btrfs_set_inode_index_count(struct inode *inode) * else has to start at 2 */ if (path->slots[0] == 0) { - BTRFS_I(inode)->index_cnt = 2; + inode->index_cnt = 2; goto out; } @@ -6017,13 +6017,13 @@ static int btrfs_set_inode_index_count(struct inode *inode) leaf = path->nodes[0]; btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); - if (found_key.objectid != btrfs_ino(BTRFS_I(inode)) || + if (found_key.objectid != btrfs_ino(inode) || found_key.type != BTRFS_DIR_INDEX_KEY) { - BTRFS_I(inode)->index_cnt = 2; + inode->index_cnt = 2; goto out; } - BTRFS_I(inode)->index_cnt = found_key.offset + 1; + inode->index_cnt = found_key.offset + 1; out: btrfs_free_path(path); return ret; @@ -6040,7 +6040,7 @@ int btrfs_set_inode_index(struct inode *dir, u64 *index) if (BTRFS_I(dir)->index_cnt == (u64)-1) { ret = btrfs_inode_delayed_dir_index_count(BTRFS_I(dir)); if (ret) { - ret = btrfs_set_inode_index_count(dir); + ret = btrfs_set_inode_index_count(BTRFS_I(dir)); if (ret) return ret; }