From patchwork Tue Jan 10 18:35:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9508303 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 2A0046075F for ; Tue, 10 Jan 2017 18:36:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F96028596 for ; Tue, 10 Jan 2017 18:36:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 146E02859E; Tue, 10 Jan 2017 18:36:25 +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 93EBE28596 for ; Tue, 10 Jan 2017 18:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938508AbdAJSf7 (ORCPT ); Tue, 10 Jan 2017 13:35:59 -0500 Received: from mail-wj0-f193.google.com ([209.85.210.193]:33026 "EHLO mail-wj0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbdAJSf6 (ORCPT ); Tue, 10 Jan 2017 13:35:58 -0500 Received: by mail-wj0-f193.google.com with SMTP id kp2so88396212wjc.0 for ; Tue, 10 Jan 2017 10:35:57 -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=2MS+263gSenhO4t39MjUA8S0rwdtnZPrhBGtQYzZvyA=; b=HkU8Vurx1I4iuUmPZ1G4jdyeOJhY7yJ1/vAr9yW2IeGST8IyCQ3blyMIJPaon9RTzB 5577FC9i5GE3jgbweR6OvlCFo3iUgDp8uh+3521Na4izLrxQbyRAZQpHIbBRmqnDciId CS9hEMkh6Z2NKCHL7HgosRvcq/7Wp3Ua6fTWaNOZWKYLGOSnF8txvJ/JPczckjVUjKKp joijz2uKKtUJU0IFS6R2UHF9wrv9Ii42ACsJcqXdGi5wmHXrvLw8J64ECZkrdOSZBAFo sopCDX/yqO2pOi5CL7OmfH9qkj1SbUyiT9a7s05+w15PTsgDZyHQsRfdQphVHIasIN9q j2Bw== 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=2MS+263gSenhO4t39MjUA8S0rwdtnZPrhBGtQYzZvyA=; b=JLzTosG3lWH1nA6VlXn7XZFxbBou6XA4ycl2Rh+cxOlM/h3aZUicQH1A79U9C4mh/r FviZtntfZg2k1/IQgZhy/nlzeQJAQ/R7Eai0qfV2qKVLXL/28yw3iwqv74ubMh8FAKAt KxJq4Nz8zRwJL1D2pXIj3pvHWAyzbGACexDmIZ7yNMgi3fb1a3FEbtAYSx7DOEumtCbX sKw2+p/Ax/XYnsGRWN8YFCbuq0K9HdDXw+LGFI3yyAC3XNFlSdBZIcLC4S09ACoLCOqg CBwT7ZhlGt2FK2UpeScJ+pCEKrU4G9mTuYj2FmzWIt0EaFU2VauaDXXyfQSV4mv6eFpS kl0w== X-Gm-Message-State: AIkVDXLBLexkRKU8c7JJGhWpB+sFpQMC0La4WIbWbmF6Nysn/w95ctAnfPQDb1NbdAltBA== X-Received: by 10.194.59.98 with SMTP id y2mr2564177wjq.166.1484073356856; Tue, 10 Jan 2017 10:35:56 -0800 (PST) Received: from fisk.lan (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id jm6sm4572626wjb.27.2017.01.10.10.35.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Jan 2017 10:35:56 -0800 (PST) From: Nikolay Borisov To: linux-btrfs@vger.kernel.org Cc: Nikolay Borisov Subject: [PATCH 04/12] btrfs: Make btrfs_delayed_inode_reserve_metadata take btrfs_inode Date: Tue, 10 Jan 2017 20:35:34 +0200 Message-Id: <1484073342-28854-5-git-send-email-n.borisov.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484073342-28854-1-git-send-email-n.borisov.lkml@gmail.com> References: <1484073342-28854-1-git-send-email-n.borisov.lkml@gmail.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/delayed-inode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 4059b4168210..7be90eb978d5 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -572,7 +572,7 @@ static void btrfs_delayed_item_release_metadata(struct btrfs_fs_info *fs_info, static int btrfs_delayed_inode_reserve_metadata( struct btrfs_trans_handle *trans, struct btrfs_root *root, - struct inode *inode, + struct btrfs_inode *inode, struct btrfs_delayed_node *node) { struct btrfs_fs_info *fs_info = root->fs_info; @@ -601,13 +601,13 @@ static int btrfs_delayed_inode_reserve_metadata( * worth which is less likely to hurt us. */ if (src_rsv && src_rsv->type == BTRFS_BLOCK_RSV_DELALLOC) { - spin_lock(&BTRFS_I(inode)->lock); + spin_lock(&inode->lock); if (test_and_clear_bit(BTRFS_INODE_DELALLOC_META_RESERVED, - &BTRFS_I(inode)->runtime_flags)) + &inode->runtime_flags)) release = true; else src_rsv = NULL; - spin_unlock(&BTRFS_I(inode)->lock); + spin_unlock(&inode->lock); } /* @@ -635,7 +635,7 @@ static int btrfs_delayed_inode_reserve_metadata( node->bytes_reserved = num_bytes; trace_btrfs_space_reservation(fs_info, "delayed_inode", - btrfs_ino(BTRFS_I(inode)), + btrfs_ino(inode), num_bytes, 1); } return ret; @@ -658,13 +658,13 @@ static int btrfs_delayed_inode_reserve_metadata( */ if (!ret) { trace_btrfs_space_reservation(fs_info, "delayed_inode", - btrfs_ino(BTRFS_I(inode)), num_bytes, 1); + btrfs_ino(inode), num_bytes, 1); node->bytes_reserved = num_bytes; } if (release) { trace_btrfs_space_reservation(fs_info, "delalloc", - btrfs_ino(BTRFS_I(inode)), num_bytes, 0); + btrfs_ino(inode), num_bytes, 0); btrfs_block_rsv_release(fs_info, src_rsv, num_bytes); } @@ -1839,7 +1839,7 @@ int btrfs_delayed_update_inode(struct btrfs_trans_handle *trans, goto release_node; } - ret = btrfs_delayed_inode_reserve_metadata(trans, root, inode, + ret = btrfs_delayed_inode_reserve_metadata(trans, root, BTRFS_I(inode), delayed_node); if (ret) goto release_node;