From: Peng Tao Date: Thu, 6 Jun 2013 14:59:12 +0000 (+0800) Subject: staging/lustre: surround module_refcount with CONFIG_MODULE_UNLOAD X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4a1a01ea52ad3d9bc0ac36f5a9739d6cce0bae75;p=linux-beck.git staging/lustre: surround module_refcount with CONFIG_MODULE_UNLOAD module_refcount() is not available when CONFIG_MODULE_UNLOAD is off. Reported-by: Stephen Rothwell Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 22b247ddd093..fdf0ed367693 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -1351,7 +1351,9 @@ static void key_fini(struct lu_context *ctx, int index) LASSERT(key->lct_owner != NULL); if ((ctx->lc_tags & LCT_NOREF) == 0) { +#ifdef CONFIG_MODULE_UNLOAD LINVRNT(module_refcount(key->lct_owner) > 0); +#endif module_put(key->lct_owner); } ctx->lc_value[index] = NULL;