aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2018-03-15 16:02:31 -0400
committerMike Snitzer <snitzer@redhat.com>2018-04-03 15:04:23 -0400
commitafa53df869121fd4f6f1265cbe794d64387890ae (patch)
treed262dc8d2ae2eb9a080160464c123930e3f5a97f
parent1f013174b352057557e47321f23a33e39e752bd4 (diff)
dm bufio: move dm-bufio.h to include/linux/
Move dm-bufio.h to include/linux/ so that external GPL'd DM target modules can use it. It is better to allow the use of dm-bufio than force external modules to implement the equivalent buffered IO mechanism in some new way. The hope is this will encourage the use of dm-bufio; which will then make it easier for a GPL'd external DM target module to be included upstream. A couple dm-bufio EXPORT_SYMBOL exports have also been updated to use EXPORT_SYMBOL_GPL. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r--drivers/md/dm-bufio.c8
-rw-r--r--drivers/md/dm-integrity.c2
-rw-r--r--drivers/md/dm-snap-persistent.c2
-rw-r--r--drivers/md/dm-verity.h2
-rw-r--r--drivers/md/persistent-data/dm-block-manager.c2
-rw-r--r--include/linux/dm-bufio.h (renamed from drivers/md/dm-bufio.h)4
6 files changed, 10 insertions, 10 deletions
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index f5360a6260ff..87795a361d09 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -6,7 +6,7 @@
6 * This file is released under the GPL. 6 * This file is released under the GPL.
7 */ 7 */
8 8
9#include "dm-bufio.h" 9#include <linux/dm-bufio.h>
10 10
11#include <linux/device-mapper.h> 11#include <linux/device-mapper.h>
12#include <linux/dm-io.h> 12#include <linux/dm-io.h>
@@ -1478,13 +1478,13 @@ void dm_bufio_forget(struct dm_bufio_client *c, sector_t block)
1478 1478
1479 dm_bufio_unlock(c); 1479 dm_bufio_unlock(c);
1480} 1480}
1481EXPORT_SYMBOL(dm_bufio_forget); 1481EXPORT_SYMBOL_GPL(dm_bufio_forget);
1482 1482
1483void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned n) 1483void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned n)
1484{ 1484{
1485 c->minimum_buffers = n; 1485 c->minimum_buffers = n;
1486} 1486}
1487EXPORT_SYMBOL(dm_bufio_set_minimum_buffers); 1487EXPORT_SYMBOL_GPL(dm_bufio_set_minimum_buffers);
1488 1488
1489unsigned dm_bufio_get_block_size(struct dm_bufio_client *c) 1489unsigned dm_bufio_get_block_size(struct dm_bufio_client *c)
1490{ 1490{
@@ -1690,7 +1690,7 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
1690 INIT_LIST_HEAD(&c->reserved_buffers); 1690 INIT_LIST_HEAD(&c->reserved_buffers);
1691 c->need_reserved_buffers = reserved_buffers; 1691 c->need_reserved_buffers = reserved_buffers;
1692 1692
1693 c->minimum_buffers = DM_BUFIO_MIN_BUFFERS; 1693 dm_bufio_set_minimum_buffers(c, DM_BUFIO_MIN_BUFFERS);
1694 1694
1695 init_waitqueue_head(&c->free_buffer_wait); 1695 init_waitqueue_head(&c->free_buffer_wait);
1696 c->async_write_error = 0; 1696 c->async_write_error = 0;
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index 6c81b11d0521..77d9fe58dae2 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -18,7 +18,7 @@
18#include <crypto/hash.h> 18#include <crypto/hash.h>
19#include <crypto/skcipher.h> 19#include <crypto/skcipher.h>
20#include <linux/async_tx.h> 20#include <linux/async_tx.h>
21#include "dm-bufio.h" 21#include <linux/dm-bufio.h>
22 22
23#define DM_MSG_PREFIX "integrity" 23#define DM_MSG_PREFIX "integrity"
24 24
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index c5534d294773..3c50c4e4da8f 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -14,7 +14,7 @@
14#include <linux/export.h> 14#include <linux/export.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/dm-io.h> 16#include <linux/dm-io.h>
17#include "dm-bufio.h" 17#include <linux/dm-bufio.h>
18 18
19#define DM_MSG_PREFIX "persistent snapshot" 19#define DM_MSG_PREFIX "persistent snapshot"
20#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */ 20#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */
diff --git a/drivers/md/dm-verity.h b/drivers/md/dm-verity.h
index b675bc015512..69f9a298f8c9 100644
--- a/drivers/md/dm-verity.h
+++ b/drivers/md/dm-verity.h
@@ -12,7 +12,7 @@
12#ifndef DM_VERITY_H 12#ifndef DM_VERITY_H
13#define DM_VERITY_H 13#define DM_VERITY_H
14 14
15#include "dm-bufio.h" 15#include <linux/dm-bufio.h>
16#include <linux/device-mapper.h> 16#include <linux/device-mapper.h>
17#include <crypto/hash.h> 17#include <crypto/hash.h>
18 18
diff --git a/drivers/md/persistent-data/dm-block-manager.c b/drivers/md/persistent-data/dm-block-manager.c
index ea15d220ced7..492a3f8ac119 100644
--- a/drivers/md/persistent-data/dm-block-manager.c
+++ b/drivers/md/persistent-data/dm-block-manager.c
@@ -5,8 +5,8 @@
5 */ 5 */
6#include "dm-block-manager.h" 6#include "dm-block-manager.h"
7#include "dm-persistent-data-internal.h" 7#include "dm-persistent-data-internal.h"
8#include "../dm-bufio.h"
9 8
9#include <linux/dm-bufio.h>
10#include <linux/crc32c.h> 10#include <linux/crc32c.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/slab.h> 12#include <linux/slab.h>
diff --git a/drivers/md/dm-bufio.h b/include/linux/dm-bufio.h
index be732d3f8611..3c8b7d274bd9 100644
--- a/drivers/md/dm-bufio.h
+++ b/include/linux/dm-bufio.h
@@ -6,8 +6,8 @@
6 * This file is released under the GPL. 6 * This file is released under the GPL.
7 */ 7 */
8 8
9#ifndef DM_BUFIO_H 9#ifndef _LINUX_DM_BUFIO_H
10#define DM_BUFIO_H 10#define _LINUX_DM_BUFIO_H
11 11
12#include <linux/blkdev.h> 12#include <linux/blkdev.h>
13#include <linux/types.h> 13#include <linux/types.h>