Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0700ce7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull device mapper updates from Mike Snitzer:
 "Smaller set of DM changes for this merge.  I've based these changes on
  Jens' for-4.4/reservations branch because the associated DM changes
  required it.

   - Revert a dm-multipath change that caused a regression for
     unprivledged users (e.g. kvm guests) that issued ioctls when a
     multipath device had no available paths.

   - Include Christoph's refactoring of DM's ioctl handling and add
     support for passing through persistent reservations with DM
     multipath.

   - All other changes are very simple cleanups"

* tag 'dm-4.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm switch: simplify conditional in alloc_region_table()
  dm delay: document that offsets are specified in sectors
  dm delay: capitalize the start of an delay_ctr() error message
  dm delay: Use DM_MAPIO macros instead of open-coded equivalents
  dm linear: remove redundant target name from error messages
  dm persistent data: eliminate unnecessary return values
  dm: eliminate unused "bioset" process for each bio-based DM device
  dm: convert ffs to __ffs
  dm: drop NULL test before kmem_cache_destroy() and mempool_destroy()
  dm: add support for passing through persistent reservations
  dm: refactor ioctl handling
  Revert "dm mpath: fix stalls when handling invalid ioctls"
  dm: initialize non-blk-mq queue data before queue is used
parents ac322de6 aad9ae45
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -8,6 +8,7 @@ Parameters:
    <device> <offset> <delay> [<write_device> <write_offset> <write_delay>]
    <device> <offset> <delay> [<write_device> <write_offset> <write_delay>]


With separate write parameters, the first set is only used for reads.
With separate write parameters, the first set is only used for reads.
Offsets are specified in sectors.
Delays are specified in milliseconds.
Delays are specified in milliseconds.


Example scripts
Example scripts
+7 −11
Original line number Original line Diff line number Diff line
@@ -1598,11 +1598,11 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign


	c->bdev = bdev;
	c->bdev = bdev;
	c->block_size = block_size;
	c->block_size = block_size;
	c->sectors_per_block_bits = ffs(block_size) - 1 - SECTOR_SHIFT;
	c->sectors_per_block_bits = __ffs(block_size) - SECTOR_SHIFT;
	c->pages_per_block_bits = (ffs(block_size) - 1 >= PAGE_SHIFT) ?
	c->pages_per_block_bits = (__ffs(block_size) >= PAGE_SHIFT) ?
				  ffs(block_size) - 1 - PAGE_SHIFT : 0;
				  __ffs(block_size) - PAGE_SHIFT : 0;
	c->blocks_per_page_bits = (ffs(block_size) - 1 < PAGE_SHIFT ?
	c->blocks_per_page_bits = (__ffs(block_size) < PAGE_SHIFT ?
				  PAGE_SHIFT - (ffs(block_size) - 1) : 0);
				  PAGE_SHIFT - __ffs(block_size) : 0);


	c->aux_size = aux_size;
	c->aux_size = aux_size;
	c->alloc_callback = alloc_callback;
	c->alloc_callback = alloc_callback;
@@ -1861,12 +1861,8 @@ static void __exit dm_bufio_exit(void)
	cancel_delayed_work_sync(&dm_bufio_work);
	cancel_delayed_work_sync(&dm_bufio_work);
	destroy_workqueue(dm_bufio_wq);
	destroy_workqueue(dm_bufio_wq);


	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++)
		struct kmem_cache *kc = dm_bufio_caches[i];
		kmem_cache_destroy(dm_bufio_caches[i]);

		if (kc)
			kmem_cache_destroy(kc);
	}


	for (i = 0; i < ARRAY_SIZE(dm_bufio_cache_names); i++)
	for (i = 0; i < ARRAY_SIZE(dm_bufio_cache_names); i++)
		kfree(dm_bufio_cache_names[i]);
		kfree(dm_bufio_cache_names[i]);
+6 −2
Original line number Original line Diff line number Diff line
@@ -260,7 +260,9 @@ static int __superblock_all_zeroes(struct dm_block_manager *bm, bool *result)
		}
		}
	}
	}


	return dm_bm_unlock(b);
	dm_bm_unlock(b);

	return 0;
}
}


static void __setup_mapping_info(struct dm_cache_metadata *cmd)
static void __setup_mapping_info(struct dm_cache_metadata *cmd)
@@ -465,7 +467,9 @@ static int __open_metadata(struct dm_cache_metadata *cmd)
	dm_disk_bitset_init(cmd->tm, &cmd->discard_info);
	dm_disk_bitset_init(cmd->tm, &cmd->discard_info);
	sb_flags = le32_to_cpu(disk_super->flags);
	sb_flags = le32_to_cpu(disk_super->flags);
	cmd->clean_when_opened = test_bit(CLEAN_SHUTDOWN, &sb_flags);
	cmd->clean_when_opened = test_bit(CLEAN_SHUTDOWN, &sb_flags);
	return dm_bm_unlock(sblock);
	dm_bm_unlock(sblock);

	return 0;


bad:
bad:
	dm_bm_unlock(sblock);
	dm_bm_unlock(sblock);
+1 −1
Original line number Original line Diff line number Diff line
@@ -83,7 +83,7 @@ static struct list_head *list_pop(struct list_head *q)
static int alloc_hash(struct hash *hash, unsigned elts)
static int alloc_hash(struct hash *hash, unsigned elts)
{
{
	hash->nr_buckets = next_power(elts >> 4, 16);
	hash->nr_buckets = next_power(elts >> 4, 16);
	hash->hash_bits = ffs(hash->nr_buckets) - 1;
	hash->hash_bits = __ffs(hash->nr_buckets);
	hash->table = vzalloc(sizeof(*hash->table) * hash->nr_buckets);
	hash->table = vzalloc(sizeof(*hash->table) * hash->nr_buckets);


	return hash->table ? 0 : -ENOMEM;
	return hash->table ? 0 : -ENOMEM;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1410,7 +1410,7 @@ static struct dm_cache_policy *mq_create(dm_cblock_t cache_size,
	mq->generation_period = max((unsigned) from_cblock(cache_size), 1024U);
	mq->generation_period = max((unsigned) from_cblock(cache_size), 1024U);


	mq->nr_buckets = next_power(from_cblock(cache_size) / 2, 16);
	mq->nr_buckets = next_power(from_cblock(cache_size) / 2, 16);
	mq->hash_bits = ffs(mq->nr_buckets) - 1;
	mq->hash_bits = __ffs(mq->nr_buckets);
	mq->table = vzalloc(sizeof(*mq->table) * mq->nr_buckets);
	mq->table = vzalloc(sizeof(*mq->table) * mq->nr_buckets);
	if (!mq->table)
	if (!mq->table)
		goto bad_alloc_table;
		goto bad_alloc_table;
Loading