#define DEBUG_SUBSYSTEM S_OSD
#include <linux/module.h>
+#include <linux/user_namespace.h>
+#ifdef HAVE_UIDGID_HEADER
+# include <linux/uidgid.h>
+#endif
/* LUSTRE_VERSION_CODE */
#include <lustre_ver.h>
lu_context_exit(&th->th_ctx);
lu_context_fini(&th->th_ctx);
- thandle_put(th);
+ OBD_FREE_PTR(oh);
}
static struct thandle *osd_trans_create(const struct lu_env *env,
th->th_result = 0;
th->th_tags = LCT_TX_HANDLE;
oh->ot_credits = 0;
- atomic_set(&th->th_refc, 1);
- th->th_alloc_size = sizeof(*oh);
INIT_LIST_HEAD(&oh->ot_dcb_list);
osd_th_alloced(oh);
CERROR("%s: failed to stop transaction: rc = %d\n",
osd_name(osd), rc);
} else {
- thandle_put(&oh->ot_super);
+ OBD_FREE_PTR(oh);
}
/* inform the quota slave device that the transaction is stopping */
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);
+ /* Unlock the inode before attr initialization to avoid
+ * unnecessary dqget operations. LU-6378 */
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;
MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
MODULE_DESCRIPTION("Lustre Object Storage Device ("LUSTRE_OSD_LDISKFS_NAME")");
+MODULE_VERSION(LUSTRE_VERSION_STRING);
MODULE_LICENSE("GPL");
-cfs_module(osd, "0.1.0", osd_mod_init, osd_mod_exit);
+module_init(osd_mod_init);
+module_exit(osd_mod_exit);