pct = 0;
}
- printk("FLD cache statistics (%s):\n", cache->fci_name);
- printk(" Total reqs: "LPU64"\n", cache->fci_stat.fst_count);
- printk(" Cache reqs: "LPU64"\n", cache->fci_stat.fst_cache);
- printk(" Saved RPCs: "LPU64"\n", cache->fci_stat.fst_inflight);
- printk(" Cache hits: "LPU64"%%\n", pct);
+ CDEBUG(D_INFO, "FLD cache statistics (%s):\n", cache->fci_name);
+ CDEBUG(D_INFO, " Total reqs: "LPU64"\n", cache->fci_stat.fst_count);
+ CDEBUG(D_INFO, " Cache reqs: "LPU64"\n", cache->fci_stat.fst_cache);
+ CDEBUG(D_INFO, " Saved RPCs: "LPU64"\n", cache->fci_stat.fst_inflight);
+ CDEBUG(D_INFO, " Cache hits: "LPU64"%%\n", pct);
OBD_FREE(cache->fci_hash_table, cache->fci_hash_size *
sizeof(*cache->fci_hash_table));
limiter.start = req_start;
if (interval_is_overlapped(tree->lit_root, &ext))
- printk("req_mode = %d, tree->lit_mode = %d, tree->lit_size = %d\n",
+ CDEBUG(D_INFO,
+ "req_mode = %d, tree->lit_mode = %d, "
+ "tree->lit_size = %d\n",
req_mode, tree->lit_mode, tree->lit_size);
interval_expand(tree->lit_root, &ext, &limiter);
limiter.start = max(limiter.start, ext.start);
sizeof(struct lustre_disk_dqinfo), &offset);
set_fs(fs);
if (size != sizeof(struct lustre_disk_dqinfo)) {
- printk(KERN_WARNING "Can't read info structure on device %s.\n",
+ CDEBUG(D_WARNING, "Can't read info structure on device %s.\n",
f->f_vfsmnt->mnt_sb->s_id);
return -1;
}
sizeof(struct lustre_disk_dqinfo), &offset);
set_fs(fs);
if (size != sizeof(struct lustre_disk_dqinfo)) {
- printk(KERN_WARNING
+ CDEBUG(D_WARNING,
"Can't write info structure on device %s.\n",
f->f_vfsmnt->mnt_sb->s_id);
return -1;
{
dqbuf_t buf = kmalloc(LUSTRE_DQBLKSIZE, GFP_NOFS);
if (!buf)
- printk(KERN_WARNING
+ CDEBUG(D_WARNING,
"VFS: Not enough memory for quota buffers.\n");
return buf;
}
freedqbuf(tmpbuf);
dh->dqdh_next_free = dh->dqdh_prev_free = cpu_to_le32(0);
if (write_blk(filp, blk, buf) < 0) /* No matter whether write succeeds block is out of list */
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't write block (%u) with free entries.\n", blk);
return 0;
out_buf:
}
if (le16_to_cpu(dh->dqdh_entries) + 1 >= LUSTRE_DQSTRINBLK) /* Block will be full? */
if ((*err = remove_free_dqentry(filp, info, buf, blk)) < 0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: find_free_dqentry(): Can't remove block (%u) from entry free list.\n",
blk);
goto out_buf;
memcmp(&fakedquot, ddquot + i, sizeof(fakedquot)); i++) ;
if (i == LUSTRE_DQSTRINBLK) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: find_free_dqentry(): Data block full but it shouldn't.\n");
*err = -EIO;
goto out_buf;
}
if ((*err = write_blk(filp, blk, buf)) < 0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: find_free_dqentry(): Can't write quota data block %u.\n",
blk);
goto out_buf;
newact = 1;
} else {
if ((ret = read_blk(filp, *treeblk, buf)) < 0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't read tree quota block %u.\n",
*treeblk);
goto out_buf;
if (depth == LUSTRE_DQTREEDEPTH - 1) {
if (newblk) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Inserting already present quota entry (block %u).\n",
ref[GETIDINDEX(dquot->dq_id, depth)]);
ret = -EIO;
if (!dquot->dq_off)
if ((ret = dq_insert_tree(dquot)) < 0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Error %Zd occurred while creating quota.\n",
ret);
return ret;
sizeof(struct lustre_disk_dqblk), &offset);
set_fs(fs);
if (ret != sizeof(struct lustre_disk_dqblk)) {
- printk(KERN_WARNING "VFS: dquota write failed on dev %s\n",
+ CDEBUG(D_WARNING, "VFS: dquota write failed on dev %s\n",
filp->f_dentry->d_sb->s_id);
if (ret >= 0)
ret = -ENOSPC;
if (!buf)
return -ENOMEM;
if (dquot->dq_off >> LUSTRE_DQBLKSIZE_BITS != blk) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Quota structure has offset to other block (%u) than it should (%u).\n",
blk, (uint) (dquot->dq_off >> LUSTRE_DQBLKSIZE_BITS));
goto out_buf;
}
if ((ret = read_blk(filp, blk, buf)) < 0) {
- printk(KERN_ERR "VFS: Can't read quota data block %u\n", blk);
+ CDEBUG(D_ERROR, "VFS: Can't read quota data block %u\n", blk);
goto out_buf;
}
dh = (struct lustre_disk_dqdbheader *)buf;
if (!le16_to_cpu(dh->dqdh_entries)) { /* Block got free? */
if ((ret = remove_free_dqentry(filp, info, buf, blk)) < 0 ||
(ret = put_free_dqblk(filp, info, buf, blk)) < 0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't move quota data block (%u) to free list.\n",
blk);
goto out_buf;
/* Insert will write block itself */
if ((ret =
insert_free_dqentry(filp, info, buf, blk)) < 0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't insert quota data block (%u) to free entry list.\n",
blk);
goto out_buf;
}
} else if ((ret = write_blk(filp, blk, buf)) < 0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't write quota data block %u\n", blk);
goto out_buf;
}
if (!buf)
return -ENOMEM;
if ((ret = read_blk(filp, *blk, buf)) < 0) {
- printk(KERN_ERR "VFS: Can't read quota data block %u\n", *blk);
+ CDEBUG(D_ERROR, "VFS: Can't read quota data block %u\n", *blk);
goto out_buf;
}
newblk = le32_to_cpu(ref[GETIDINDEX(dquot->dq_id, depth)]);
put_free_dqblk(filp, info, buf, *blk);
*blk = 0;
} else if ((ret = write_blk(filp, *blk, buf)) < 0)
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't write quota tree block %u.\n", *blk);
}
out_buf:
if (!buf)
return -ENOMEM;
if ((ret = read_blk(filp, blk, buf)) < 0) {
- printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk);
+ CDEBUG(D_ERROR, "VFS: Can't read quota tree block %u.\n", blk);
goto out_buf;
}
if (dquot->dq_id)
break;
}
if (i == LUSTRE_DQSTRINBLK) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Quota for id %u referenced but not present.\n",
dquot->dq_id);
ret = -EIO;
if (!buf)
return -ENOMEM;
if ((ret = read_blk(filp, blk, buf)) < 0) {
- printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk);
+ CDEBUG(D_ERROR, "VFS: Can't read quota tree block %u.\n", blk);
goto out_buf;
}
ret = 0;
/* Invalidated quota? */
if (!dquot->dq_info || !(filp = dquot->dq_info->qi_files[type])) {
- printk(KERN_ERR "VFS: Quota invalidated while reading!\n");
+ CDEBUG(D_ERROR, "VFS: Quota invalidated while reading!\n");
return -EIO;
}
offset = find_dqentry(dquot);
if (offset <= 0) { /* Entry not present? */
if (offset < 0)
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't read quota structure for id %u.\n",
dquot->dq_id);
dquot->dq_off = 0;
sizeof(struct lustre_disk_dqblk)) {
if (ret >= 0)
ret = -EIO;
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Error while reading quota structure for id %u.\n",
dquot->dq_id);
memset(&ddquot, 0, sizeof(struct lustre_disk_dqblk));
sizeof(struct lustre_disk_dqheader), &offset);
if (size != sizeof(struct lustre_disk_dqheader)) {
- printk(KERN_ERR "error writing quoafile header (rc:%d)\n", rc);
+ CDEBUG(D_ERROR, "error writing quoafile header (rc:%d)\n", rc);
rc = size;
}
if (rc)
if (!buf)
return -ENOMEM;
if ((ret = quota_read(filp, inode, type, blk, buf)) < 0) {
- printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk);
+ CDEBUG(D_ERROR, "VFS: Can't read quota tree block %u.\n", blk);
goto out_buf;
}
ret = 0;
if (!buf)
return -ENOMEM;
if ((ret = quota_read(filp, inode, type, blk, buf)) < 0) {
- printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk);
+ CDEBUG(D_ERROR, "VFS: Can't read quota tree block %u.\n", blk);
goto out_buf;
}
ret = 0;
int rc;
if (!check_quota_file(fp, inode, type)) {
- printk(KERN_ERR "unknown quota file format!\n");
+ CDEBUG(D_ERROR, "unknown quota file format!\n");
return -EINVAL;
}
if (!list_empty(list)) {
- printk(KERN_ERR "not empty list\n");
+ CDEBUG(D_ERROR, "not empty list\n");
return -EINVAL;
}
INIT_LIST_HEAD(&blk_list);
rc = walk_tree_dqentry(fp, inode, type, LUSTRE_DQTREEOFF, 0, &blk_list);
if (rc) {
- printk(KERN_ERR "walk through quota file failed!(%d)\n", rc);
+ CDEBUG(D_ERROR, "walk through quota file failed!(%d)\n", rc);
goto out_free;
}
if (list_empty(&blk_list))
memset(buf, 0, LUSTRE_DQBLKSIZE);
if ((ret = quota_read(fp, inode, type, blk_item->blk, buf))<0) {
- printk(KERN_ERR
+ CDEBUG(D_ERROR,
"VFS: Can't read quota tree block %u.\n",
blk_item->blk);
rc = ret;
ASSERT_CTXT_MAGIC(new_ctx->magic);
OBD_SET_CTXT_MAGIC(save);
- /*
- CDEBUG(D_INFO,
- "= push %p->%p = cur fs %p pwd %p:d%d:i%d (%.*s), pwdmnt %p:%d\n",
- save, current, current->fs, current->fs->pwd,
- atomic_read(¤t->fs->pwd->d_count),
- atomic_read(¤t->fs->pwd->d_inode->i_count),
- current->fs->pwd->d_name.len, current->fs->pwd->d_name.name,
- current->fs->pwdmnt,
- atomic_read(¤t->fs->pwdmnt->mnt_count));
- */
-
save->fs = get_fs();
LASSERT(atomic_read(¤t->fs->pwd->d_count));
LASSERT(atomic_read(&new_ctx->pwd->d_count));
current->fs->umask = 0; /* umask already applied on client */
set_fs(new_ctx->fs);
ll_set_fs_pwd(current->fs, new_ctx->pwdmnt, new_ctx->pwd);
-
- /*
- CDEBUG(D_INFO,
- "= push %p->%p = cur fs %p pwd %p:d%d:i%d (%.*s), pwdmnt %p:%d\n",
- new_ctx, current, current->fs, current->fs->pwd,
- atomic_read(¤t->fs->pwd->d_count),
- atomic_read(¤t->fs->pwd->d_inode->i_count),
- current->fs->pwd->d_name.len, current->fs->pwd->d_name.name,
- current->fs->pwdmnt,
- atomic_read(¤t->fs->pwdmnt->mnt_count));
- */
}
EXPORT_SYMBOL(push_ctxt);
void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx,
struct lvfs_ucred *uc)
{
- //printk("pc0");
ASSERT_CTXT_MAGIC(saved->magic);
- //printk("pc1");
ASSERT_KERNEL_CTXT("popping non-kernel context!\n");
- /*
- CDEBUG(D_INFO,
- " = pop %p==%p = cur %p pwd %p:d%d:i%d (%.*s), pwdmnt %p:%d\n",
- new_ctx, current, current->fs, current->fs->pwd,
- atomic_read(¤t->fs->pwd->d_count),
- atomic_read(¤t->fs->pwd->d_inode->i_count),
- current->fs->pwd->d_name.len, current->fs->pwd->d_name.name,
- current->fs->pwdmnt,
- atomic_read(¤t->fs->pwdmnt->mnt_count));
- */
-
LASSERTF(current->fs->pwd == new_ctx->pwd, "%p != %p\n",
current->fs->pwd, new_ctx->pwd);
LASSERTF(current->fs->pwdmnt == new_ctx->pwdmnt, "%p != %p\n",
uc->luc_identity ? uc->luc_identity->mi_ginfo :
NULL);
}
-
- /*
- CDEBUG(D_INFO,
- "= pop %p->%p = cur fs %p pwd %p:d%d:i%d (%.*s), pwdmnt %p:%d\n",
- saved, current, current->fs, current->fs->pwd,
- atomic_read(¤t->fs->pwd->d_count),
- atomic_read(¤t->fs->pwd->d_inode->i_count),
- current->fs->pwd->d_name.len, current->fs->pwd->d_name.name,
- current->fs->pwdmnt,
- atomic_read(¤t->fs->pwdmnt->mnt_count));
- */
}
EXPORT_SYMBOL(pop_ctxt);
for (i = 0; i < MAXQUOTAS; i++) {
dqinfo = &lqi->qi_info[i];
- printk("%s quota info:\n", i == USRQUOTA ? "user " : "group");
- printk
- ("dqi_bgrace(%u) dqi_igrace(%u) dqi_flags(%lu) dqi_blocks(%u) "
- "dqi_free_blk(%u) dqi_free_entry(%u)\n",
- dqinfo->dqi_bgrace, dqinfo->dqi_igrace, dqinfo->dqi_flags,
- dqinfo->dqi_blocks, dqinfo->dqi_free_blk,
- dqinfo->dqi_free_entry);
+ CDEBUG(D_INFO, "%s quota info:\n", i == USRQUOTA ? "user " : "group");
+ CDEBUG(D_INFO, "dqi_bgrace(%u) dqi_igrace(%u) dqi_flags(%lu) dqi_blocks(%u) "
+ "dqi_free_blk(%u) dqi_free_entry(%u)\n",
+ dqinfo->dqi_bgrace, dqinfo->dqi_igrace, dqinfo->dqi_flags,
+ dqinfo->dqi_blocks, dqinfo->dqi_free_blk,
+ dqinfo->dqi_free_entry);
}
#endif
}
list_for_each_entry_safe(dqid, tmp, &list, di_link) {
list_del_init(&dqid->di_link);
if (rc == 0)
- printk("%d ", dqid->di_id);
+ CDEBUG(D_INFO, "%d ", dqid->di_id);
kfree(dqid);
}
- printk("\n");
+ CDEBUG(D_INFO, "\n");
}
return rc;
#else
#ifdef __KERNEL__
int lustre_register_fs(void);
- printk(KERN_INFO "Lustre: OBD class driver, info@clusterfs.com\n");
- printk(KERN_INFO " Lustre Version: "LUSTRE_VERSION_STRING"\n");
- printk(KERN_INFO " Build Version: "BUILD_VERSION"\n");
-
for (i = CAPA_SITE_CLIENT; i < CAPA_SITE_MAX; i++)
CFS_INIT_LIST_HEAD(&capa_list[i]);
-#else
- CDEBUG(D_INFO, "Lustre: OBD class driver, info@clusterfs.com\n");
- CDEBUG(D_INFO, " Lustre Version: "LUSTRE_VERSION_STRING"\n");
- CDEBUG(D_INFO, " Build Version: "BUILD_VERSION"\n");
#endif
+ LCONSOLE_INFO("Lustre: OBD class driver, info@clusterfs.com\n");
+ LCONSOLE_INFO(" Lustre Version: "LUSTRE_VERSION_STRING"\n");
+ LCONSOLE_INFO(" Build Version: "BUILD_VERSION"\n");
+
spin_lock_init(&obd_types_lock);
cfs_waitq_init(&obd_race_waitq);
obd_zombie_impexp_init();
int rc;
ENTRY;
- printk(KERN_INFO "Lustre: Echo OBD driver; http://www.lustre.org/\n");
+ LCONSOLE_INFO("Lustre: Echo OBD driver; http://www.lustre.org/\n");
LASSERT(CFS_PAGE_SIZE % OBD_ECHO_BLOCK_SIZE == 0);
struct lov_stripe_md *lsm = eco->eco_lsm;
int i;
- printk (KERN_INFO "Lustre: %s: object %p: "LPX64", refs %d%s: "LPX64
+ CDEBUG(D_INFO, "Lustre: %s: object %p: "LPX64", refs %d%s: "LPX64
"=%u!%u\n", msg, eco, eco->eco_id, eco->eco_refcount,
eco->eco_deleted ? "(deleted) " : "",
lsm->lsm_object_id, lsm->lsm_stripe_size,
lsm->lsm_stripe_count);
for (i = 0; i < lsm->lsm_stripe_count; i++)
- printk (KERN_INFO "Lustre: @%2u:"LPX64"\n",
- lsm->lsm_oinfo[i].loi_ost_idx,
- lsm->lsm_oinfo[i].loi_id);
+ CDEBUG(D_INFO, "Lustre: @%2u:"LPX64"\n",
+ lsm->lsm_oinfo[i].loi_ost_idx,
+ lsm->lsm_oinfo[i].loi_id);
}
#endif
OBD_ALLOC(buf, bufsize);
if (!buf) {
- printk("DUMP ERROR: can't alloc %d bytes\n", bufsize);
+ CDEBUG(D_ERROR, "DUMP ERROR: can't alloc %d bytes\n", bufsize);
return;
}
for (i = 0; i < size; i++)
sprintf(&buf[i+i], "%02x", (__u8) p[i]);
buf[size + size] = '\0';
- printk("DUMP %s@%p(%d): %s\n", name, ptr, size, buf);
+ LCONSOLE_INFO("DUMP %s@%p(%d): %s\n", name, ptr, size, buf);
OBD_FREE(buf, bufsize);
}