Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3419791yba; Tue, 16 Apr 2019 10:57:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyUZLwTkXmVGgQNi0ZOwCuK6c/MCVPTAPyIxDPxLw7VAneChi2ff1JDMrguJ+x5FwUK9zC X-Received: by 2002:a62:4554:: with SMTP id s81mr56070364pfa.66.1555437430045; Tue, 16 Apr 2019 10:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555437430; cv=none; d=google.com; s=arc-20160816; b=VbvrFq8wtPyYbpo+AveJaBZKSXanENaGrIeXGcGrJ9mBHhrQOzLQRiBPFOxJuZ1Bui OV/C1vN0QCzsxaT5lx6uAMiTYuV/fc8NoTx/X9ujDPAmnO6kOlG7YkGQPCMLreVT6v11 m5eUTEXTSjoBqXhmpQJfeJPt5Ro8GNYsrtPCi/gpn1vTyky+3psUN/fV/dIG4GKcZxbY CXp6QR9/797372T29Y5adQ7lY9aj5dRfcs1l29mJVLCc0LykwBWOqYWRpuYVDn1MMouU 5OhGtKVxd3tt8WqtKasKRLTLM1yoOFbfdRxO3X8c56Zn/yKiQjQMztBIFNLqiIJVR9A9 AqCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MbNVlLrBIyR/9XySkcysqIRwvr1M8w/7Cr7XVWKninE=; b=kJ2McNAuEglvSkpfi6FMAkWwTXnOM5PQLUW+UDxxmY8AgdW457hKk+wWLJ6uHGtQsJ qm33CuajwMU4JFiKj5TWGdmsMPdHsQa0ctE+ZJvsX2zyIzzK/8rBY/WixRzPUXOULADr F+MLPXTcSpOVfcixx5bICXc/J0664tOFIZ6v9rjGY1NYOu2sMDceaVcv+vd9X7HheEgF EPZbKGV2Kd+U/oIQBQvIHAbzWltoM1o2RdqEqjrWLc2XHZP/Wxo0waMvvjlOrBH0p3Is bBxIqlMa2cciJ1uwkso8hLquvza6slJlDpELMMqT/0R3Aih3gPLyojyBiLTqCoq69B/f CGcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si21843860pfc.100.2019.04.16.10.56.54; Tue, 16 Apr 2019 10:57:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730677AbfDPRzm (ORCPT + 99 others); Tue, 16 Apr 2019 13:55:42 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:57674 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730335AbfDPRxt (ORCPT ); Tue, 16 Apr 2019 13:53:49 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hGSHD-0005ZH-AP; Tue, 16 Apr 2019 17:53:47 +0000 From: Al Viro To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH 48/62] ntfs: switch to ->free_inode() Date: Tue, 16 Apr 2019 18:53:26 +0100 Message-Id: <20190416175340.21068-48-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190416175340.21068-1-viro@ZenIV.linux.org.uk> References: <20190416174900.GT2217@ZenIV.linux.org.uk> <20190416175340.21068-1-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro move the synchronous stuff from ->destroy_inode() to ->evict_inode(), turn the RCU-delayed part into ->free_inode() Signed-off-by: Al Viro --- fs/ntfs/inode.c | 17 ++++------------- fs/ntfs/inode.h | 2 +- fs/ntfs/super.c | 2 +- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index bd3221cbdd95..fb1a2b49a5da 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -332,23 +332,11 @@ struct inode *ntfs_alloc_big_inode(struct super_block *sb) return NULL; } -static void ntfs_i_callback(struct rcu_head *head) +void ntfs_free_big_inode(struct inode *inode) { - struct inode *inode = container_of(head, struct inode, i_rcu); kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode)); } -void ntfs_destroy_big_inode(struct inode *inode) -{ - ntfs_inode *ni = NTFS_I(inode); - - ntfs_debug("Entering."); - BUG_ON(ni->page); - if (!atomic_dec_and_test(&ni->count)) - BUG(); - call_rcu(&inode->i_rcu, ntfs_i_callback); -} - static inline ntfs_inode *ntfs_alloc_extent_inode(void) { ntfs_inode *ni; @@ -2287,6 +2275,9 @@ void ntfs_evict_big_inode(struct inode *vi) ni->ext.base_ntfs_ino = NULL; } } + BUG_ON(ni->page); + if (!atomic_dec_and_test(&ni->count)) + BUG(); return; } diff --git a/fs/ntfs/inode.h b/fs/ntfs/inode.h index b3c3469de6cb..58c8fd2948d3 100644 --- a/fs/ntfs/inode.h +++ b/fs/ntfs/inode.h @@ -278,7 +278,7 @@ extern struct inode *ntfs_index_iget(struct inode *base_vi, ntfschar *name, u32 name_len); extern struct inode *ntfs_alloc_big_inode(struct super_block *sb); -extern void ntfs_destroy_big_inode(struct inode *inode); +extern void ntfs_free_big_inode(struct inode *inode); extern void ntfs_evict_big_inode(struct inode *vi); extern void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni); diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index bb7159f697f2..887ea8b3b000 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -2676,7 +2676,7 @@ static int ntfs_write_inode(struct inode *vi, struct writeback_control *wbc) */ static const struct super_operations ntfs_sops = { .alloc_inode = ntfs_alloc_big_inode, /* VFS: Allocate new inode. */ - .destroy_inode = ntfs_destroy_big_inode, /* VFS: Deallocate inode. */ + .free_inode = ntfs_free_big_inode, /* VFS: Deallocate inode. */ #ifdef NTFS_RW .write_inode = ntfs_write_inode, /* VFS: Write dirty inode to disk. */ -- 2.11.0