From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755812AbbHFRyn (ORCPT ); Thu, 6 Aug 2015 13:54:43 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:35876 "EHLO mail-qk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753693AbbHFRym (ORCPT ); Thu, 6 Aug 2015 13:54:42 -0400 From: Dan Streetman To: Andrew Morton Cc: Seth Jennings , Linux-MM , linux-kernel , Dan Streetman Subject: [PATCH] zpool: clarification comment for zpool_has_pool Date: Thu, 6 Aug 2015 13:54:33 -0400 Message-Id: <1438883673-7791-1-git-send-email-ddstreet@ieee.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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