[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191130020225.20239-2-yukuai3@huawei.com>
Date: Sat, 30 Nov 2019 10:02:23 +0800
From: yu kuai <yukuai3@...wei.com>
To: <gregkh@...uxfoundation.org>, <rafael@...nel.org>,
<viro@...iv.linux.org.uk>, <rostedt@...dmis.org>,
<oleg@...hat.com>, <mchehab+samsung@...nel.org>, <corbet@....net>,
<tytso@....edu>, <jmorris@...ei.org>
CC: <linux-kernel@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
<yukuai3@...wei.com>, <zhengbin13@...wei.com>,
<yi.zhang@...wei.com>, <chenxiang66@...ilicon.com>,
<xiexiuqi@...wei.com>
Subject: [PATCH V2 1/3] dcache: add a new enum type for 'dentry_d_lock_class'
'dentry_d_lock_class' can be used for spin_lock_nested in case lockdep
confused about two different dentry take the 'd_lock'.
However, a single 'DENTRY_D_LOCK_NESTED' may not be enough if more than
two dentry are involed. So, add in 'DENTRY_D_LOCK_NESTED_TWICE'.
Signed-off-by: yu kuai <yukuai3@...wei.com>
---
include/linux/dcache.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 10090f11ab95..830405b401ce 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -129,7 +129,16 @@ struct dentry {
enum dentry_d_lock_class
{
DENTRY_D_LOCK_NORMAL, /* implicitly used by plain spin_lock() APIs. */
- DENTRY_D_LOCK_NESTED
+ /*
+ * used by spin_lock_nested when two d_lock need to be taken
+ * at the same time
+ */
+ DENTRY_D_LOCK_NESTED,
+ /*
+ * used by spin_lock_nested when three d_lock need to be taken
+ * at the same time
+ */
+ DENTRY_D_LOCK_NESTED_TWICE
};
struct dentry_operations {
--
2.17.2
Powered by blists - more mailing lists