[sheepdog] [PATCH] sheep: clean up some sd_printf
Liu Yuan
namei.unix at gmail.com
Sun Feb 3 14:36:20 CET 2013
From: Liu Yuan <tailai.ly at taobao.com>
These sd_printf aren't informative to ordinary users. We'd better keep them
as debug info to hide from users.
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
sheep/group.c | 2 +-
sheep/ops.c | 2 +-
sheep/vdi.c | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/sheep/group.c b/sheep/group.c
index 32ac85d..85e0032 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -304,7 +304,7 @@ bool sd_block_handler(const struct sd_node *sender)
*/
void queue_cluster_request(struct request *req)
{
- sd_eprintf("%s (%p)\n", op_name(req->op), req);
+ sd_dprintf("%s (%p)\n", op_name(req->op), req);
if (has_process_work(req->op)) {
list_add_tail(&req->pending_list, &sys->pending_block_list);
diff --git a/sheep/ops.c b/sheep/ops.c
index e0ab1db..c1940c8 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -136,7 +136,7 @@ static int post_cluster_new_vdi(const struct sd_req *req, struct sd_rsp *rsp,
unsigned long nr = rsp->vdi.vdi_id;
int ret = rsp->result;
- sd_printf(SDOG_INFO, "done %d %ld\n", ret, nr);
+ sd_dprintf("done %d %ld\n", ret, nr);
if (ret == SD_RES_SUCCESS)
set_bit(nr, sys->vdi_inuse);
diff --git a/sheep/vdi.c b/sheep/vdi.c
index d8e2104..e7f55ff 100644
--- a/sheep/vdi.c
+++ b/sheep/vdi.c
@@ -370,7 +370,7 @@ static int do_lookup_vdi(const char *name, int namelen, uint32_t *vid,
start_nr = fnv_64a_buf(name, namelen, FNV1A_64_INIT) & (SD_NR_VDIS - 1);
- sd_printf(SDOG_INFO, "looking for %s (%lx)\n", name, start_nr);
+ sd_dprintf("looking for %s (%lx)\n", name, start_nr);
/* bitmap search from the hash point */
nr = find_next_zero_bit(sys->vdi_inuse, SD_NR_VDIS, start_nr);
@@ -486,10 +486,10 @@ int add_vdi(struct vdi_iocb *iocb, uint32_t *new_vid)
notify_vdi_add(nr, iocb->nr_copies);
- sd_printf(SDOG_INFO, "creating new %s %s: size %" PRIu64 ", vid %"
- PRIx32 ", base %" PRIx32 ", cur %" PRIx32 ", copies %d\n",
- iocb->create_snapshot ? "snapshot" : "vdi", name, iocb->size,
- *new_vid, iocb->base_vid, cur_vid, iocb->nr_copies);
+ sd_iprintf("creating new %s %s: size %" PRIu64 ", vid %"
+ PRIx32 ", base %" PRIx32 ", cur %" PRIx32 ", copies %d\n",
+ iocb->create_snapshot ? "snapshot" : "vdi", name, iocb->size,
+ *new_vid, iocb->base_vid, cur_vid, iocb->nr_copies);
return create_vdi_obj(iocb, *new_vid, cur_vid, next_snapid);
}
@@ -603,7 +603,7 @@ static void delete_one(struct work *work)
struct sheepdog_inode *inode = NULL;
int nr_copies;
- sd_eprintf("%d %d, %16x\n", dw->done, dw->count, vdi_id);
+ sd_dprintf("%d %d, %16x\n", dw->done, dw->count, vdi_id);
inode = malloc(sizeof(*inode));
if (!inode) {
--
1.7.9.5
More information about the sheepdog
mailing list