sys/dev/disk/dm: Rename aprint_debug() to dmdebug()
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 9 Nov 2015 10:21:17 +0000 (19:21 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Mon, 9 Nov 2015 11:09:02 +0000 (20:09 +0900)
Not sure what aprint is, but dmdebug() is better considering
this macro does
    if (dm_debug_level) kprintf(...);

sys/dev/disk/dm/device-mapper.c
sys/dev/disk/dm/dm.h
sys/dev/disk/dm/dm_dev.c
sys/dev/disk/dm/dm_ioctl.c
sys/dev/disk/dm/dm_pdev.c
sys/dev/disk/dm/dm_table.c
sys/dev/disk/dm/targets/delay/dm_target_delay.c
sys/dev/disk/dm/targets/linear/dm_target_linear.c
sys/dev/disk/dm/targets/striped/dm_target_striped.c

index 18297a4..57b7a9c 100644 (file)
@@ -213,7 +213,7 @@ dmopen(struct dev_open_args *ap)
        dmv->is_open = 1;
        dm_dev_unbusy(dmv);
 
-       aprint_debug("dm open routine called %" PRIu32 "\n",
+       dmdebug("dm open routine called %" PRIu32 "\n",
            minor(ap->a_head.a_dev));
        return 0;
 }
@@ -234,7 +234,7 @@ dmclose(struct dev_close_args *ap)
        dmv->is_open = 0;
        dm_dev_unbusy(dmv);
 
-       aprint_debug("dm close routine called %" PRIu32 "\n",
+       dmdebug("dm close routine called %" PRIu32 "\n",
            minor(ap->a_head.a_dev));
        return 0;
 }
@@ -253,7 +253,7 @@ dmioctl(struct dev_ioctl_args *ap)
 
        err = r = 0;
 
-       aprint_debug("dmioctl called\n");
+       dmdebug("dmioctl called\n");
        KKASSERT(data != NULL);
 
        if ((r = disk_ioctl_switch(dev, cmd, data)) != ENOTTY)
@@ -300,11 +300,11 @@ dm_cmd_to_fun(prop_dictionary_t dm_dict)
 
        KKASSERT(p);
        if (i == size) {
-               aprint_debug("Unknown ioctl\n");
+               dmdebug("Unknown ioctl\n");
                return EINVAL;
        }
 
-       aprint_debug("ioctl %s called %p\n", p->cmd, p->fn);
+       dmdebug("ioctl %s called %p\n", p->cmd, p->fn);
        if (p->fn == NULL)
                return 0;  /* No handler required */
 
@@ -318,10 +318,10 @@ dm_ioctl_switch(u_long cmd)
 
        switch(cmd) {
        case NETBSD_DM_IOCTL:
-               aprint_debug("dm NETBSD_DM_IOCTL called\n");
+               dmdebug("dm NETBSD_DM_IOCTL called\n");
                break;
        default:
-               aprint_debug("dm unknown ioctl called\n");
+               dmdebug("dm unknown ioctl called\n");
                return ENOTTY;
                break; /* NOT REACHED */
        }
@@ -363,7 +363,7 @@ disk_ioctl_switch(cdev_t dev, u_long cmd, void *data)
                break;
 
        default:
-               aprint_debug("unknown disk_ioctl called\n");
+               dmdebug("unknown disk_ioctl called\n");
                return ENOTTY;
                break; /* NOT REACHED */
        }
index 4c7cbcc..d4e355c 100644 (file)
@@ -293,7 +293,7 @@ void dm_builtin_uninit(void *);
 extern int dm_debug_level;
 MALLOC_DECLARE(M_DM);
 
