summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2013-06-06 18:59:12 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-06 22:31:02 +0400
commit4a1a01ea52ad3d9bc0ac36f5a9739d6cce0bae75 (patch)
tree6367666115665fead41375b08f0ca58d4c599302 /drivers/staging/lustre
parent4b5b4c7222b8eac2279e604e040561c855bbf0ce (diff)
downloadlinux-4a1a01ea52ad3d9bc0ac36f5a9739d6cce0bae75.tar.xz
staging/lustre: surround module_refcount with CONFIG_MODULE_UNLOAD
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>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/lustre/obdclass/lu_object.c2
1 files changed, 2 insertions, 0 deletions
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;