#define container_of0(ptr, type, member) \
((type *)__container_of((void *)(ptr), offsetof(type, member)))
-#define SET_BUT_UNUSED(a) do { } while(sizeof(a) - sizeof(a))
-
#define _LIBCFS_H
#endif /* _LIBCFS_H */
void
cfs_wi_sched_destroy(struct cfs_wi_sched *sched)
{
- int i;
-
LASSERT(cfs_wi_data.wi_init);
LASSERT(!cfs_wi_data.wi_stopping);
spin_unlock(&cfs_wi_data.wi_glock);
- i = 2;
#ifdef __KERNEL__
cfs_waitq_broadcast(&sched->ws_waitq);
spin_lock(&cfs_wi_data.wi_glock);
- while (sched->ws_nthreads > 0) {
- CDEBUG(IS_PO2(++i) ? D_WARNING : D_NET,
- "waiting for %d threads of WI sched[%s] to terminate\n",
- sched->ws_nthreads, sched->ws_name);
+ {
+ int i = 2;
- spin_unlock(&cfs_wi_data.wi_glock);
- cfs_pause(cfs_time_seconds(1) / 20);
- spin_lock(&cfs_wi_data.wi_glock);
+ while (sched->ws_nthreads > 0) {
+ CDEBUG(IS_PO2(++i) ? D_WARNING : D_NET,
+ "waiting for %d threads of WI sched[%s] to "
+ "terminate\n", sched->ws_nthreads,
+ sched->ws_name);
+
+ spin_unlock(&cfs_wi_data.wi_glock);
+ cfs_pause(cfs_time_seconds(1) / 20);
+ spin_lock(&cfs_wi_data.wi_glock);
+ }
}
cfs_list_del(&sched->ws_list);
spin_unlock(&cfs_wi_data.wi_glock);
-#else
- SET_BUT_UNUSED(i);
#endif
LASSERT(sched->ws_nscheduled == 0);
int cpt, int nthrs, struct cfs_wi_sched **sched_pp)
{
struct cfs_wi_sched *sched;
- int rc;
LASSERT(cfs_wi_data.wi_init);
LASSERT(!cfs_wi_data.wi_stopping);
CFS_INIT_LIST_HEAD(&sched->ws_rerunq);
CFS_INIT_LIST_HEAD(&sched->ws_list);
- rc = 0;
#ifdef __KERNEL__
- while (nthrs > 0) {
- char name[16];
+ for (; nthrs > 0; nthrs--) {
+ char name[16];
cfs_task_t *task;
+
spin_lock(&cfs_wi_data.wi_glock);
while (sched->ws_starting > 0) {
spin_unlock(&cfs_wi_data.wi_glock);
}
task = kthread_run(cfs_wi_scheduler, sched, name);
- if (!IS_ERR(task)) {
- nthrs--;
- continue;
- }
- rc = PTR_ERR(task);
+ if (IS_ERR(task)) {
+ int rc = PTR_ERR(task);
- CERROR("Failed to create thread for WI scheduler %s: %d\n",
- name, rc);
+ CERROR("Failed to create thread for "
+ "WI scheduler %s: %d\n", name, rc);
- spin_lock(&cfs_wi_data.wi_glock);
+ spin_lock(&cfs_wi_data.wi_glock);
- /* make up for cfs_wi_sched_destroy */
- cfs_list_add(&sched->ws_list, &cfs_wi_data.wi_scheds);
- sched->ws_starting--;
+ /* make up for cfs_wi_sched_destroy */
+ cfs_list_add(&sched->ws_list, &cfs_wi_data.wi_scheds);
+ sched->ws_starting--;
- spin_unlock(&cfs_wi_data.wi_glock);
+ spin_unlock(&cfs_wi_data.wi_glock);
- cfs_wi_sched_destroy(sched);
- return rc;
+ cfs_wi_sched_destroy(sched);
+ return rc;
+ }
}
-#else
- SET_BUT_UNUSED(rc);
#endif
spin_lock(&cfs_wi_data.wi_glock);
cfs_list_add(&sched->ws_list, &cfs_wi_data.wi_scheds);
return 0;
}
-static int
-_sysio_getcreds(struct creds *crp)
-{
-
- return _sysio_ldcreds(getuid(), getgid(), crp);
-}
-
/*
* Determine if a given access is permitted to a given file.
*/
{
struct file *fil;
- fil = fil = __sysio_fd_get(fd, 1);
+ fil = __sysio_fd_get(fd, 1);
if (!fil)
return -EBADF;
int
_sysio_fd_close_all()
{
- int fd;
- struct file **filp;
- oftab_t *oftab;
- int i;
-
- /*
- * Close all open descriptors.
- */
+ /* Close all open descriptors */
_sysio_oftable_close_all(&_sysio_oftab[OFTAB_VIRTUAL]);
- /* XXX see liblustre/llite_lib.c for explaination */
+ /* FIXME: libsysio does not currently perform enough cleanup of
+ * open files to allow __liblustre_cleanup_() to safely call
+ * unmount(). See the related FIXME comment in that function
+ * for details. The following disabled code is left in place to
+ * document the solution that was originally under consideration
+ * but never fully implemented. */
#if 0
_sysio_oftable_close_all(&_sysio_oftab[OFTAB_NATIVE]);
#endif
- /*
- * Release current working directory.
- */
+ /* Release current working directory */
if (_sysio_cwd) {
P_RELE(_sysio_cwd);
_sysio_cwd = NULL;
{
static char default_networks[256];
char *networks = getenv ("LNET_NETWORKS");
- char *ip2nets = getenv ("LNET_IP2NETS");
char *str;
char *sep;
int len;
int nob;
- int rc;
cfs_list_t *tmp;
-#ifdef NOT_YET
- if (networks != NULL && ip2nets != NULL) {
- LCONSOLE_ERROR_MSG(0x103, "Please set EITHER 'LNET_NETWORKS' or"
- " 'LNET_IP2NETS' but not both at once\n");
- return NULL;
- }
-
- if (ip2nets != NULL) {
- rc = lnet_parse_ip2nets(&networks, ip2nets);
- return (rc == 0) ? networks : NULL;
- }
-#else
- SET_BUT_UNUSED(ip2nets);
- SET_BUT_UNUSED(rc);
-#endif
if (networks != NULL)
return networks;
/* In userland, the default 'networks=' is the list of known net types */
-
len = sizeof(default_networks);
str = default_networks;
*str = 0;
nob = snprintf(str, len, "%s%s", sep,
libcfs_lnd2str(lnd->lnd_type));
+ if (nob >= len) {
+ /* overflowed the string; leave it where it was */
+ *str = 0;
+ break;
+ }
len -= nob;
- if (len < 0) {
- /* overflowed the string; leave it where it was */
- *str = 0;
- break;
- }
-
str += nob;
sep = ",";
}
srpc_alloc_bulk(int cpt, unsigned bulk_npg, unsigned bulk_len, int sink)
{
srpc_bulk_t *bk;
- struct page **pages;
int i;
LASSERT(bulk_npg > 0 && bulk_npg <= LNET_MAX_IOV);
bk->bk_len = bulk_len;
bk->bk_niov = bulk_npg;
#ifndef __KERNEL__
- LIBCFS_CPT_ALLOC(pages, lnet_cpt_table(), cpt,
- sizeof(struct page *) * bulk_npg);
- if (pages == NULL) {
- LIBCFS_FREE(bk, offsetof(srpc_bulk_t, bk_iovs[bulk_npg]));
- CERROR("Can't allocate page array for %d pages\n", bulk_npg);
- return NULL;
- }
+ {
+ struct page **pages;
+
+ LIBCFS_CPT_ALLOC(pages, lnet_cpt_table(), cpt,
+ sizeof(struct page *) * bulk_npg);
+ if (pages == NULL) {
+ LIBCFS_FREE(bk, offsetof(srpc_bulk_t,
+ bk_iovs[bulk_npg]));
+ CERROR("Can't allocate page array for %d pages\n",
+ bulk_npg);
+ return NULL;
+ }
- memset(pages, 0, sizeof(struct page *) * bulk_npg);
- bk->bk_pages = pages;
-#else
- UNUSED(pages);
+ memset(pages, 0, sizeof(struct page *) * bulk_npg);
+ bk->bk_pages = pages;
+ }
#endif
for (i = 0; i < bulk_npg; i++) {
#undef STATE2STR
}
-#define UNUSED(x) ( (void)(x) )
-
#ifndef __KERNEL__
int stt_poll_interval(void);
stt_timer_main (void *arg)
{
int rc = 0;
- UNUSED(arg);
-
- SET_BUT_UNUSED(rc);
cfs_block_allsigs();
stt_data.stt_shuttingdown,
cfs_time_seconds(STTIMER_SLOTTIME),
rc);
+ rc = 0; /* Discard jiffies remaining before timeout. */
}
spin_lock(&stt_data.stt_lock);
stt_data.stt_nthreads--;
spin_unlock(&stt_data.stt_lock);
- return 0;
+ return rc;
}
int
#define ll_d_hlist_for_each_entry(dentry, p, i_dentry, alias) \
hlist_for_each_entry(dentry, p, i_dentry, alias)
#endif
+#define DECLARE_LL_D_HLIST_NODE_PTR(name) struct ll_d_hlist_node *name
#else
#define ll_d_hlist_node list_head
#define ll_d_hlist_empty(list) list_empty(list)
#define ll_d_hlist_entry(ptr, type, name) list_entry(ptr.next, type, name)
#define ll_d_hlist_for_each(tmp, i_dentry) list_for_each(tmp, i_dentry)
#define ll_d_hlist_for_each_entry(dentry, p, i_dentry, alias) \
- p = NULL; list_for_each_entry(dentry, i_dentry, alias)
+ list_for_each_entry(dentry, i_dentry, alias)
+#define DECLARE_LL_D_HLIST_NODE_PTR(name) /* nothing */
#endif
void ptlrpc_deactivate_import(struct obd_import *imp);
void ptlrpc_invalidate_import(struct obd_import *imp);
void ptlrpc_fail_import(struct obd_import *imp, __u32 conn_cnt);
-int ptlrpc_check_suspend(void);
-void ptlrpc_activate_timeouts(struct obd_import *imp);
-void ptlrpc_deactivate_timeouts(struct obd_import *imp);
/** @} ha */
} while (0)
#else /* !__KERNEL__ */
+
#define __l_wait_event(wq, condition, info, ret, l_add_wait) \
do { \
long __timeout = info->lwi_timeout; \
} \
} \
} \
- SET_BUT_UNUSED(wq); \
} while (0)
#endif /* __KERNEL__ */
enum timeout_event event);
struct ptlrpc_request * ptlrpc_prep_ping(struct obd_import *imp);
int ptlrpc_obd_ping(struct obd_device *obd);
-cfs_time_t ptlrpc_suspend_wakeup_time(void);
#ifdef __KERNEL__
void ping_evictor_start(void);
void ping_evictor_stop(void);
#define ping_evictor_start() do {} while (0)
#define ping_evictor_stop() do {} while (0)
#endif
-int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req);
void ptlrpc_pinger_ir_up(void);
void ptlrpc_pinger_ir_down(void);
/** @} */
(lock->l_req_mode == LCK_GROUP))
break;
- if (ptlrpc_check_suspend()) {
- /* there is a case when we talk to one mds, holding
- * lock from another mds. this way we easily can get
- * here, if second mds is being recovered. so, we
- * suspend timeouts. bug 6019 */
-
- LDLM_ERROR(lock, "recharge timeout: %s@%s nid %s ",
- lock->l_export->exp_client_uuid.uuid,
- lock->l_export->exp_connection->c_remote_uuid.uuid,
- libcfs_nid2str(lock->l_export->exp_connection->c_peer.nid));
-
- cfs_list_del_init(&lock->l_pending_chain);
- if (lock->l_flags & LDLM_FL_DESTROYED) {
- /* relay the lock refcount decrease to
- * expired lock thread */
- cfs_list_add(&lock->l_pending_chain,
- &expired_lock_thread.elt_expired_locks);
- } else {
- __ldlm_add_waiting_lock(lock,
- ldlm_get_enq_timeout(lock));
- }
- continue;
- }
-
- /* if timeout overlaps the activation time of suspended timeouts
- * then extend it to give a chance for client to reconnect */
- if (cfs_time_before(cfs_time_sub(lock->l_callback_timeout,
- cfs_time_seconds(obd_timeout)/2),
- ptlrpc_suspend_wakeup_time())) {
- LDLM_ERROR(lock, "extend timeout due to recovery: %s@%s nid %s ",
- lock->l_export->exp_client_uuid.uuid,
- lock->l_export->exp_connection->c_remote_uuid.uuid,
- libcfs_nid2str(lock->l_export->exp_connection->c_peer.nid));
-
- cfs_list_del_init(&lock->l_pending_chain);
- if (lock->l_flags & LDLM_FL_DESTROYED) {
- /* relay the lock refcount decrease to
- * expired lock thread */
- cfs_list_add(&lock->l_pending_chain,
- &expired_lock_thread.elt_expired_locks);
- } else {
- __ldlm_add_waiting_lock(lock,
- ldlm_get_enq_timeout(lock));
- }
- continue;
- }
-
/* Check if we need to prolong timeout */
if (!OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_HPREQ_TIMEOUT) &&
ldlm_lock_busy(lock)) {
if (lock->l_conn_export == NULL) {
static cfs_time_t next_dump = 0, last_dump = 0;
- if (ptlrpc_check_suspend())
- RETURN(0);
-
LCONSOLE_WARN("lock timed out (enqueued at "CFS_TIME_T", "
CFS_DURATION_T"s ago)\n",
lock->l_last_activity,
void ll_invalidate_aliases(struct inode *inode)
{
struct dentry *dentry;
- struct ll_d_hlist_node *p;
+ DECLARE_LL_D_HLIST_NODE_PTR(p);
ENTRY;
LASSERT(inode != NULL);
struct inode *inode = de->d_inode;
struct ll_inode_info *lli = ll_i2info(inode);
struct obd_client_handle **och_p;
- __u64 *och_usecount;
__u64 ibits;
/*
* change, LOOKUP lock is revoked.
*/
-
- if (it->it_flags & FMODE_WRITE) {
- och_p = &lli->lli_mds_write_och;
- och_usecount = &lli->lli_open_fd_write_count;
- } else if (it->it_flags & FMODE_EXEC) {
- och_p = &lli->lli_mds_exec_och;
- och_usecount = &lli->lli_open_fd_exec_count;
- } else {
- och_p = &lli->lli_mds_read_och;
- och_usecount = &lli->lli_open_fd_read_count;
- }
+ if (it->it_flags & FMODE_WRITE)
+ och_p = &lli->lli_mds_write_och;
+ else if (it->it_flags & FMODE_EXEC)
+ och_p = &lli->lli_mds_exec_och;
+ else
+ och_p = &lli->lli_mds_read_och;
/* Check for the proper lock. */
ibits = MDS_INODELOCK_LOOKUP;
if (!ll_have_md_lock(inode, &ibits, LCK_MINMODE))
goto do_lock;
mutex_lock(&lli->lli_och_mutex);
- if (*och_p) { /* Everything is open already, do nothing */
- /*(*och_usecount)++; Do not let them steal our open
- handle from under us */
- SET_BUT_UNUSED(och_usecount);
- /* XXX The code above was my original idea, but in case
- we have the handle, but we cannot use it due to later
- checks (e.g. O_CREAT|O_EXCL flags set), nobody
- would decrement counter increased here. So we just
- hope the lock won't be invalidated in between. But
- if it would be, we'll reopen the open request to
- MDS later during file open path */
- mutex_unlock(&lli->lli_och_mutex);
- RETURN(1);
- } else {
+ if (*och_p) { /* Everything is open already, do nothing */
+ /* Originally it was idea to do not let them steal our
+ * open handle from under us by (*och_usecount)++ here.
+ * But in case we have the handle, but we cannot use it
+ * due to later checks (e.g. O_CREAT|O_EXCL flags set),
+ * nobody would decrement counter increased here. So we
+ * just hope the lock won't be invalidated in between.
+ * But if it would be, we'll reopen the open request to
+ * MDS later during file open path. */
mutex_unlock(&lli->lli_och_mutex);
- }
- }
+ RETURN(1);
+ }
+ mutex_unlock(&lli->lli_och_mutex);
+ }
if (it->it_op == IT_GETATTR) {
rc = ll_statahead_enter(parent, &de, 0);
static void ll_invalidate_negative_children(struct inode *dir)
{
struct dentry *dentry, *tmp_subdir;
- struct ll_d_hlist_node *p;
+ DECLARE_LL_D_HLIST_NODE_PTR(p);
ll_lock_dcache(dir);
ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_alias) {
static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
{
struct dentry *alias, *discon_alias, *invalid_alias;
- struct ll_d_hlist_node *p;
+ DECLARE_LL_D_HLIST_NODE_PTR(p);
if (ll_d_hlist_empty(&inode->i_dentry))
return NULL;
{
unsigned int num_entry;
struct lprocfs_counter *percpu_cntr;
- struct lprocfs_counter_header *cntr_header;
int i;
unsigned long flags = 0;
for (i = 0; i < num_entry; i++) {
if (stats->ls_percpu[i] == NULL)
continue;
- cntr_header = &stats->ls_cnt_header[idx];
percpu_cntr = lprocfs_stats_counter_get(stats, i, idx);
cnt->lc_count += percpu_cntr->lc_count;
void lprocfs_clear_stats(struct lprocfs_stats *stats)
{
struct lprocfs_counter *percpu_cntr;
- struct lprocfs_counter_header *header;
int i;
int j;
unsigned int num_entry;
if (stats->ls_percpu[i] == NULL)
continue;
for (j = 0; j < stats->ls_num; j++) {
- header = &stats->ls_cnt_header[j];
percpu_cntr = lprocfs_stats_counter_get(stats, i, j);
percpu_cntr->lc_count = 0;
percpu_cntr->lc_min = LC_MIN_INIT;
int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
{
int rc;
- cfs_waitq_t *wq;
struct l_wait_info lwi;
/*
* a chance to run reply_in_callback(), and to make sure we've
* unlinked before returning a req to the pool.
*/
- if (request->rq_set != NULL)
- wq = &request->rq_set->set_waitq;
- else
- wq = &request->rq_reply_waitq;
-
for (;;) {
+#ifdef __KERNEL__
+ /* The wq argument is ignored by user-space wait_event macros */
+ cfs_waitq_t *wq = (request->rq_set != NULL) ?
+ &request->rq_set->set_waitq :
+ &request->rq_reply_waitq;
+#endif
/* Network access will complete in finite time but the HUGE
* timeout lets us CWARN for visibility of sluggish NALs */
lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
target_len, target_start,
libcfs_nid2str(imp->imp_connection->c_peer.nid));
}
- ptlrpc_deactivate_timeouts(imp);
IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON);
spin_unlock(&imp->imp_lock);
spin_lock(&imp->imp_lock);
imp->imp_invalid = 0;
- ptlrpc_activate_timeouts(imp);
spin_unlock(&imp->imp_lock);
obd_import_event(obd, imp, IMP_EVENT_ACTIVE);
}
int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
{
struct ptlrpc_bulk_desc *desc = req->rq_bulk;
- cfs_waitq_t *wq;
struct l_wait_info lwi;
int rc;
ENTRY;
if (async)
RETURN(0);
- if (req->rq_set != NULL)
- wq = &req->rq_set->set_waitq;
- else
- wq = &req->rq_reply_waitq;
-
for (;;) {
+#ifdef __KERNEL__
+ /* The wq argument is ignored by user-space wait_event macros */
+ cfs_waitq_t *wq = (req->rq_set != NULL) ?
+ &req->rq_set->set_waitq :
+ &req->rq_reply_waitq;
+#endif
/* Network access will complete in finite time but the HUGE
* timeout lets us CWARN for visibility of sluggish NALs */
lwi = LWI_TIMEOUT_INTERVAL(cfs_time_seconds(LONG_UNLINK),
return cfs_time_shift(obd_timeout);
}
-static cfs_atomic_t suspend_timeouts = CFS_ATOMIC_INIT(0);
-static cfs_time_t suspend_wakeup_time = 0;
-
cfs_duration_t pinger_check_timeout(cfs_time_t time)
{
struct timeout_item *item;
cfs_time_current());
}
-static cfs_waitq_t suspend_timeouts_waitq;
-
-cfs_time_t ptlrpc_suspend_wakeup_time(void)
-{
- return suspend_wakeup_time;
-}
-
-void ptlrpc_deactivate_timeouts(struct obd_import *imp)
-{
- /*XXX: disabled for now, will be replaced by adaptive timeouts */
-#if 0
- if (imp->imp_no_timeout)
- return;
- imp->imp_no_timeout = 1;
- cfs_atomic_inc(&suspend_timeouts);
- CDEBUG(D_HA|D_WARNING, "deactivate timeouts %u\n",
- cfs_atomic_read(&suspend_timeouts));
-#endif
-}
-
-void ptlrpc_activate_timeouts(struct obd_import *imp)
-{
- /*XXX: disabled for now, will be replaced by adaptive timeouts */
-#if 0
- if (!imp->imp_no_timeout)
- return;
- imp->imp_no_timeout = 0;
- LASSERT(cfs_atomic_read(&suspend_timeouts) > 0);
- if (cfs_atomic_dec_and_test(&suspend_timeouts)) {
- suspend_wakeup_time = cfs_time_current();
- cfs_waitq_signal(&suspend_timeouts_waitq);
- }
- CDEBUG(D_HA|D_WARNING, "activate timeouts %u\n",
- cfs_atomic_read(&suspend_timeouts));
-#endif
-}
-
-int ptlrpc_check_suspend(void)
-{
- if (cfs_atomic_read(&suspend_timeouts))
- return 1;
- return 0;
-}
-
-int ptlrpc_check_and_wait_suspend(struct ptlrpc_request *req)
-{
- struct l_wait_info lwi;
-
- if (cfs_atomic_read(&suspend_timeouts)) {
- DEBUG_REQ(D_NET, req, "-- suspend %d regular timeout",
- cfs_atomic_read(&suspend_timeouts));
- lwi = LWI_INTR(NULL, NULL);
- l_wait_event(suspend_timeouts_waitq,
- cfs_atomic_read(&suspend_timeouts) == 0, &lwi);
- DEBUG_REQ(D_NET, req, "-- recharge regular timeout");
- return 1;
- }
- return 0;
-}
-
#ifdef __KERNEL__
static bool ir_up;
RETURN(-EALREADY);
cfs_waitq_init(&pinger_thread.t_ctl_waitq);
- cfs_waitq_init(&suspend_timeouts_waitq);
strcpy(pinger_thread.t_name, "ll_ping");
int ptlrpcd_start(int index, int max, const char *name, struct ptlrpcd_ctl *pc)
{
int rc;
- int env = 0;
ENTRY;
/*
pc->pc_set = ptlrpc_prep_set();
if (pc->pc_set == NULL)
GOTO(out, rc = -ENOMEM);
+
+#ifndef __KERNEL__
+ pc->pc_wait_callback =
+ liblustre_register_wait_callback("ptlrpcd_check_async_rpcs",
+ &ptlrpcd_check_async_rpcs, pc);
+ pc->pc_idle_callback =
+ liblustre_register_idle_callback("ptlrpcd_check_idle_rpcs",
+ &ptlrpcd_idle, pc);
+ RETURN(0);
+#else
/*
* So far only "client" ptlrpcd uses an environment. In the future,
* ptlrpcd thread (or a thread-set) has to be given an argument,
*/
rc = lu_context_init(&pc->pc_env.le_ctx, LCT_CL_THREAD|LCT_REMEMBER);
if (rc != 0)
- GOTO(out, rc);
+ GOTO(out_set, rc);
- env = 1;
-#ifdef __KERNEL__
{
cfs_task_t *task;
if (index >= 0) {
rc = ptlrpcd_bind(index, max);
if (rc < 0)
- GOTO(out, rc);
+ GOTO(out_env, rc);
}
task = kthread_run(ptlrpcd, pc, pc->pc_name);
if (IS_ERR(task))
- GOTO(out, rc = PTR_ERR(task));
+ GOTO(out_env, rc = PTR_ERR(task));
- rc = 0;
wait_for_completion(&pc->pc_starting);
}
-#else
- pc->pc_wait_callback =
- liblustre_register_wait_callback("ptlrpcd_check_async_rpcs",
- &ptlrpcd_check_async_rpcs, pc);
- pc->pc_idle_callback =
- liblustre_register_idle_callback("ptlrpcd_check_idle_rpcs",
- &ptlrpcd_idle, pc);
-#endif
-out:
- if (rc) {
-#ifdef __KERNEL__
- if (pc->pc_set != NULL) {
- struct ptlrpc_request_set *set = pc->pc_set;
+ RETURN(0);
- spin_lock(&pc->pc_lock);
- pc->pc_set = NULL;
- spin_unlock(&pc->pc_lock);
- ptlrpc_set_destroy(set);
- }
- if (env != 0)
- lu_context_fini(&pc->pc_env.le_ctx);
- clear_bit(LIOD_BIND, &pc->pc_flags);
-#else
- SET_BUT_UNUSED(env);
-#endif
- clear_bit(LIOD_START, &pc->pc_flags);
+out_env:
+ lu_context_fini(&pc->pc_env.le_ctx);
+
+out_set:
+ if (pc->pc_set != NULL) {
+ struct ptlrpc_request_set *set = pc->pc_set;
+
+ spin_lock(&pc->pc_lock);
+ pc->pc_set = NULL;
+ spin_unlock(&pc->pc_lock);
+ ptlrpc_set_destroy(set);
}
+ clear_bit(LIOD_BIND, &pc->pc_flags);
+#endif
+out:
+ clear_bit(LIOD_START, &pc->pc_flags);
RETURN(rc);
}
{"test_setxattr", jt_obd_test_setxattr, 0,
"Set EA for files/directory on MDT by echo client\n"
"usage: test_setxattr [-d parent_baseid] <-D parent_count>"
- "[-b child_base_id] [-x size] [-n count] <-t time>\n"},
+ "[-b child_base_id] [-n count] <-t time>\n"},
{"test_md_getattr", jt_obd_test_md_getattr, 0,
"getattr files on MDT by echo client\n"
"usage: test_md_getattr [-d parent_basedir] <-D parent_count>"
__u64 seconds = 0;
double diff;
int c;
- int xattr_size = 0;
__u64 total_count = 0;
char *name = NULL;
struct jt_fid_space fid_space = {0};
{"count", required_argument, 0, 'n'},
{"time", required_argument, 0, 't'},
{"version", no_argument, 0, 'v'},
- {"xattr_size", required_argument, 0, 'x'},
{0, 0, 0, 0}
};
optind = 0;
- while ((c = getopt_long(argc, argv, "b:c:d:D:m:n:t:vx:",
+ while ((c = getopt_long(argc, argv, "b:c:d:D:m:n:t:v",
long_opts, NULL)) >= 0) {
switch (c) {
case 'b':
case 'v':
version = 1;
break;
- case 'x':
- xattr_size = strtoul(optarg, &end, 0);
- if (*end) {
- fprintf(stderr, "error: %s: xattr_size '%s'\n",
- jt_cmdname(argv[0]), optarg);
- return CMD_HELP;
- }
- SET_BUT_UNUSED(xattr_size);
- break;
default:
fprintf(stderr, "error: %s: option '%s' "
"unrecognized\n", argv[0], argv[optind - 1]);