summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8f1c8db)
The ldiskfs_create_inode() returns a locked inode to the caller (OSD)
that with I_NEW state, before further initializing the inode's attr
via osd_attr_init(), we should unlock the inode, otherwise, it will
cause some unnecessary dqget operations and affect the performance.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I36755cacc4895775130377da4ca486da08ede895
Reviewed-on: http://review.whamcloud.com/14102
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
result = osd_create_type_f(dof->dof_type)(info, obj, attr, hint, dof,
th);
result = osd_create_type_f(dof->dof_type)(info, obj, attr, hint, dof,
th);
- if (result == 0) {
- osd_attr_init(info, obj, attr, dof);
- osd_object_init0(obj);
- }
-
- if (obj->oo_inode != NULL) {
+ if (likely(obj->oo_inode != NULL)) {
LASSERT(obj->oo_inode->i_state & I_NEW);
LASSERT(obj->oo_inode->i_state & I_NEW);
+ /* Unlock the inode before attr initialization to avoid
+ * unnecessary dqget operations. LU-6378 */
unlock_new_inode(obj->oo_inode);
}
unlock_new_inode(obj->oo_inode);
}
+ if (likely(result == 0)) {
+ osd_attr_init(info, obj, attr, dof);
+ osd_object_init0(obj);
+ }
+
/* restore previous umask value */
current->fs->umask = umask;
/* restore previous umask value */
current->fs->umask = umask;