[PATCH] zpool: clarification comment for zpool_has_pool
From: Dan Streetman
Date: Thu Aug 06 2015 - 13:54:46 EST
Add clarification in the documentation comment for zpool_has_pool() to
explain the caller should assume the requested driver is or is not
available, depending on return value. If true is returned, the caller
should assume zpool_create_pool() will succeed, but still must be
prepared to handle failure.
Signed-off-by: Dan Streetman <ddstreet@xxxxxxxx>
---
mm/zpool.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/mm/zpool.c b/mm/zpool.c
index aafcf8f..d8cf7cd 100644
--- a/mm/zpool.c
+++ b/mm/zpool.c
@@ -103,7 +103,15 @@ static void zpool_put_driver(struct zpool_driver *driver)
* zpool_has_pool() - Check if the pool driver is available
* @type The type of the zpool to check (e.g. zbud, zsmalloc)
*
- * This checks if the @type pool driver is available.
+ * This checks if the @type pool driver is available. This will try to load
+ * the requested module, if needed, but there is no guarantee the module will
+ * still be loaded and available immediately after calling. If this returns
+ * true, the caller should assume the pool is available, but must be prepared
+ * to handle the @zpool_create_pool() returning failure. However if this
+ * returns false, the caller should assume the requested pool type is not
+ * available; either the requested pool type module does not exist, or could
+ * not be loaded, and calling @zpool_create_pool() with the pool type will
+ * fail.
*
* Returns: true if @type pool is available, false if not
*/
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/