Skip to contentSkip to conversation

ocfs2: only take lock if dio entry when recover orphans

PATCH New Joseph Qi 1 participant 1 message Sep 28, 2015 OCFS2

lore
Share & tools
lore

Joseph Qi

author
#0 lore raw

PATCH 2/2 ocfs2: only take lock if dio entry when recover orphans

We have no need to take inode mutex, rw and inode lock if it is not dio entry when recover orphans. Optimize it by adding a flag OCFS2_INODE_DIO_ORPHAN_ENTRY to ocfs2_inode_info to reduce contention.

---
 fs/ocfs2/inode.h   |  2 ++
 fs/ocfs2/journal.c | 86 +++++++++++++++++++++++++++++-------------------------
 2 files changed, 49 insertions(+), 39 deletions(-)
fs/ocfs2/inode.h +2 -0
index ca3431e..aac8b86 100644
@@ -112,6 +112,8 @@ struct ocfs2_inode_info
 #define OCFS2_INODE_OPEN_DIRECT		0x00000020
 /* Tell the inode wipe code it's not in orphan dir */
 #define OCFS2_INODE_SKIP_ORPHAN_DIR     0x00000040
+/* Entry in orphan dir with 'dio-' prefix */
+#define OCFS2_INODE_DIO_ORPHAN_ENTRY	0x00000080
 
 static inline struct ocfs2_inode_info *OCFS2_I(struct inode *inode)
 {
fs/ocfs2/journal.c +47 -39

106 lines not on this page · raw message

Signature · 1 line
1.8.4.3