-#define aprint_debug(format, ...)      \
+#define dmdebug(format, ...)   \
     do { if (dm_debug_level) kprintf(format, ## __VA_ARGS__); } while(0)
 
 #define DM_TARGET_MODULE(name, evh)                            \
index d6ab6f5..abe60d9 100644 (file)
@@ -258,7 +258,7 @@ dm_dev_create(dm_dev_t **dmvp, const char *name, const char *uuid, int flags)
        if (flags & DM_READONLY_FLAG)
                dmv->flags |= DM_READONLY_FLAG;
 
-       aprint_debug("Creating device dm/%s\n", name);
+       dmdebug("Creating device dm/%s\n", name);
        ksnprintf(name_buf, sizeof(name_buf), "mapper/%s", dmv->name);
 
        devstat_add_entry(&dmv->stats, name, 0, DEV_BSIZE,
index f2b7a2c..1feaf84 100644 (file)
@@ -553,7 +553,7 @@ dm_table_clear_ioctl(prop_dictionary_t dm_dict)
        prop_dictionary_get_uint32(dm_dict, DM_IOCTL_FLAGS, &flags);
        prop_dictionary_get_uint32(dm_dict, DM_IOCTL_MINOR, &minor);
 
-       aprint_debug("Clearing inactive table from device: %s--%s\n",
+       dmdebug("Clearing inactive table from device: %s--%s\n",
            name, uuid);
 
        if ((dmv = dm_dev_lookup(name, uuid, minor)) == NULL) {
@@ -610,7 +610,7 @@ dm_table_deps_ioctl(prop_dictionary_t dm_dict)
        prop_dictionary_set_cstring(dm_dict, DM_IOCTL_NAME, dmv->name);
        prop_dictionary_set_cstring(dm_dict, DM_IOCTL_UUID, dmv->uuid);
 
-       aprint_debug("Getting table deps for device: %s\n", dmv->name);
+       dmdebug("Getting table deps for device: %s\n", dmv->name);
 
        /*
         * if DM_QUERY_INACTIVE_TABLE_FLAG is passed we need to query
@@ -714,7 +714,7 @@ dm_table_load_ioctl(prop_dictionary_t dm_dict)
                dm_remove_flag(dm_dict, &flags, DM_EXISTS_FLAG);
                return ENOENT;
        }
-       aprint_debug("Loading table to device: %s--%d\n", name,
+       dmdebug("Loading table to device: %s--%d\n", name,
            dmv->table_head.cur_active_table);
 
        /*
@@ -727,7 +727,7 @@ dm_table_load_ioctl(prop_dictionary_t dm_dict)
        dm_dbg_print_flags(dmv->flags);
        tbl = dm_table_get_entry(&dmv->table_head, DM_TABLE_INACTIVE);
 
-       aprint_debug("dmv->name = %s\n", dmv->name);
+       dmdebug("dmv->name = %s\n", dmv->name);
 
        prop_dictionary_set_uint32(dm_dict, DM_IOCTL_MINOR, dmv->minor);
 
@@ -756,7 +756,7 @@ dm_table_load_ioctl(prop_dictionary_t dm_dict)
                prop_dictionary_get_uint64(target_dict, DM_TABLE_LENGTH,
                    &table_en->length);
 
-               aprint_debug("dm_ioctl.c... table_en->start = %ju, "
+               dmdebug("dm_ioctl.c... table_en->start = %ju, "
                             "table_en->length = %ju\n",
                             (uintmax_t)table_en->start,
                             (uintmax_t)table_en->length);
@@ -783,7 +783,7 @@ dm_table_load_ioctl(prop_dictionary_t dm_dict)
                 * therfore I have to pass it to target init
                 * routine and parse parameters there.
                 */
-               aprint_debug("DM: str passed in is: \"%s\"\n", str);
+               dmdebug("DM: str passed in is: \"%s\"\n", str);
 
                if ((ret = dm_table_init(target, table_en, str)) != 0) {
                        dm_table_release(&dmv->table_head, DM_TABLE_INACTIVE);
@@ -820,7 +820,7 @@ dm_table_init(dm_target_t *target, dm_table_entry_t *table_en, char *params)
 
        n = target->max_argc;
        if (n) {
-               aprint_debug("Max argc %d for %s target\n", n, target->name);
+               dmdebug("Max argc %d for %s target\n", n, target->name);
        } else {
                n = 20;  /* large enough slots for most targets */
        }
@@ -929,14 +929,14 @@ dm_table_status_ioctl(prop_dictionary_t dm_dict)
 
        prop_dictionary_set_uint32(dm_dict, DM_IOCTL_MINOR, dmv->minor);
 
-       aprint_debug("Status of device tables: %s--%d\n",
+       dmdebug("Status of device tables: %s--%d\n",
            name, dmv->table_head.cur_active_table);
 
        tbl = dm_table_get_entry(&dmv->table_head, table_type);
 
        TAILQ_FOREACH(table_en, tbl, next) {
                target_dict = prop_dictionary_create();
-               aprint_debug("%016" PRIu64 ", length %016" PRIu64
+               dmdebug("%016" PRIu64 ", length %016" PRIu64
                    ", target %s\n", table_en->start, table_en->length,
                    table_en->target->name);
 
@@ -1087,7 +1087,7 @@ dm_check_version(prop_dictionary_t dm_dict)
                prop_array_get_uint32(ver, i, &dm_version[i]);
 
        if (DM_VERSION_MAJOR != dm_version[0] || DM_VERSION_MINOR < dm_version[1]) {
-               aprint_debug("libdevmapper/kernel version mismatch "
+               dmdebug("libdevmapper/kernel version mismatch "
                    "kernel: %d.%d.%d libdevmapper: %d.%d.%d\n",
                    DM_VERSION_MAJOR, DM_VERSION_MINOR, DM_VERSION_PATCHLEVEL,
                    dm_version[0], dm_version[1], dm_version[2]);
index 5db9a14..a6af07d 100644 (file)
@@ -133,7 +133,7 @@ dm_pdev_insert(const char *dev_name)
 
        if (dmp != NULL) {
                dmp->ref_cnt++;
-               aprint_debug("dmp_pdev_insert pdev %s already in tree\n", dev_name);
+               dmdebug("dmp_pdev_insert pdev %s already in tree\n", dev_name);
                lockmgr(&dm_pdev_mutex, LK_RELEASE);
                return dmp;
        }
@@ -145,7 +145,7 @@ dm_pdev_insert(const char *dev_name)
 
        error = dm_dk_lookup(dev_name, &dmp->pdev_vnode);
        if (error) {
-               aprint_debug("dk_lookup on device: %s failed with error %d!\n",
+               dmdebug("dk_lookup on device: %s failed with error %d!\n",
                    dev_name, error);
                dm_pdev_rem(dmp);
                lockmgr(&dm_pdev_mutex, LK_RELEASE);
@@ -154,7 +154,7 @@ dm_pdev_insert(const char *dev_name)
        dmp->ref_cnt = 1;
 
        if (dm_pdev_get_vattr(dmp, &va) == -1) {
-               aprint_debug("makeudev %s failed\n", dev_name);
+               dmdebug("makeudev %s failed\n", dev_name);
                dm_pdev_rem(dmp);
                lockmgr(&dm_pdev_mutex, LK_RELEASE);
                return NULL;
@@ -172,7 +172,7 @@ dm_pdev_insert(const char *dev_name)
            (void *)&dmp->pdev_pinfo, 0, proc0.p_ucred, NULL, NULL);
        if (!error) {
                struct partinfo *dpart = &dmp->pdev_pinfo;
-               aprint_debug("dmp_pdev_insert DIOCGPART "
+               dmdebug("dmp_pdev_insert DIOCGPART "
                        "offset=%ju size=%ju blocks=%ju blksize=%d\n",
                        dpart->media_offset,
                        dpart->media_size,
@@ -185,7 +185,7 @@ dm_pdev_insert(const char *dev_name)
        TAILQ_INSERT_TAIL(&dm_pdev_list, dmp, next_pdev);
        lockmgr(&dm_pdev_mutex, LK_RELEASE);
 
-       aprint_debug("dmp_pdev_insert pdev %s %s 0x%016jx\n",
+       dmdebug("dmp_pdev_insert pdev %s %s 0x%016jx\n",
                dmp->name, dmp->udev_name, (uintmax_t)dmp->udev);
 
        return dmp;
index 4235682..77d5b4c 100644 (file)
@@ -131,7 +131,7 @@ dm_table_destroy(dm_table_head_t *head, uint8_t table_id)
 
        lockmgr(&head->table_mtx, LK_EXCLUSIVE);
 
-       aprint_debug("dm_table_destroy called with %d--%d\n", table_id, head->io_cnt);
+       dmdebug("dm_table_destroy called with %d--%d\n", table_id, head->io_cnt);
 
        if (table_id == DM_TABLE_ACTIVE)
                id = head->cur_active_table;
index d697db3..a54ff57 100644 (file)
@@ -91,7 +91,7 @@ dm_target_delay_init(dm_table_entry_t *table_en, int argc, char **argv)
        dm_target_delay_config_t *tdc;
        int ret;
 
-       aprint_debug("Delay target init: argc=%d\n", argc);
+       dmdebug("Delay target init: argc=%d\n", argc);
        if (argc != 3 && argc != 6) {
                kprintf("Delay target takes 3 or 6 args\n");
                return EINVAL;
@@ -382,7 +382,7 @@ static __inline
 void
 _debug(struct dm_delay_info *di, const char *msg)
 {
-       aprint_debug("%-8s: %d pdev=%s offset=%ju delay=%d count=%d\n",
+       dmdebug("%-8s: %d pdev=%s offset=%ju delay=%d count=%d\n",
                msg, di->enabled, di->pdev->name,
                (uintmax_t)di->offset, di->delay, di->count);
 }
index 1fabc0f..fae7e01 100644 (file)
@@ -67,7 +67,7 @@ dm_target_linear_init(dm_table_entry_t *table_en, int argc, char **argv)
                return EINVAL;
        }
 
-       aprint_debug("Linear target init function called %s--%s!!\n",
+       dmdebug("Linear target init function called %s--%s!!\n",
            argv[0], argv[1]);
 
        /* Insert dmp to global pdev list */
@@ -99,7 +99,7 @@ dm_target_linear_table(void *target_config)
        char *params;
        tlc = target_config;
 
-       aprint_debug("Linear target table function called\n");
+       dmdebug("Linear target table function called\n");
 
        params = dm_alloc_string(DM_MAX_PARAMS_SIZE);
 
index 31d475e..047bfa7 100644 (file)
@@ -249,7 +249,7 @@ dm_target_stripe_iodone(struct bio *bio)
                KKASSERT(devnr < MAX_STRIPES);
                tsc->stripe_devs[devnr].num_error++;
 
-               aprint_debug("stripe_iodone: device=%d error=%d\n",
+               dmdebug("stripe_iodone: device=%d error=%d\n",
                        devnr, bp->b_error);
        }