X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Flu_object.c;h=3993c1871babc7c5b9155db91b35d807437139f8;hp=dda8de33f5258778d8c825ef7fda9a851b8a37f2;hb=8ca651d636c37339cc50bffa4532b7cbd0ead570;hpb=be4aab676e899aa9dec80445fb7edb202b4d4748 diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index dda8de3..3993c18 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1476,6 +1476,7 @@ static int keys_fill(struct lu_context *ctx) { int i; + LINVRNT(ctx->lc_value != NULL); for (i = 0; i < ARRAY_SIZE(lu_keys); ++i) { struct lu_context_key *key; @@ -1599,12 +1600,12 @@ EXPORT_SYMBOL(lu_context_exit); /** * Allocate for context all missing keys that were registered after context - * creation. + * creation. key_set_version is only changed in rare cases when modules + * are loaded and removed. */ int lu_context_refill(struct lu_context *ctx) { - LINVRNT(ctx->lc_value != NULL); - return ctx->lc_version == key_set_version ? 0 : keys_fill(ctx); + return likely(ctx->lc_version == key_set_version) ? 0 : keys_fill(ctx); } EXPORT_SYMBOL(lu_context_refill);