Skip to content

Commit

Permalink
dm bufio: move dm-bufio.h to include/linux/
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
  • Loading branch information
Mikulas Patocka authored and snitm committed Apr 3, 2018
1 parent 1f01317 commit afa53df
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions drivers/md/dm-bufio.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* This file is released under the GPL.
*/

#include "dm-bufio.h"
#include <linux/dm-bufio.h>

#include <linux/device-mapper.h>
#include <linux/dm-io.h>
Expand Down Expand Up @@ -1478,13 +1478,13 @@ void dm_bufio_forget(struct dm_bufio_client *c, sector_t block)

dm_bufio_unlock(c);
}
EXPORT_SYMBOL(dm_bufio_forget);
EXPORT_SYMBOL_GPL(dm_bufio_forget);

void dm_bufio_set_minimum_buffers(struct dm_bufio_client *c, unsigned n)
{
c->minimum_buffers = n;
}
EXPORT_SYMBOL(dm_bufio_set_minimum_buffers);
EXPORT_SYMBOL_GPL(dm_bufio_set_minimum_buffers);

unsigned dm_bufio_get_block_size(struct dm_bufio_client *c)
{
Expand Down Expand Up @@ -1690,7 +1690,7 @@ struct dm_bufio_client *dm_bufio_client_create(struct block_device *bdev, unsign
INIT_LIST_HEAD(&c->reserved_buffers);
c->need_reserved_buffers = reserved_buffers;

c->minimum_buffers = DM_BUFIO_MIN_BUFFERS;
dm_bufio_set_minimum_buffers(c, DM_BUFIO_MIN_BUFFERS);

init_waitqueue_head(&c->free_buffer_wait);
c->async_write_error = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <crypto/hash.h>
#include <crypto/skcipher.h>
#include <linux/async_tx.h>
#include "dm-bufio.h"
#include <linux/dm-bufio.h>

#define DM_MSG_PREFIX "integrity"

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-snap-persistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/dm-io.h>
#include "dm-bufio.h"
#include <linux/dm-bufio.h>

#define DM_MSG_PREFIX "persistent snapshot"
#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */
Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-verity.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#ifndef DM_VERITY_H
#define DM_VERITY_H

#include "dm-bufio.h"
#include <linux/dm-bufio.h>
#include <linux/device-mapper.h>
#include <crypto/hash.h>

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/persistent-data/dm-block-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
#include "dm-block-manager.h"
#include "dm-persistent-data-internal.h"
#include "../dm-bufio.h"

#include <linux/dm-bufio.h>
#include <linux/crc32c.h>
#include <linux/module.h>
#include <linux/slab.h>
Expand Down
4 changes: 2 additions & 2 deletions drivers/md/dm-bufio.h → include/linux/dm-bufio.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* This file is released under the GPL.
*/

#ifndef DM_BUFIO_H
#define DM_BUFIO_H
#ifndef _LINUX_DM_BUFIO_H
#define _LINUX_DM_BUFIO_H

#include <linux/blkdev.h>
#include <linux/types.h>
Expand Down

0 comments on commit afa53df

Please sign in to comment.