From patchwork Fri Feb 17 14:43:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9580021 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 17CFE600F6 for ; Fri, 17 Feb 2017 14:45:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08086286F7 for ; Fri, 17 Feb 2017 14:45:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F11E0286F9; Fri, 17 Feb 2017 14:45:42 +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 9E564286F7 for ; Fri, 17 Feb 2017 14:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934170AbdBQOpl (ORCPT ); Fri, 17 Feb 2017 09:45:41 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34040 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934443AbdBQOoD (ORCPT ); Fri, 17 Feb 2017 09:44:03 -0500 Received: by mail-wm0-f67.google.com with SMTP id c85so2930827wmi.1 for ; Fri, 17 Feb 2017 06:44:03 -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=U7xOrJq+i+LmmLrjMANft6AshMVvPEM6rot6b9DeUHQ=; b=Qz4op1Zkvf1e4Ef42bGGGa7fQDRTiZ7YHBpojN+G4EiCygSFgyi5/bKXOqeXZDOOFM ZSc5CyTL5GZTNjry8R1EyesufcSZpppOy4xgRU7gXnxV4vCHtbf0zvYhRWYRk5xARMt1 Xeenc21yx+xluspPbfD5mak4D/H99XrHlI81OiqbluuoVN8N5V/QAji2cakDZNsz2ftS sSqF1OIopS12z5NxAh7Jns0lIgRcrCkY9/KUTIsFwGNbV6/TWQpDX5O1OgeItP3hE44Z JiEMXWpmRKsVH+ksbc9ZvIsWkKrPoSzEBgmqTbbNbZO33MyCOaoYPwUmczxRmSfetDcZ FRYQ== 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=U7xOrJq+i+LmmLrjMANft6AshMVvPEM6rot6b9DeUHQ=; b=gjc3ch+4EPhzCp1I5NzfWlq6j/Sa4pawvgI6hhgOumUA0jfEM5k8D2d+J10gZ0qqya IvYxOafVsi1cPmleP7UGJjQuFGkOn29spb5qLSj+W3cHQfeZbxAGSJ+CKpBXG3QW1iHx jxyRyxMw8o438NPq6ct00CyjOqiG5ibP7EmWBkaETKHTIs5/DmXQNV4wDkMLSwvCgOaq RmEsDhauY6Z2u4SJC/y+8YLFktEemS9jrly/zV8eqPMRTerFdaEKXd20LU5jHkz/aANx 0+9teu0X2MzrR47BPDMnrReLU/1gEb1KVCQdn0wuAZCrPANiH29nICSz/slyd0YjAa0K hQSQ== X-Gm-Message-State: AMke39ma9vIWjLj+YUW0Bn86HNzUpEBxHL9Ygz1RxW+P1lAQgqsFBjaBq1msiZAVKvVVCQ== X-Received: by 10.28.228.213 with SMTP id b204mr4099962wmh.59.1487342637512; Fri, 17 Feb 2017 06:43:57 -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.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 06:43:57 -0800 (PST) From: Nikolay Borisov X-Google-Original-From: Nikolay Borisov To: dsterba@suse.com Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov , Nikolay Borisov Subject: [PATCH 10/38] btrfs: Make btrfs_orphan_reserve_metadata take btrfs_inode Date: Fri, 17 Feb 2017 16:43:01 +0200 Message-Id: <1487342609-20652-11-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 From: Nikolay Borisov Signed-off-by: Nikolay Borisov --- fs/btrfs/ctree.h | 2 +- fs/btrfs/extent-tree.c | 10 +++++----- fs/btrfs/inode.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 76e661d00822..52af63e1d9a0 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2695,7 +2695,7 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, struct btrfs_fs_info *fs_info); void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans); int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, - struct inode *inode); + struct btrfs_inode *inode); void btrfs_orphan_release_metadata(struct inode *inode); int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, struct btrfs_block_rsv *rsv, diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 781dfdf5556e..8ef37c85a601 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5742,10 +5742,10 @@ void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans) /* Can only return 0 or -ENOSPC */ int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, - struct inode *inode) + struct btrfs_inode *inode) { - struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); - struct btrfs_root *root = BTRFS_I(inode)->root; + struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb); + struct btrfs_root *root = inode->root; /* * We always use trans->block_rsv here as we will have reserved space * for our orphan when starting the transaction, using get_block_rsv() @@ -5762,8 +5762,8 @@ int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, */ u64 num_bytes = btrfs_calc_trans_metadata_size(fs_info, 1); - trace_btrfs_space_reservation(fs_info, "orphan", - btrfs_ino(BTRFS_I(inode)), num_bytes, 1); + trace_btrfs_space_reservation(fs_info, "orphan", btrfs_ino(inode), + num_bytes, 1); return btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes, 1); } diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index fcdff1023718..cb5a4cc069a9 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3221,7 +3221,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) /* grab metadata reservation from transaction handle */ if (reserve) { - ret = btrfs_orphan_reserve_metadata(trans, inode); + ret = btrfs_orphan_reserve_metadata(trans, BTRFS_I(inode)); ASSERT(!ret); if (ret) { atomic_dec(&root->orphan_inodes);