From patchwork Fri Feb 17 14:42:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9579959 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 8EEF9600F6 for ; Fri, 17 Feb 2017 14:43:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F627286F4 for ; Fri, 17 Feb 2017 14:43:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7454E286F6; Fri, 17 Feb 2017 14:43:54 +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 DF034286F4 for ; Fri, 17 Feb 2017 14:43:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934345AbdBQOnw (ORCPT ); Fri, 17 Feb 2017 09:43:52 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35199 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934311AbdBQOnu (ORCPT ); Fri, 17 Feb 2017 09:43:50 -0500 Received: by mail-wm0-f66.google.com with SMTP id u63so2924704wmu.2 for ; Fri, 17 Feb 2017 06:43:50 -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=0lIeP7ErwcNE0wgn7K18nUelU+DSo+OYyA+CfrUaPbc=; b=DON7APOnOG6iBfQe74XcLjbSV3pN5yXAHIJVQq8R34v4ad3ogC7RIc/jQ+CddaCcvl v/cZZs3W05AW9/wqJ2yh4+mPXWvOEGLNzozcWsJUzwIYc4gIEmnlnkRNehH6i9iWrq4J enN8tIPC5xt0eZb+WYmJwFh7C7y4sfjtOqEP7ZqAWsBZUQUCkHwABExoUnVlluhdZcup xSdWEUG5GkIf2scAWB43TUbPE0JUhFTLbumkd1sNZFhWvc0ozF3H2xntouY+EY6zhbR2 CdTYtWibr/chHsbDbOtIl0A1FjCdJJaV13LwU2xpAi8YwgvbOh5N+IAjqLq/xIos7VeN D8gw== 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=0lIeP7ErwcNE0wgn7K18nUelU+DSo+OYyA+CfrUaPbc=; b=iYRUo+nB5a4mZcMqXeHNW4VfGlon5WFUB8rjh7WaTL4dbXVF7BF4+BNgnbjTqio0al /XlcNoTB18dzdtfrO0tpKSXoCQAt39mw+bSBqpDKqJ/Hq3E+ZhWiO/dw96frgX2Y3OSd OkA4bS1NxY+zex8KIyfr5BluQH0qfPD8W5NNx84Y1pxj4HornQ5gIP8SZ0M47j/AfVhv kUxxy9Fdj4RVSXRKCRphnaVWSo3aznfzhzEtezQEyqXbA4nyf9PaaT0D3ksm5QOzVKzf RpLf9x+sHIZuYL90YZk1FiPU5kMq3Evq3wCsD/V7o8/ut4ecYkBOVBKPZOdWoqOpZWQj SalA== X-Gm-Message-State: AMke39nML/XZvK95CYown5hcfeHx3GapnTQ9xb6UhyOOgJ6qIDutlPuLAitkLg5xo3txfg== X-Received: by 10.28.197.142 with SMTP id v136mr4025373wmf.62.1487342629524; Fri, 17 Feb 2017 06:43:49 -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.48 (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 02/38] btrfs: Make btrfs_insert_dir_item take btrfs_inode Date: Fri, 17 Feb 2017 16:42:53 +0200 Message-Id: <1487342609-20652-3-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/ctree.h | 2 +- fs/btrfs/dir-item.c | 6 +++--- fs/btrfs/inode.c | 2 +- fs/btrfs/ioctl.c | 2 +- fs/btrfs/transaction.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index ad23a73ac7e7..97f84a80b479 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2982,7 +2982,7 @@ int btrfs_check_dir_item_collision(struct btrfs_root *root, u64 dir, const char *name, int name_len); int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, - int name_len, struct inode *dir, + int name_len, struct btrfs_inode *dir, struct btrfs_key *location, u8 type, u64 index); struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index 724504a2d7ac..34eff5d46eca 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c @@ -120,7 +120,7 @@ int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans, */ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, - struct inode *dir, struct btrfs_key *location, + struct btrfs_inode *dir, struct btrfs_key *location, u8 type, u64 index) { int ret = 0; @@ -133,7 +133,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root struct btrfs_disk_key disk_key; u32 data_size; - key.objectid = btrfs_ino(BTRFS_I(dir)); + key.objectid = btrfs_ino(dir); key.type = BTRFS_DIR_ITEM_KEY; key.offset = btrfs_name_hash(name, name_len); @@ -174,7 +174,7 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root btrfs_release_path(path); ret2 = btrfs_insert_delayed_dir_index(trans, root->fs_info, name, - name_len, BTRFS_I(dir), &disk_key, type, index); + name_len, dir, &disk_key, type, index); out_free: btrfs_free_path(path); if (ret) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 956df76dc235..f438257be5a0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6275,7 +6275,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, return ret; ret = btrfs_insert_dir_item(trans, root, name, name_len, - parent_inode, &key, + BTRFS_I(parent_inode), &key, btrfs_inode_type(inode), index); if (ret == -EEXIST || ret == -EOVERFLOW) goto fail_dir_item; diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 717f34f977d5..952762582b3d 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -587,7 +587,7 @@ static noinline int create_subvol(struct inode *dir, } ret = btrfs_insert_dir_item(trans, root, - name, namelen, dir, &key, + name, namelen, BTRFS_I(dir), &key, BTRFS_FT_DIR, index); if (ret) { btrfs_abort_transaction(trans, ret); diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 6b3e0fc2fe7a..294563216dd3 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1644,7 +1644,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, ret = btrfs_insert_dir_item(trans, parent_root, dentry->d_name.name, dentry->d_name.len, - parent_inode, &key, + BTRFS_I(parent_inode), &key, BTRFS_FT_DIR, index); /* We have check then name at the beginning, so it is impossible. */ BUG_ON(ret == -EEXIST || ret == -EOVERFLOW);