From patchwork Tue Jan 17 22:31:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 9522049 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 6CF426043D for ; Tue, 17 Jan 2017 22:41:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 315E7285A2 for ; Tue, 17 Jan 2017 22:41:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2629328574; Tue, 17 Jan 2017 22:41:40 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 C33CA28574 for ; Tue, 17 Jan 2017 22:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751377AbdAQWlX (ORCPT ); Tue, 17 Jan 2017 17:41:23 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35925 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751059AbdAQWlS (ORCPT ); Tue, 17 Jan 2017 17:41:18 -0500 Received: by mail-wm0-f65.google.com with SMTP id r126so42001204wmr.3 for ; Tue, 17 Jan 2017 14:41:18 -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=U6s5bawXgAqnYE3EZ5XRIWwy7SEVTQ5neMqn7J783Po=; b=pwqFYN0GMpLWe+6oCP7tdYOrNoKOQVb4sQ1OVCTu84V8G42OpOhLi5XrJWwprf8ynz Uj0gnpl1LEiV9QAFjavWkR0+K/HrwgSTjY97/UJOTFERuR5btTbXVM4QUCiBdRnxtYf/ aBLpSaHwfcgiCKc+Y6/y3vvlMIPBac0080HuSZNbcscEeoye2VOzYwgFkzbY9VEX3UhJ jy8sN/KbXKfzORct1zcDRUr/0TQtXrJECa4JRLD+T0l3VZuf9p3ey2ULsY5mbHju0NOT uLfXABngKw3pHsA6MEQlzpT8hq10HgPZnqAQJn+NnGqCtmPFFRpUFQPLb5fcdXZWvXV4 IkYQ== 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=U6s5bawXgAqnYE3EZ5XRIWwy7SEVTQ5neMqn7J783Po=; b=gMD5VpG7pX2Cz64d47WFuvasuXknpSCXjC41cpgQlPJzWWAiYf6eiZ+qFcfo8YC76f MtNR+/h9JSYQWV6YBOo6nZtJqVhfT1IFYW4O51u7XTngQ0uU3+fBcq5oq/wvmGEYlK7D LsRsKPP2ikIuVffyuD5GUw3B6LaSTfGCtD2vC0xt8zdXuws83XCO0FRCz1qOSOuF5TcZ eUsjiADBA6bE5H57kbMG++bXne7c3qF5cDIiXi73KQfZ1HGzP+MAlpNX9zd6MMWZlwxI 9HIbVm/fqrUWaxJbGsz1yfozTFt6Og2QP/z1FVS23i8u4Rv3WsRzbHtd+em7PF6KU11t h2/A== X-Gm-Message-State: AIkVDXIU9A4r9mStB6SpcUQP9qjlh9hWhhxa5Riq53Wb4mDvWPwDzU1RaZ12rBzBYRFp4Q== X-Received: by 10.28.17.20 with SMTP id 20mr288628wmr.99.1484692331859; Tue, 17 Jan 2017 14:32:11 -0800 (PST) Received: from fisk.lan (ivokamhome.ddns.nbis.net. [87.120.136.31]) by smtp.gmail.com with ESMTPSA id w197sm39980489wmd.11.2017.01.17.14.32.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 14:32:11 -0800 (PST) From: Nikolay Borisov To: dsterba@suse.cz Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov Subject: [PATCHv2 07/24] btrfs: Make btrfs_del_inode_ref take btrfs_inode Date: Wed, 18 Jan 2017 00:31:33 +0200 Message-Id: <1484692310-3987-8-git-send-email-n.borisov.lkml@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484692310-3987-1-git-send-email-n.borisov.lkml@gmail.com> References: <20170117161550.GW12081@twin.jikos.cz> <1484692310-3987-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/inode.c | 2 +- fs/btrfs/tree-log.c | 10 +++++----- fs/btrfs/tree-log.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ebfeabafe1b1..e86b08eabb82 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4068,7 +4068,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, } ret = btrfs_del_inode_ref_in_log(trans, root, name, name_len, - inode, dir_ino); + BTRFS_I(inode), dir_ino); if (ret != 0 && ret != -ENOENT) { btrfs_abort_transaction(trans, ret); goto err; diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index caa8d886b4ae..a7705173150e 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3192,25 +3192,25 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, - struct inode *inode, u64 dirid) + struct btrfs_inode *inode, u64 dirid) { struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_root *log; u64 index; int ret; - if (BTRFS_I(inode)->logged_trans < trans->transid) + if (inode->logged_trans < trans->transid) return 0; ret = join_running_log_trans(root); if (ret) return 0; log = root->log_root; - mutex_lock(&BTRFS_I(inode)->log_mutex); + mutex_lock(&inode->log_mutex); - ret = btrfs_del_inode_ref(trans, log, name, name_len, btrfs_ino(BTRFS_I(inode)), + ret = btrfs_del_inode_ref(trans, log, name, name_len, btrfs_ino(inode), dirid, &index); - mutex_unlock(&BTRFS_I(inode)->log_mutex); + mutex_unlock(&inode->log_mutex); if (ret == -ENOSPC) { btrfs_set_log_full_commit(fs_info, trans); ret = 0; diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h index 6c2b316b28e0..bc50f128c6be 100644 --- a/fs/btrfs/tree-log.h +++ b/fs/btrfs/tree-log.h @@ -76,7 +76,7 @@ int btrfs_del_dir_entries_in_log(struct btrfs_trans_handle *trans, int btrfs_del_inode_ref_in_log(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, - struct inode *inode, u64 dirid); + struct btrfs_inode *inode, u64 dirid); void btrfs_end_log_trans(struct btrfs_root *root); int btrfs_pin_log_trans(struct btrfs_root *root); void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans,