Skip to content

Commit

Permalink
staging/lustre: surround module_refcount with CONFIG_MODULE_UNLOAD
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peng Tao authored and Greg Kroah-Hartman committed Jun 6, 2013
1 parent 4b5b4c7 commit 4a1a01e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/lustre/lustre/obdclass/lu_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4a1a01e

Please sign in to comment.