md: support barrier requests on all personalities.
[safe/jmp/linux-2.6] / drivers / md / dm-ioctl.c
index 1c87173..a679429 100644 (file)
@@ -1050,6 +1050,12 @@ static int populate_table(struct dm_table *table,
                next = spec->next;
        }
 
+       r = dm_table_set_type(table);
+       if (r) {
+               DMWARN("unable to set table type");
+               return r;
+       }
+
        return dm_table_complete(table);
 }
 
@@ -1095,6 +1101,13 @@ static int table_load(struct dm_ioctl *param, size_t param_size)
                goto out;
        }
 
+       r = dm_table_alloc_md_mempools(t);
+       if (r) {
+               DMWARN("unable to allocate mempools for this table");
+               dm_table_destroy(t);
+               goto out;
+       }
+
        down_write(&_hash_lock);
        hc = dm_get_mdptr(md);
        if (!hc || hc->md != md) {
@@ -1519,7 +1532,7 @@ static const struct file_operations _ctl_fops = {
 static struct miscdevice _dm_misc = {
        .minor          = MISC_DYNAMIC_MINOR,
        .name           = DM_NAME,
-       .devnode        = "mapper/control",
+       .nodename       = "mapper/control",
        .fops           = &_ctl_fops
 };