* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Author: Di Wang <di.wang@intel.com>
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
#define DEBUG_SUBSYSTEM S_MDS
#include "osp_internal.h"
struct osp_device *d = _arg;
struct ptlrpc_thread *thread = &d->opd_pre_thread;
struct l_wait_info lwi = { 0 };
- char pname[16];
struct lu_env env;
int rc;
ENTRY;
- sprintf(pname, "osp-pre-%u", d->opd_index);
- cfs_daemonize(pname);
-
rc = lu_env_init(&env, d->opd_dt_dev.dd_lu_dev.ld_type->ldt_ctx_tags);
if (rc) {
CERROR("%s: init env error: rc = %d\n", d->opd_obd->obd_name,
struct l_wait_info lwi;
cfs_time_t expire = cfs_time_shift(obd_timeout);
int precreated, rc;
- int count = 0;
ENTRY;
while ((rc = d->opd_pre_status) == 0 || rc == -ENOSPC ||
rc == -ENODEV || rc == -EAGAIN) {
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 90, 0)
- /*
- * to address Andreas's concern on possible busy-loop
- * between this thread and osp_precreate_send()
- */
- if (unlikely(count++ == 1000)) {
- osp_precreate_timeout_condition(d);
- LBUG();
- }
-#endif
-
/*
* increase number of precreations
*/
body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
LASSERT(body);
- lustre_set_wire_obdo(&body->oa, oa);
+ lustre_set_wire_obdo(&req->rq_import->imp_connect_data, &body->oa, oa);
/* XXX: capa support? */
/* osc_pack_capa(req, body, capa); */
int osp_init_precreate(struct osp_device *d)
{
struct l_wait_info lwi = { 0 };
- int rc;
+ cfs_task_t *task;
ENTRY;
/*
* start thread handling precreation and statfs updates
*/
- rc = cfs_create_thread(osp_precreate_thread, d, 0);
- if (rc < 0) {
- CERROR("can't start precreate thread %d\n", rc);
- RETURN(rc);
+ task = kthread_run(osp_precreate_thread, d,
+ "osp-pre-%u", d->opd_index);
+ if (IS_ERR(task)) {
+ CERROR("can't start precreate thread %ld\n", PTR_ERR(task));
+ RETURN(PTR_ERR(task));
}
l_wait_event(d->opd_pre_thread.t_ctl_waitq,