From patchwork Fri Feb 17 14:43:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9580033 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 6171C600F6 for ; Fri, 17 Feb 2017 14:46:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51BF1286F4 for ; Fri, 17 Feb 2017 14:46:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46977286F6; Fri, 17 Feb 2017 14:46:03 +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 DF6E8286F4 for ; Fri, 17 Feb 2017 14:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934206AbdBQOp5 (ORCPT ); Fri, 17 Feb 2017 09:45:57 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35265 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934381AbdBQOn7 (ORCPT ); Fri, 17 Feb 2017 09:43:59 -0500 Received: by mail-wm0-f68.google.com with SMTP id u63so2925462wmu.2 for ; Fri, 17 Feb 2017 06:43:59 -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=DrvEogqqmL5Q+86AEqUv62jhcgy9NV+gFxfpWhiP86o=; b=i/rppcFOWWhamSDZuNwqOOon4yxBSqnAIHBsey884an8R3nWAPgIzzgzqqXyOpyPSo O51gnXFpFRQHyrlxJ9p8wwdB7QQk9nd6+dpLHP73BEc99w35y/4QGKLsDEXz4lm06pt1 szR2ICP7a/f4ezHw8tqw84R2uCJi9TAvOL/LgAUhhJEa6koHME2QJNEY8dIlaOp/uSWU QZjPXtNuf71IUXIe0LGkR7NK3eRmqsnJ1G5dPBVze1sEN6715GBhMj/K9erU8G8aeIIN Pcj8vQiBAEQcFJ6Ldiz8hxoSrZf6818K8e01sjBlMpNW1RYMEtsrc54wHvAvbEDEWZf/ F1jA== 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=DrvEogqqmL5Q+86AEqUv62jhcgy9NV+gFxfpWhiP86o=; b=Nwrr+U7vhymBRrj6h6CAt0EnH3l0671FLYDUewTc4aSt1bZR8ag8PgUvv+jjc3UNSG z+HkkKAu81P1QoCumJWsrdkVHNmy1GVSdZaSHHeKRNzz43gBuPY8fQEEQ7fYhqI+DTYb f1U6258DQiRfSMjnyqpG/H87j8bw18zymIYxJ+NcTU73ZdNFdqiKPhAL/s6U4pHWfWnq L9N41q7HpHnpUQaNvsEKt+6K+geoJVRnnQ+yunMLxtza07V6TtVadOSrlRpk3YyZ1uYt PiFnzbNJKN7jFliWo+P6wvqi/vnUAq8sZZ16k6Qi/6/zNoFbEn1i3i5fgytDMcQCVwS/ f7kA== X-Gm-Message-State: AMke39lWEg3CTBA3iHQt58uAYwufEmP3m46pOsclR9A+xYcu4G3bLrhQXt0i2oXBUM+y3A== X-Received: by 10.28.48.78 with SMTP id w75mr4219204wmw.55.1487342638415; Fri, 17 Feb 2017 06:43:58 -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.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Feb 2017 06:43:58 -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 11/38] btrfs: Make btrfs_orphan_release_metadata take btrfs_inode Date: Fri, 17 Feb 2017 16:43:02 +0200 Message-Id: <1487342609-20652-12-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 | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 52af63e1d9a0..8eb07a9dfa6a 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2696,7 +2696,7 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans); int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, struct btrfs_inode *inode); -void btrfs_orphan_release_metadata(struct inode *inode); +void btrfs_orphan_release_metadata(struct btrfs_inode *inode); int btrfs_subvolume_reserve_metadata(struct btrfs_root *root, struct btrfs_block_rsv *rsv, int nitems, diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 8ef37c85a601..f3ee86e178bb 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -5767,14 +5767,14 @@ int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, return btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes, 1); } -void btrfs_orphan_release_metadata(struct inode *inode) +void btrfs_orphan_release_metadata(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; 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, 0); + trace_btrfs_space_reservation(fs_info, "orphan", btrfs_ino(inode), + num_bytes, 0); btrfs_block_rsv_release(fs_info, root->orphan_block_rsv, num_bytes); } diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index cb5a4cc069a9..4b8ba233d20e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3243,7 +3243,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) if (reserve) { clear_bit(BTRFS_INODE_ORPHAN_META_RESERVED, &BTRFS_I(inode)->runtime_flags); - btrfs_orphan_release_metadata(inode); + btrfs_orphan_release_metadata(BTRFS_I(inode)); } if (ret != -EEXIST) { clear_bit(BTRFS_INODE_HAS_ORPHAN_ITEM, @@ -3297,7 +3297,7 @@ static int btrfs_orphan_del(struct btrfs_trans_handle *trans, } if (release_rsv) - btrfs_orphan_release_metadata(inode); + btrfs_orphan_release_metadata(BTRFS_I(inode)); return ret; }