staging/lustre: surround module_refcount with CONFIG_MODULE_UNLOAD
authorPeng Tao <bergwolf@gmail.com>
Thu, 6 Jun 2013 14:59:12 +0000 (22:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Jun 2013 18:31:02 +0000 (11:31 -0700)
module_refcount() is not available when CONFIG_MODULE_UNLOAD is off.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/lu_object.c

index 22b247d..fdf0ed3 100644 (file)
@@ -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;