ocfs2: only take lock if dio entry when recover orphans
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.
Signed-off-by Joseph Qi <[email protected]>
--- fs/ocfs2/inode.h | 2 ++ fs/ocfs2/journal.c | 86 +++++++++++++++++++++++++++++------------------------- 2 files changed, 49 insertions(+), 39 deletions(-)
fs/ocfs2/inode.h +2 -0
@@ -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 0x00000080static 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