ext3-hash-selection.patch
ext3-htree-comments.patch
ext3-iam-ops.patch
-ext3-iam-separate.patch
+ext3-iam-separate.patch
__DEBUG_REQ(CDEBUG, level, req, fmt, ## args); \
} while (0)
+#define DEBUG_REQ_EX(level, req, fmt, args...) \
+do { \
+ if ((level) & (D_ERROR | D_WARNING)) \
+ __DEBUG_REQ(CDEBUG_LIMIT, D_ERROR, req, fmt, ## args); \
+ else \
+ __DEBUG_REQ(CDEBUG_EX, level, req, fmt, ## args); \
+} while (0)
+
struct ptlrpc_bulk_page {
struct list_head bp_link;
int bp_buflen;
ext3-hash-selection.patch
ext3-htree-comments.patch
ext3-iam-ops.patch
-ext3-iam-separate.patch
+ext3-iam-separate.patch
/* zero out sequence to check it later for validness */
ocd->ocd_seq = 0;
-
+
rc = ptlrpc_connect_import(imp, NULL);
if (rc != 0) {
LASSERT (imp->imp_state == LUSTRE_IMP_DISCON);
struct qunit_data *qdata, *rep;
int rc = 0, repsize = sizeof(struct qunit_data);
ENTRY;
-
+
rc = lustre_pack_reply(req, 1, &repsize, NULL);
if (rc) {
CERROR("packing reply failed!: rc = %d\n", rc);
}
rep = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*rep));
LASSERT(rep);
-
+
qdata = lustre_swab_reqbuf(req, 0, sizeof(*qdata), lustre_swab_qdata);
if (qdata == NULL) {
CERROR("unpacking request buffer failed!");
LASSERT(obd->obd_observer && obd->obd_observer->obd_observer);
master_obd = obd->obd_observer->obd_observer;
qctxt = &master_obd->u.obt.obt_qctxt;
-
+
LASSERT(qctxt->lqc_handler);
rc = qctxt->lqc_handler(master_obd, qdata, req->rq_reqmsg->opc);
if (rc && rc != -EDQUOT)
- CDEBUG(rc == -EBUSY ? D_QUOTA : D_ERROR,
+ CDEBUG_EX(rc == -EBUSY ? D_QUOTA : D_ERROR,
"dqacq failed! (rc:%d)\n", rc);
-
+
/* the qd_count might be changed in lqc_handler */
memcpy(rep, qdata, sizeof(*rep));
req->rq_status = rc;
rc = ptlrpc_reply(req);
-
- RETURN(rc);
+
+ RETURN(rc);
#else
return 0;
#endif /* !__KERNEL__ */
return;
if (!lock) {
- CDEBUG(level, " NULL LDLM lock\n");
+ CDEBUG_EX(level, " NULL LDLM lock\n");
return;
}
- CDEBUG(level," -- Lock dump: %p/"LPX64" (rc: %d) (pos: %d) (pid: %d)\n",
+ CDEBUG_EX(level," -- Lock dump: %p/"LPX64" (rc: %d) (pos: %d) (pid: %d)\n",
lock, lock->l_handle.h_cookie, atomic_read(&lock->l_refc),
pos, lock->l_pid);
if (lock->l_conn_export != NULL)
obd = lock->l_conn_export->exp_obd;
if (lock->l_export && lock->l_export->exp_connection) {
- CDEBUG(level, " Node: NID %s (rhandle: "LPX64")\n",
+ CDEBUG_EX(level, " Node: NID %s (rhandle: "LPX64")\n",
libcfs_nid2str(lock->l_export->exp_connection->c_peer.nid),
lock->l_remote_handle.cookie);
} else if (obd == NULL) {
- CDEBUG(level, " Node: local\n");
+ CDEBUG_EX(level, " Node: local\n");
} else {
struct obd_import *imp = obd->u.cli.cl_import;
- CDEBUG(level, " Node: NID %s (rhandle: "LPX64")\n",
+ CDEBUG_EX(level, " Node: NID %s (rhandle: "LPX64")\n",
libcfs_nid2str(imp->imp_connection->c_peer.nid),
lock->l_remote_handle.cookie);
}
- CDEBUG(level, " Resource: %p ("LPU64"/"LPU64")\n", lock->l_resource,
+ CDEBUG_EX(level, " Resource: %p ("LPU64"/"LPU64")\n", lock->l_resource,
lock->l_resource->lr_name.name[0],
lock->l_resource->lr_name.name[1]);
- CDEBUG(level, " Req mode: %s, grant mode: %s, rc: %u, read: %d, "
+ CDEBUG_EX(level, " Req mode: %s, grant mode: %s, rc: %u, read: %d, "
"write: %d flags: %#x\n", ldlm_lockname[lock->l_req_mode],
ldlm_lockname[lock->l_granted_mode],
atomic_read(&lock->l_refc), lock->l_readers, lock->l_writers,
lock->l_flags);
if (lock->l_resource->lr_type == LDLM_EXTENT)
- CDEBUG(level, " Extent: "LPU64" -> "LPU64
+ CDEBUG_EX(level, " Extent: "LPU64" -> "LPU64
" (req "LPU64"-"LPU64")\n",
lock->l_policy_data.l_extent.start,
lock->l_policy_data.l_extent.end,
lock->l_req_extent.start, lock->l_req_extent.end);
else if (lock->l_resource->lr_type == LDLM_FLOCK)
- CDEBUG(level, " Pid: %d Extent: "LPU64" -> "LPU64"\n",
+ CDEBUG_EX(level, " Pid: %d Extent: "LPU64" -> "LPU64"\n",
lock->l_policy_data.l_flock.pid,
lock->l_policy_data.l_flock.start,
lock->l_policy_data.l_flock.end);
else if (lock->l_resource->lr_type == LDLM_IBITS)
- CDEBUG(level, " Bits: "LPX64"\n",
+ CDEBUG_EX(level, " Bits: "LPX64"\n",
lock->l_policy_data.l_inodebits.bits);
}
{
struct list_head *tmp;
- CDEBUG(level, "--- Namespace: %s (rc: %d, client: %d)\n", ns->ns_name,
+ CDEBUG_EX(level, "--- Namespace: %s (rc: %d, client: %d)\n", ns->ns_name,
atomic_read(&ns->ns_refcount), ns->ns_client);
l_lock(&ns->ns_lock);
if (RES_NAME_SIZE != 4)
LBUG();
- CDEBUG(level, "--- Resource: %p ("LPU64"/"LPU64"/"LPU64"/"LPU64
+ CDEBUG_EX(level, "--- Resource: %p ("LPU64"/"LPU64"/"LPU64"/"LPU64
") (rc: %d)\n", res, res->lr_name.name[0], res->lr_name.name[1],
res->lr_name.name[2], res->lr_name.name[3],
atomic_read(&res->lr_refcount));
if (!list_empty(&res->lr_granted)) {
pos = 0;
- CDEBUG(level, "Granted locks:\n");
+ CDEBUG_EX(level, "Granted locks:\n");
list_for_each(tmp, &res->lr_granted) {
struct ldlm_lock *lock;
lock = list_entry(tmp, struct ldlm_lock, l_res_link);
}
if (!list_empty(&res->lr_converting)) {
pos = 0;
- CDEBUG(level, "Converting locks:\n");
+ CDEBUG_EX(level, "Converting locks:\n");
list_for_each(tmp, &res->lr_converting) {
struct ldlm_lock *lock;
lock = list_entry(tmp, struct ldlm_lock, l_res_link);
}
if (!list_empty(&res->lr_waiting)) {
pos = 0;
- CDEBUG(level, "Waiting locks:\n");
+ CDEBUG_EX(level, "Waiting locks:\n");
list_for_each(tmp, &res->lr_waiting) {
struct ldlm_lock *lock;
lock = list_entry(tmp, struct ldlm_lock, l_res_link);
if ((sbi->ll_flags & LL_SBI_USER_XATTR) &&
!(data->ocd_connect_flags & OBD_CONNECT_XATTR)) {
LCONSOLE_INFO("Disabling user_xattr feature because "
- "it is not supported on the server\n");
+ "it is not supported on the server\n");
sbi->ll_flags &= ~LL_SBI_USER_XATTR;
}
*lmmsize = obd_size_diskmd(sbi->ll_dt_exp, NULL);
size = sizeof(int);
- rc = obd_get_info(sbi->ll_md_exp, strlen("max_easize"), "max_easize",
+ rc = obd_get_info(sbi->ll_md_exp, strlen("max_easize"), "max_easize",
&size, lmmsize);
- if (rc)
+ if (rc)
CERROR("Get max mdsize error rc %d \n", rc);
-
+
RETURN(rc);
}
next:
/* Find next opt */
s2 = strchr(s1, ',');
- if (s2 == NULL)
+ if (s2 == NULL)
break;
s1 = s2 + 1;
}
EXIT;
}
-
+
void ll_lli_init(struct ll_inode_info *lli)
{
sema_init(&lli->lli_open_sem, 1);
char ll_instance[sizeof(sb) * 2 + 1];
int err;
ENTRY;
-
+
CDEBUG(D_VFSTRACE, "VFS Op: sb %p\n", sb);
/* client additional sb info */
lsi->lsi_llsbi = sbi = ll_init_sbi();
- if (!sbi)
+ if (!sbi)
RETURN(-ENOMEM);
ll_options(lsi->lsi_lmd->lmd_opts, &sbi->ll_flags);
-
+
/* Generate a string unique to this super, in case some joker tries
- to mount the same fs at two mount points.
+ to mount the same fs at two mount points.
Use the address of the super itself.*/
sprintf(ll_instance, "%p", sb);
cfg.cfg_instance = ll_instance;
CERROR("No profile found: %s\n", profilenm);
GOTO(out_free, err = -EINVAL);
}
- CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm,
+ CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm,
lprof->lp_mdc, lprof->lp_osc);
OBD_ALLOC(osc, strlen(lprof->lp_osc) +
strlen(ll_instance) + 2);
- if (!osc)
+ if (!osc)
GOTO(out_free, err = -ENOMEM);
sprintf(osc, "%s-%s", lprof->lp_osc, ll_instance);
OBD_ALLOC(mdc, strlen(lprof->lp_mdc) +
strlen(ll_instance) + 2);
- if (!mdc)
+ if (!mdc)
GOTO(out_free, err = -ENOMEM);
sprintf(mdc, "%s-%s", lprof->lp_mdc, ll_instance);
-
+
/* connections, registrations, sb setup */
err = client_common_fill_super(sb, mdc, osc);
-
+
out_free:
if (mdc)
OBD_FREE(mdc, strlen(mdc) + 1);
int next = 0;
/* like ll_put_super below */
lustre_end_log(sb, NULL, &cfg);
- while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next))
+ while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next))
!= NULL) {
class_manual_cleanup(obd);
- }
+ }
class_del_profile(profilenm);
ll_free_sbi(sb);
lsi->lsi_llsbi = NULL;
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op: sb %p - %s\n", sb, profilenm);
-
+
sprintf(ll_instance, "%p", sb);
cfg.cfg_instance = ll_instance;
lustre_end_log(sb, NULL, &cfg);
-
+
obd = class_exp2obd(sbi->ll_md_exp);
if (obd) {
int next = 0;
int force = obd->obd_no_recov;
- /* We need to set force before the lov_disconnect in
+ /* We need to set force before the lov_disconnect in
lustre_common_put_super, since l_d cleans up osc's as well. */
- while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next))
+ while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next))
!= NULL) {
obd->obd_force = force;
- }
+ }
}
client_common_put_super(sb);
-
+
while ((obd = class_devices_in_group(&sbi->ll_sb_uuid, &next)) !=NULL) {
class_manual_cleanup(obd);
- }
-
- if (profilenm)
+ }
+
+ if (profilenm)
class_del_profile(profilenm);
ll_free_sbi(sb);
inode = igrab(lock->l_ast_data);
} else {
inode = lock->l_ast_data;
- __LDLM_DEBUG(inode->i_state & I_FREEING ?
- D_INFO : D_WARNING, lock,
+ if (inode->i_state & I_FREEING)
+ __LDLM_DEBUG(D_INFO, lock,
"l_ast_data %p is bogus: magic %08x",
lock->l_ast_data, lli->lli_inode_magic);
+ else
+ __LDLM_DEBUG(D_WARNING, lock,
+ "l_ast_data %p is bogus: magic %08x",
+ lock->l_ast_data, lli->lli_inode_magic);
+
inode = NULL;
}
}
struct lov_ost_data_v1 *lod;
int i;
- CDEBUG(level, "objid "LPX64", magic 0x%08X, pattern %#X\n",
+ CDEBUG_EX(level, "objid "LPX64", magic 0x%08X, pattern %#X\n",
le64_to_cpu(lmm->lmm_object_id), le32_to_cpu(lmm->lmm_magic),
le32_to_cpu(lmm->lmm_pattern));
- CDEBUG(level,"stripe_size %u, stripe_count %u\n",
+ CDEBUG_EX(level,"stripe_size %u, stripe_count %u\n",
le32_to_cpu(lmm->lmm_stripe_size),
le32_to_cpu(lmm->lmm_stripe_count));
for (i = 0, lod = lmm->lmm_objects;
i < le32_to_cpu(lmm->lmm_stripe_count); i++, lod++)
- CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n",
+ CDEBUG_EX(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n",
i, le32_to_cpu(lod->l_ost_idx),
le64_to_cpu(lod->l_object_gr),
le64_to_cpu(lod->l_object_id));
void lov_dump_lmm_join(int level, struct lov_mds_md_join *lmmj)
{
- CDEBUG(level, "objid "LPX64", magic 0x%08X, pattern %#X\n",
- le64_to_cpu(lmmj->lmmj_md.lmm_object_id),
+ CDEBUG_EX(level, "objid "LPX64", magic 0x%08X, pattern %#X\n",
+ le64_to_cpu(lmmj->lmmj_md.lmm_object_id),
le32_to_cpu(lmmj->lmmj_md.lmm_magic),
le32_to_cpu(lmmj->lmmj_md.lmm_pattern));
- CDEBUG(level,"stripe_size %u, stripe_count %u extent_count %u \n",
+ CDEBUG_EX(level,"stripe_size %u, stripe_count %u extent_count %u \n",
le32_to_cpu(lmmj->lmmj_md.lmm_stripe_size),
- le32_to_cpu(lmmj->lmmj_md.lmm_stripe_count),
+ le32_to_cpu(lmmj->lmmj_md.lmm_stripe_count),
le32_to_cpu(lmmj->lmmj_extent_count));
}
return rc;
}
-int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count,
+int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count,
int pattern, int magic)
{
int lsm_size = lov_stripe_md_size(stripe_count);
int i;
ENTRY;
- CDEBUG(D_INFO, "alloc lsm, stripe_count %d, lsm_size %d\n",
+ CDEBUG(D_INFO, "alloc lsm, stripe_count %d, lsm_size %d\n",
stripe_count, lsm_size);
OBD_ALLOC(*lsmp, lsm_size);
(*lsmp)->lsm_xfersize = PTLRPC_MAX_BRW_SIZE * stripe_count;
(*lsmp)->lsm_pattern = pattern;
(*lsmp)->lsm_oinfo[0].loi_ost_idx = ~0;
-
+
for (i = 0, loi = (*lsmp)->lsm_oinfo; i < stripe_count; i++, loi++)
loi_init(loi);
void lov_free_memmd(struct lov_stripe_md **lsmp)
{
struct lov_stripe_md *lsm = *lsmp;
-
+
LASSERT(lsm_op_find(lsm->lsm_magic) != NULL);
lsm_op_find(lsm->lsm_magic)->lsm_free(lsm);
-
+
*lsmp = NULL;
}
/* Unpack LOV object metadata from disk storage. It is packed in LE byte
* order and is opaque to the networking layer.
*/
-int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
+int lov_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
struct lov_mds_md *lmm, int lmm_bytes)
{
struct obd_device *obd = class_exp2obd(exp);
RETURN(0);
}
- lsm_size = lov_alloc_memmd(lsmp, stripe_count, LOV_PATTERN_RAID0,
+ lsm_size = lov_alloc_memmd(lsmp, stripe_count, LOV_PATTERN_RAID0,
magic);
if (lsm_size < 0)
RETURN(lsm_size);
ENTRY;
leaked = atomic_read(&obd_memory);
- CDEBUG(leaked ? D_ERROR : D_INFO,
+ CDEBUG_EX(leaked ? D_ERROR : D_INFO,
"obd mem max: %d leaked: %d\n", obd_memmax, leaked);
return;
sizeof(zero_mcd), &off, 1);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- CDEBUG(rc == 0 ? D_INFO : D_ERROR,
+ CDEBUG_EX(rc == 0 ? D_INFO : D_ERROR,
"zeroing out client %s idx %u in %s rc %d\n",
med->med_mcd->mcd_uuid, med->med_lr_idx, LAST_RCVD, rc);
}
CDEBUG(D_WARNING, "using old last_rcvd format\n");
lsd->lsd_mount_count = lsd->lsd_last_transno;
lsd->lsd_last_transno = lsd->lsd_unused;
- /* If we update the last_rcvd, we can never go back to
+ /* If we update the last_rcvd, we can never go back to
an old install, so leave this in the old format for now.
lsd->lsd_feature_incompat |= cpu_to_le32(LR_INCOMPAT_COMMON_LR);
*/
}
lsd->lsd_feature_compat = cpu_to_le32(OBD_COMPAT_MDT);
-
+
mds->mds_last_transno = le64_to_cpu(lsd->lsd_last_transno);
CDEBUG(D_INODE, "%s: server last_transno: "LPU64"\n",
return rc;
err_health_check:
- if (mds->mds_health_check_filp &&
+ if (mds->mds_health_check_filp &&
filp_close(mds->mds_health_check_filp, 0))
CERROR("can't close %s after error\n", HEALTH_CHECK);
err_lov_objid:
CDEBUG(D_INFO, "change the max md size from %d to %d \n",
mds->mds_max_mdsize, sizeof(*lmmj));
- if (mds->mds_max_mdsize < max_easize ||
+ if (mds->mds_max_mdsize < max_easize ||
mds->mds_max_cookiesize < max_cookiesize) {
body->max_mdsize = mds->mds_max_mdsize > max_easize ?
mds->mds_max_mdsize : max_easize;
if (rc < 0)
GOTO(cleanup, rc);
- LASSERTF(le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC_JOIN ||
- le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC);
+ LASSERT(le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC_JOIN ||
+ le32_to_cpu(head_lmm->lmm_magic) == LOV_MAGIC);
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
ctxt = llog_get_context(obd, LLOG_LOVEA_ORIG_CTXT);
int level = D_ERROR;
if (rc == -ENOSPC)
level = D_INODE;
- CDEBUG(level, "error creating objects for "
+ CDEBUG_EX(level, "error creating objects for "
"inode %lu: rc = %d\n",
inode->i_ino, rc);
if (rc > 0) {
UNLOCK_INODE_MUTEX(dchild->d_inode);
RETURN(-EEXIST);
}
- if (rec->ur_flags & MDS_OPEN_JOIN_FILE) {
+ if (rec->ur_flags & MDS_OPEN_JOIN_FILE) {
UNLOCK_INODE_MUTEX(dchild->d_inode);
- rc = mds_join_file(rec, req, dchild, lockh);
+ rc = mds_join_file(rec, req, dchild, lockh);
if (rc)
RETURN(rc);
LOCK_INODE_MUTEX(dchild->d_inode);
- }
- if (!(body->valid & OBD_MD_FLEASIZE) &&
+ }
+ if (!(body->valid & OBD_MD_FLEASIZE) &&
!(body->valid & OBD_MD_FLMODEASIZE)) {
/* no EA: create objects */
rc = mds_create_objects(req, 2, rec, mds, obd,
rc = err;
}
- DEBUG_REQ(log_pri, req,
- "wrote trans #"LPU64" rc %d client %s at idx %u: err = %d",
- transno, rc, mcd->mcd_uuid, med->med_lr_idx, err);
+ DEBUG_REQ_EX(log_pri, req,
+ "wrote trans #"LPU64" rc %d client %s at idx %u: err = %d",
+ transno, rc, mcd->mcd_uuid, med->med_lr_idx, err);
err = mds_lov_write_objids(obd);
if (err) {
if (rc == 0)
rc = err;
}
- CDEBUG(log_pri, "wrote objids: err = %d\n", err);
+ CDEBUG_EX(log_pri, "wrote objids: err = %d\n", err);
commit:
err = fsfilt_commit(obd, inode, handle, 0);
RETURN(0);
save_dev = lvfs_sbdev(mgs->mgs_sb);
-
+
ptlrpc_unregister_service(mgs->mgs_service);
lprocfs_obd_cleanup(obd);
server_put_mount(obd->obd_name, mgs->mgs_vfsmnt);
mgs->mgs_sb = NULL;
- /* Free the namespace in it's own thread, so that if the
- ldlm_cancel_handler put the last mgs obd ref, we won't
+ /* Free the namespace in it's own thread, so that if the
+ ldlm_cancel_handler put the last mgs obd ref, we won't
deadlock here. */
kernel_thread(mgs_ldlm_nsfree, obd->obd_namespace, CLONE_VM | CLONE_FS);
LASSERT(current->journal_info == NULL);
- CDEBUG(D_CONFIG | (rc?D_ERROR:0), "MGS handle cmd=%d rc=%d\n",
+ CDEBUG_EX(D_CONFIG | (rc?D_ERROR:0), "MGS handle cmd=%d rc=%d\n",
req->rq_reqmsg->opc, rc);
out:
void dump_lsm(int level, struct lov_stripe_md *lsm)
{
- CDEBUG(level, "lsm %p, objid "LPX64", maxbytes "LPX64", magic 0x%08X, "
+ CDEBUG_EX(level, "lsm %p, objid "LPX64", maxbytes "LPX64", magic 0x%08X, "
"stripe_size %u, stripe_count %u\n", lsm,
lsm->lsm_object_id, lsm->lsm_maxbytes, lsm->lsm_magic,
lsm->lsm_stripe_size, lsm->lsm_stripe_count);
rc = err;
}
- CDEBUG(log_pri, "wrote trans "LPU64" for client %s at #%d: err = %d\n",
+ CDEBUG_EX(log_pri, "wrote trans "LPU64" for client %s at #%d: err = %d\n",
last_rcvd, fcd->fcd_uuid, fed->fed_lr_idx, err);
RETURN(rc);
filter->fo_fsd, 1);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- CDEBUG(rc == 0 ? D_INFO : D_ERROR,
+ CDEBUG_EX(rc == 0 ? D_INFO : D_ERROR,
"zeroing out client %s at idx %u (%llu) in %s rc %d\n",
fed->fed_fcd->fcd_uuid, fed->fed_lr_idx, fed->fed_lr_off,
LAST_RCVD, rc);
} else {
str = "no UUID";
}
-
+
label = fsfilt_get_label(obd, obd->u.obt.obt_sb);
if (obd->obd_recovering) {
unsigned int cur_ids[MAXQUOTAS] = {oa->o_uid, oa->o_gid};
int rc2 = lquota_adjust(quota_interface, exp->exp_obd, cur_ids,
orig_ids, rc, FSFILT_OP_SETATTR);
- CDEBUG(rc2 ? D_ERROR : D_QUOTA,
+ CDEBUG_EX(rc2 ? D_ERROR : D_QUOTA,
"filter adjust qunit. (rc:%d)\n", rc2);
}
return rc;
qcids[GRPQUOTA] = oa->o_gid;
rc2 = lquota_adjust(quota_interface, obd, qcids, NULL, rc,
FSFILT_OP_UNLINK);
- CDEBUG(rc2 ? D_ERROR : D_QUOTA,
+ CDEBUG_EX(rc2 ? D_ERROR : D_QUOTA,
"filter adjust qunit! (rc:%d)\n", rc2);
return rc;
}
/* Add some margin, since there is a small race if other RPCs arrive
* out-or-order and have already consumed some grant. We want to
* leave this here in case there is a large error in accounting. */
- CDEBUG(oa->o_grant > fed->fed_grant + FILTER_GRANT_CHUNK ? mask:D_CACHE,
+ CDEBUG_EX(oa->o_grant > fed->fed_grant + FILTER_GRANT_CHUNK ? mask:D_CACHE,
"%s: cli %s/%p reports grant: "LPU64" dropped: %u, local: %lu\n",
obd->obd_name, exp->exp_client_uuid.uuid, exp, oa->o_grant,
oa->o_dropped, fed->fed_grant);
fed->fed_pending += used;
exp->exp_obd->u.filter.fo_tot_pending += used;
- CDEBUG(mask,
+ CDEBUG_EX(mask,
"%s: cli %s/%p used: %lu ungranted: %lu grant: %lu dirty: %lu\n",
exp->exp_obd->obd_name, exp->exp_client_uuid.uuid, exp, used,
ungranted, fed->fed_grant, fed->fed_dirty);
if (IS_ERR(oti->oti_handle)) {
UNLOCK_INODE_MUTEX(inode);
rc = PTR_ERR(oti->oti_handle);
- CDEBUG(rc == -ENOSPC ? D_INODE : D_ERROR,
+ CDEBUG_EX(rc == -ENOSPC ? D_INODE : D_ERROR,
"error starting transaction: rc = %d\n", rc);
oti->oti_handle = NULL;
GOTO(cleanup, rc);
qcids[USRQUOTA] = oa->o_uid;
qcids[GRPQUOTA] = oa->o_gid;
err = lquota_adjust(quota_interface, obd, qcids, NULL, rc,
- FSFILT_OP_CREATE);
- CDEBUG(err ? D_ERROR : D_QUOTA,
+ FSFILT_OP_CREATE);
+ CDEBUG_EX(err ? D_ERROR : D_QUOTA,
"error filter adjust qunit! (rc:%d)\n", err);
RETURN(rc);
lnet_handle_eq_t ptlrpc_eq_h;
-/*
+/*
* Client's outgoing request callback
*/
void request_out_callback(lnet_event_t *ev)
ev->type == LNET_EVENT_UNLINK);
LASSERT (ev->unlinked);
- DEBUG_REQ((ev->status == 0) ? D_NET : D_ERROR, req,
- "type %d, status %d", ev->type, ev->status);
+ DEBUG_REQ_EX((ev->status == 0) ? D_NET : D_ERROR, req,
+ "type %d, status %d", ev->type, ev->status);
if (ev->type == LNET_EVENT_UNLINK || ev->status != 0) {
LASSERT (ev->md.start == req->rq_repmsg);
LASSERT (ev->offset == 0);
LASSERT (ev->mlength <= req->rq_replen);
-
- DEBUG_REQ((ev->status == 0) ? D_NET : D_ERROR, req,
- "type %d, status %d", ev->type, ev->status);
+
+ DEBUG_REQ_EX((ev->status == 0) ? D_NET : D_ERROR, req,
+ "type %d, status %d", ev->type, ev->status);
spin_lock_irqsave (&req->rq_lock, flags);
EXIT;
}
-/*
+/*
* Client's bulk has been written/read
*/
void client_bulk_callback (lnet_event_t *ev)
unsigned long flags;
ENTRY;
- LASSERT ((desc->bd_type == BULK_PUT_SINK &&
+ LASSERT ((desc->bd_type == BULK_PUT_SINK &&
ev->type == LNET_EVENT_PUT) ||
(desc->bd_type == BULK_GET_SOURCE &&
ev->type == LNET_EVENT_GET) ||
ev->type == LNET_EVENT_UNLINK);
LASSERT (ev->unlinked);
- CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
- "event type %d, status %d, desc %p\n",
+ CDEBUG_EX((ev->status == 0) ? D_NET : D_ERROR,
+ "event type %d, status %d, desc %p\n",
ev->type, ev->status, desc);
spin_lock_irqsave (&desc->bd_lock, flags);
EXIT;
}
-/*
+/*
* Server's incoming request callback
*/
void request_in_callback(lnet_event_t *ev)
LASSERT ((char *)ev->md.start + ev->offset + ev->mlength <=
rqbd->rqbd_buffer + service->srv_buf_size);
- CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
- "event type %d, status %d, service %s\n",
+ CDEBUG_EX((ev->status == 0) ? D_NET : D_ERROR,
+ "event type %d, status %d, service %s\n",
ev->type, ev->status, service->srv_name);
if (ev->unlinked) {
if (req == NULL) {
CERROR("Can't allocate incoming request descriptor: "
"Dropping %s RPC from %s\n",
- service->srv_name,
+ service->srv_name,
libcfs_id2str(ev->initiator));
return;
}
service->srv_nrqbd_receiving == 0) {
/* This service is off-air because all its request
* buffers are busy. Portals will start dropping
- * incoming requests until more buffers get posted.
+ * incoming requests until more buffers get posted.
* NB don't moan if it's because we're tearing down the
* service. */
CERROR("All %s request buffers busy\n",
(desc->bd_type == BULK_GET_SINK &&
ev->type == LNET_EVENT_REPLY));
- CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
- "event type %d, status %d, desc %p\n",
+ CDEBUG_EX((ev->status == 0) ? D_NET : D_ERROR,
+ "event type %d, status %d, desc %p\n",
ev->type, ev->status, desc);
spin_lock_irqsave (&desc->bd_lock, flags);
-
+
if ((ev->type == LNET_EVENT_ACK ||
ev->type == LNET_EVENT_REPLY) &&
ev->status == 0) {
callback == request_in_callback ||
callback == reply_out_callback ||
callback == server_bulk_callback);
-
+
callback (ev);
}
-int ptlrpc_uuid_to_peer (struct obd_uuid *uuid,
+int ptlrpc_uuid_to_peer (struct obd_uuid *uuid,
lnet_process_id_t *peer, lnet_nid_t *self)
{
int best_dist = 0;
rc = 0;
break;
}
-
+
LASSERT (order >= 0);
if (rc < 0 ||
dist < best_dist ||
}
CDEBUG(D_NET,"%s->%s\n", uuid->uuid, libcfs_id2str(*peer));
- if (rc != 0)
+ if (rc != 0)
CERROR("No NID found for %s\n", uuid->uuid);
return rc;
}
struct l_wait_info lwi;
int rc;
int retries;
-
+
/* Wait for the event queue to become idle since there may still be
* messages in flight with pending events (i.e. the fire-and-forget
* messages == client requests and "non-difficult" server
case 0:
LNetNIFini();
return;
-
+
case -EBUSY:
if (retries != 0)
CWARN("Event queue still busy\n");
-
+
/* Wait for a bit */
init_waitqueue_head(&waitq);
lwi = LWI_TIMEOUT(2*HZ, NULL, NULL);
#endif
return pid;
}
-
+
int ptlrpc_ni_init(void)
{
int rc;
liblustre_register_wait_callback (int (*fn)(void *arg), void *arg)
{
struct liblustre_wait_callback *llwc;
-
+
OBD_ALLOC(llwc, sizeof(*llwc));
LASSERT (llwc != NULL);
-
+
llwc->llwc_fn = fn;
llwc->llwc_arg = arg;
list_add_tail(&llwc->llwc_list, &liblustre_wait_callbacks);
-
+
return (llwc);
}
liblustre_deregister_wait_callback (void *opaque)
{
struct liblustre_wait_callback *llwc = opaque;
-
+
list_del(&llwc->llwc_list);
OBD_FREE(llwc, sizeof(*llwc));
}
rc = LNetEQPoll(&ptlrpc_eq_h, 1, timeout * 1000, &ev, &i);
if (rc == 0)
RETURN(0);
-
+
LASSERT (rc == -EOVERFLOW || rc == 1);
-
+
/* liblustre: no asynch callback so we can't affort to miss any
* events... */
if (rc == -EOVERFLOW) {
CERROR ("Dropped an event!!!\n");
abort();
}
-
+
ptlrpc_master_callback (&ev);
RETURN(1);
}
/* Give all registered callbacks a bite at the cherry */
list_for_each(tmp, &liblustre_wait_callbacks) {
- llwc = list_entry(tmp, struct liblustre_wait_callback,
+ llwc = list_entry(tmp, struct liblustre_wait_callback,
llwc_list);
-
+
if (llwc->llwc_fn(llwc->llwc_arg))
found_something = 1;
}
return -EIO;
}
#ifndef __KERNEL__
- liblustre_services_callback =
+ liblustre_services_callback =
liblustre_register_wait_callback(&liblustre_check_services, NULL);
#endif
return 0;
imp->imp_force_verify = 0;
spin_unlock_irqrestore(&imp->imp_lock, flags);
- CDEBUG(level == LUSTRE_IMP_FULL ? D_INFO : D_HA,
+ CDEBUG_EX(level == LUSTRE_IMP_FULL ? D_INFO : D_HA,
"level %s/%u force %u deactive %u pingable %u\n",
ptlrpc_import_state_name(level), level,
force, imp->imp_deactive, imp->imp_pingable);
/* FIXME check if this mds is the master of specified id */
-static int
-is_master(struct obd_device *obd, struct lustre_quota_ctxt *qctxt,
+static int
+is_master(struct obd_device *obd, struct lustre_quota_ctxt *qctxt,
unsigned int id, int type)
{
return qctxt->lqc_handler ? 1 : 0;
}
-static int
+static int
schedule_dqacq(struct obd_device *obd, struct lustre_quota_ctxt *qctxt,
struct qunit_data *qdata, int opc, int wait);
* - local dqacq/dqrel.
* - local disk io failure.
*/
- if (err || (rc && rc != -EBUSY) ||
+ if (err || (rc && rc != -EBUSY) ||
is_master(obd, qctxt, qdata->qd_id, qdata->qd_type))
RETURN(err);
if ((empty = alloc_qunit(qctxt, qdata, opc)) == NULL)
RETURN(-ENOMEM);
-
+
spin_lock(&qunit_hash_lock);
qunit = dqacq_in_flight(qctxt, qdata);
if (qunit) {
- if (wait)
+ if (wait)
list_add_tail(&qw.qw_entry, &qunit->lq_waiters);
spin_unlock(&qunit_hash_lock);
-
+
free_qunit(empty);
goto wait_completion;
- }
+ }
qunit = empty;
insert_qunit_nolock(qctxt, qunit);
if (wait)
req->rq_interpret_reply = dqacq_interpret;
ptlrpcd_add_req(req);
- QDATA_DEBUG(qdata, "%s scheduled.\n",
+ QDATA_DEBUG(qdata, "%s scheduled.\n",
opc == QUOTA_DQACQ ? "DQACQ" : "DQREL");
wait_completion:
if (wait && qunit) {
RETURN(rc);
}
-int
+int
qctxt_wait_pending_dqacq(struct lustre_quota_ctxt *qctxt, unsigned int id,
unsigned short type, int isblk)
{
remove_qunit_nolock(qunit);
/* wake up all waiters */
- list_for_each_entry_safe(qw, tmp2, &qunit->lq_waiters,
+ list_for_each_entry_safe(qw, tmp2, &qunit->lq_waiters,
qw_entry) {
list_del_init(&qw->qw_entry);
qw->qw_rc = 0;
struct qslave_recov_thread_data *data = arg;
struct obd_device *obd = data->obd;
struct lustre_quota_ctxt *qctxt = data->qctxt;
- unsigned int type;
+ unsigned int type;
int rc = 0;
ENTRY;
rc = 0;
if (rc)
- CDEBUG(rc == -EBUSY ? D_QUOTA : D_ERROR,
+ CDEBUG_EX(rc == -EBUSY ? D_QUOTA : D_ERROR,
"qslave recovery failed! (id:%d type:%d "
" rc:%d)\n", dqid->di_id, type, rc);
free:
RETURN(rc);
}
-void
+void
qslave_start_recovery(struct obd_device *obd, struct lustre_quota_ctxt *qctxt)
{
struct qslave_recov_thread_data data;
bunit = option;
break;
case Opt_itune_ratio:
- if (match_int(&args[0], &option) ||
+ if (match_int(&args[0], &option) ||
option <= 0 || option >= 100)
rc = -EINVAL;
itune = option;
return rc;
}
-static int auto_quota_on(struct obd_device *obd, int type,
+static int auto_quota_on(struct obd_device *obd, int type,
struct super_block *sb, int is_master)
{
struct obd_quotactl *oqctl;
local_quota:
/* turn on local quota */
rc = fsfilt_quotactl(obd, sb, oqctl);
- CDEBUG(rc ? D_ERROR : D_INFO, "auto-enable quota. rc=%d\n", rc);
+ CDEBUG_EX(rc ? D_ERROR : D_INFO, "auto-enable quota. rc=%d\n", rc);
if (rc && is_master)
mds_quota_off(obd, oqctl);
out_pop:
oa->o_valid |= (cnt == USRQUOTA) ?
OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA;
if (oqctl->qc_dqblk.dqb_bhardlimit &&
- (toqb(oqctl->qc_dqblk.dqb_curspace) >
+ (toqb(oqctl->qc_dqblk.dqb_curspace) >
oqctl->qc_dqblk.dqb_bhardlimit))
- oa->o_flags |= (cnt == USRQUOTA) ?
+ oa->o_flags |= (cnt == USRQUOTA) ?
OBD_FL_NO_USRQUOTA : OBD_FL_NO_GRPQUOTA;
}
OBD_FREE_PTR(oqctl);
RETURN(rc);
}
-static int filter_quota_acquire(struct obd_device *obd, unsigned int uid,
+static int filter_quota_acquire(struct obd_device *obd, unsigned int uid,
unsigned int gid)
{
struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt;
/* SLAB cache for client quota context */
kmem_cache_t *qinfo_cachep = NULL;
-static inline int const hashfn(struct client_obd *cli,
- unsigned long id,
+static inline int const hashfn(struct client_obd *cli,
+ unsigned long id,
int type)
{
unsigned long tmp = ((unsigned long)cli>>6) ^ id;
/* caller must hold qinfo_list_lock */
static inline void insert_qinfo_hash(struct osc_quota_info *oqi)
{
- struct list_head *head = qinfo_hash +
+ struct list_head *head = qinfo_hash +
hashfn(oqi->oqi_cli, oqi->oqi_id, oqi->oqi_type);
LASSERT_SPIN_LOCKED(&qinfo_list_lock);
OBD_SLAB_FREE(oqi, qinfo_cachep, sizeof(*oqi));
}
-int osc_quota_chkdq(struct client_obd *cli,
+int osc_quota_chkdq(struct client_obd *cli,
unsigned int uid, unsigned int gid)
{
unsigned int id;
RETURN(rc);
}
-int osc_quota_setdq(struct client_obd *cli,
+int osc_quota_setdq(struct client_obd *cli,
unsigned int uid, unsigned int gid,
obd_flag valid, obd_flag flags)
{
for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
struct osc_quota_info *oqi, *old;
- if (!(valid & ((cnt == USRQUOTA) ?
+ if (!(valid & ((cnt == USRQUOTA) ?
OBD_MD_FLUSRQUOTA : OBD_MD_FLGRPQUOTA)))
continue;
id = (cnt == USRQUOTA) ? uid : gid;
- noquota = (cnt == USRQUOTA) ?
+ noquota = (cnt == USRQUOTA) ?
(flags & OBD_FL_NO_USRQUOTA) : (flags & OBD_FL_NO_GRPQUOTA);
oqi = alloc_qinfo(cli, id, cnt);
# use anything else and feel the pain ;)
{
my $arch = shift;
- $x = "[0-9a-f]{3,5}"; # hex number >= 256
- $d = "([0-9]{2}|[2-9])[0-9]{2}"; # decimal number >= 200
+ $x = "[0-9a-f]{1,5}"; # hex number
+ $d = "[0-9]{1,5}"; # decimal number
if ($arch eq "") {
$arch = `uname -m`;
}