};
#define OSC_MAX_RIF_DEFAULT 8
+#define MDS_OSC_MAX_RIF_DEFAULT 50
#define OSC_MAX_RIF_MAX 256
#define OSC_MAX_DIRTY_DEFAULT (OSC_MAX_RIF_DEFAULT * 4)
#define OSC_MAX_DIRTY_MB_MAX 2048 /* arbitrary, but < MAX_LONG bytes */
}
EXPORT_SYMBOL(client_destroy_import);
+/**
+ * check whether the osc is on MDT or not
+ * In the config log,
+ * osc on MDT
+ * setup 0:{fsname}-OSTxxxx-osc[-MDTxxxx] 1:lustre-OST0000_UUID 2:NID
+ * osc on client
+ * setup 0:{fsname}-OSTxxxx-osc 1:lustre-OST0000_UUID 2:NID
+ *
+ **/
+static int osc_on_mdt(char *obdname)
+{
+ char *ptr;
+
+ ptr = strrchr(obdname, '-');
+ if (ptr == NULL)
+ return 0;
+
+ if (strncmp(ptr + 1, "MDT", 3) == 0)
+ return 1;
+
+ return 0;
+}
+
/* configure an RPC client OBD device
*
* lcfg parameters:
} else if (cfs_num_physpages >> (20 - CFS_PAGE_SHIFT) <= 512 /* MB */) {
cli->cl_max_rpcs_in_flight = 4;
} else {
- cli->cl_max_rpcs_in_flight = OSC_MAX_RIF_DEFAULT;
+ if (osc_on_mdt(obddev->obd_name))
+ cli->cl_max_rpcs_in_flight = MDS_OSC_MAX_RIF_DEFAULT;
+ else
+ cli->cl_max_rpcs_in_flight = OSC_MAX_RIF_DEFAULT;
}
-
rc = ldlm_get_ref();
if (rc) {
CERROR("ldlm_get_ref failed: %d\n", rc);
stop:
mdd_trans_stop(env, mdd, rc, handle);
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,3,50,0)
- if (rc == 0 && ma->ma_valid & MA_COOKIE && ma->ma_valid & MA_LOV &&
- ma->ma_valid & MA_FLAGS && ma->ma_attr_flags & MDS_UNLINK_DESTROY)
- /* Since echo client is incapable of destorying ost object,
- * it will destory the object here. */
- rc = mdd_lovobj_unlink(env, mdd, mdd_cobj, la,
- ma->ma_lmm, ma->ma_lmm_size,
- ma->ma_cookie, 1);
+ if (rc == 0 && ma->ma_valid & MA_COOKIE && ma->ma_valid & MA_LOV &&
+ ma->ma_valid & MA_FLAGS && ma->ma_attr_flags & MDS_UNLINK_DESTROY)
+ /* Since echo client is incapable of destorying ost object,
+ * it will destory the object here. */
+ rc = mdd_lovobj_unlink(env, mdd, mdd_cobj, la, ma, 1);
#else
#warning "please remove this after 2.4 (LOD/OSP)."
#endif
int mdd_lov_setattr_async(const struct lu_env *env, struct mdd_object *obj,
struct lov_mds_md *lmm, int lmm_size,
struct llog_cookie *logcookies);
+
int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
- struct mdd_object *obj, struct lu_attr *la,
- struct lov_mds_md *lmm, int lmm_size,
- struct llog_cookie *logcookies,
- int log_unlink);
+ struct mdd_object *obj, struct lu_attr *la,
+ struct md_attr *ma, int log_unlink);
struct mdd_thread_info *mdd_env_info(const struct lu_env *env);
* destroy objects on OSS.
*/
int mdd_lovobj_unlink(const struct lu_env *env, struct mdd_device *mdd,
- struct mdd_object *obj, struct lu_attr *la,
- struct lov_mds_md *lmm, int lmm_size,
- struct llog_cookie *logcookies,
- int log_unlink)
+ struct mdd_object *obj, struct lu_attr *la,
+ struct md_attr *ma, int log_unlink)
{
struct obd_device *obd = mdd2obd_dev(mdd);
struct obd_export *lov_exp = obd->u.mds.mds_lov_exp;
struct obd_trans_info *oti = &mdd_env_info(env)->mti_oti;
struct obdo *oa = &mdd_env_info(env)->mti_oa;
struct lu_site *site = mdd2lu_dev(mdd)->ld_site;
- int rc;
+ struct lov_mds_md *lmm = ma->ma_lmm;
+ int lmm_size = ma->ma_lmm_size;
+ struct llog_cookie *logcookies = ma->ma_cookie;
+ int rc;
ENTRY;
if (lmm_size == 0)
oti->oti_logcookies = logcookies;
}
+ if (!(ma->ma_attr_flags & MDS_UNLINK_DESTROY))
+ oa->o_flags = OBD_FL_DELORPHAN;
+
CDEBUG(D_INFO, "destroying OSS object "LPU64":"LPU64"\n", oa->o_seq,
oa->o_id);
RETURN(rc);
}
- if (ma->ma_valid & MA_COOKIE)
- rc = mdd_lovobj_unlink(env, mdd, obj, la,
- ma->ma_lmm, ma->ma_lmm_size,
- ma->ma_cookie, 1);
- RETURN(rc);
+ if (ma->ma_valid & MA_COOKIE)
+ rc = mdd_lovobj_unlink(env, mdd, obj, la, ma, 1);
+
+ RETURN(rc);
}
int mdd_declare_unlink_log(const struct lu_env *env, struct mdd_object *obj,
osc_pack_capa(req, body, (struct obd_capa *)capa);
ptlrpc_request_set_replen(req);
- /* don't throttle destroy RPCs for the MDT */
- if (!(cli->cl_import->imp_connect_flags_orig & OBD_CONNECT_MDS)) {
+ /* If osc_destory is for destroying the unlink orphan,
+ * sent from MDT to OST, which should not be blocked here,
+ * because the process might be triggered by ptlrpcd, and
+ * it is not good to block ptlrpcd thread (b=16006)*/
+ if (!(oa->o_flags & OBD_FL_DELORPHAN)) {
req->rq_interpret_reply = osc_destroy_interpret;
if (!osc_can_send_destroy(cli)) {
struct l_wait_info lwi = LWI_INTR(LWI_ON_SIGNAL_NOOP,