Whamcloud - gitweb
LU-9679 modules: convert MIN/MAX to kernel style
[fs/lustre-release.git] / lustre / osc / osc_request.c
index 7a0a550..cf3136e 100644 (file)
@@ -843,8 +843,10 @@ static int osc_should_shrink_grant(struct client_obd *client)
                return 0;
 
        if (!OCD_HAS_FLAG(&client->cl_import->imp_connect_data, GRANT_SHRINK) ||
-           client->cl_import->imp_grant_shrink_disabled)
+           client->cl_import->imp_grant_shrink_disabled) {
+               osc_update_next_shrink(client);
                return 0;
+       }
 
        if (ktime_get_seconds() >= next_shrink - 5) {
                /* Get the current RPC size directly, instead of going via:
@@ -2212,7 +2214,7 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
                mem_tight |= ext->oe_memalloc;
                grant += ext->oe_grants;
                page_count += ext->oe_nr_pages;
-               layout_version = MAX(layout_version, ext->oe_layout_version);
+               layout_version = max(layout_version, ext->oe_layout_version);
                if (obj == NULL)
                        obj = ext->oe_obj;
        }
@@ -3344,7 +3346,7 @@ int osc_cleanup_common(struct obd_device *obd)
 }
 EXPORT_SYMBOL(osc_cleanup_common);
 
-static struct obd_ops osc_obd_ops = {
+static const struct obd_ops osc_obd_ops = {
         .o_owner                = THIS_MODULE,
         .o_setup                = osc_setup,
         .o_precleanup           = osc_precleanup,
@@ -3377,10 +3379,6 @@ static int osc_cache_shrink(SHRINKER_ARGS(sc, nr_to_scan, gfp_mask))
                .nr_to_scan = shrink_param(sc, nr_to_scan),
                .gfp_mask   = shrink_param(sc, gfp_mask)
        };
-#if !defined(HAVE_SHRINKER_WANT_SHRINK_PTR) && !defined(HAVE_SHRINK_CONTROL)
-       struct shrinker *shrinker = NULL;
-#endif
-
        (void)osc_cache_shrink_scan(shrinker, &scv);
 
        return osc_cache_shrink_count(shrinker, &scv);