projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mmc: dw_mmc: fix unmap sg twice when finding data err
[firefly-linux-kernel-4.4.55.git]
/
mm
/
zpool.c
diff --git
a/mm/zpool.c
b/mm/zpool.c
index 8f670d3e87060f6277f5651a79cfaa8d27a30713..fd3ff719c32cb9cf25dafca9d73f789d8071bad5 100644
(file)
--- a/
mm/zpool.c
+++ b/
mm/zpool.c
@@
-18,8
+18,6
@@
#include <linux/zpool.h>
struct zpool {
#include <linux/zpool.h>
struct zpool {
- char *type;
-
struct zpool_driver *driver;
void *pool;
const struct zpool_ops *ops;
struct zpool_driver *driver;
void *pool;
const struct zpool_ops *ops;
@@
-73,7
+71,8
@@
int zpool_unregister_driver(struct zpool_driver *driver)
}
EXPORT_SYMBOL(zpool_unregister_driver);
}
EXPORT_SYMBOL(zpool_unregister_driver);
-static struct zpool_driver *zpool_get_driver(char *type)
+/* this assumes @type is null-terminated. */
+static struct zpool_driver *zpool_get_driver(const char *type)
{
struct zpool_driver *driver;
{
struct zpool_driver *driver;
@@
-113,6
+112,8
@@
static void zpool_put_driver(struct zpool_driver *driver)
* not be loaded, and calling @zpool_create_pool() with the pool type will
* fail.
*
* not be loaded, and calling @zpool_create_pool() with the pool type will
* fail.
*
+ * The @type string must be null-terminated.
+ *
* Returns: true if @type pool is available, false if not
*/
bool zpool_has_pool(char *type)
* Returns: true if @type pool is available, false if not
*/
bool zpool_has_pool(char *type)
@@
-145,9
+146,11
@@
EXPORT_SYMBOL(zpool_has_pool);
*
* Implementations must guarantee this to be thread-safe.
*
*
* Implementations must guarantee this to be thread-safe.
*
+ * The @type and @name strings must be null-terminated.
+ *
* Returns: New zpool on success, NULL on failure.
*/
* Returns: New zpool on success, NULL on failure.
*/
-struct zpool *zpool_create_pool(c
har *type,
char *name, gfp_t gfp,
+struct zpool *zpool_create_pool(c
onst char *type, const
char *name, gfp_t gfp,
const struct zpool_ops *ops)
{
struct zpool_driver *driver;
const struct zpool_ops *ops)
{
struct zpool_driver *driver;
@@
-174,7
+177,6
@@
struct zpool *zpool_create_pool(char *type, char *name, gfp_t gfp,
return NULL;
}
return NULL;
}
- zpool->type = driver->type;
zpool->driver = driver;
zpool->pool = driver->create(name, gfp, ops, zpool);
zpool->ops = ops;
zpool->driver = driver;
zpool->pool = driver->create(name, gfp, ops, zpool);
zpool->ops = ops;
@@
-208,7
+210,7
@@
struct zpool *zpool_create_pool(char *type, char *name, gfp_t gfp,
*/
void zpool_destroy_pool(struct zpool *zpool)
{
*/
void zpool_destroy_pool(struct zpool *zpool)
{
- pr_debug("destroying pool type %s\n", zpool->type);
+ pr_debug("destroying pool type %s\n", zpool->
driver->
type);
spin_lock(&pools_lock);
list_del(&zpool->list);
spin_lock(&pools_lock);
list_del(&zpool->list);
@@
-228,9
+230,9
@@
void zpool_destroy_pool(struct zpool *zpool)
*
* Returns: The type of zpool.
*/
*
* Returns: The type of zpool.
*/
-char *zpool_get_type(struct zpool *zpool)
+c
onst c
har *zpool_get_type(struct zpool *zpool)
{
{
- return zpool->type;
+ return zpool->
driver->
type;
}
/**
}
/**