Whamcloud - gitweb
LU-3974 libcfs: replace num_physpages with totalram_pages
[fs/lustre-release.git] / lustre / ldlm / ldlm_lib.c
index a233c3d..7e4da6f 100644 (file)
@@ -343,8 +343,8 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
         cli->cl_avail_grant = 0;
        /* FIXME: Should limit this for the sum of all cl_dirty_max. */
        cli->cl_dirty_max = OSC_MAX_DIRTY_DEFAULT * 1024 * 1024;
-       if (cli->cl_dirty_max >> PAGE_CACHE_SHIFT > num_physpages / 8)
-               cli->cl_dirty_max = num_physpages << (PAGE_CACHE_SHIFT - 3);
+       if (cli->cl_dirty_max >> PAGE_CACHE_SHIFT > totalram_pages / 8)
+               cli->cl_dirty_max = totalram_pages << (PAGE_CACHE_SHIFT - 3);
         CFS_INIT_LIST_HEAD(&cli->cl_cache_waiters);
         CFS_INIT_LIST_HEAD(&cli->cl_loi_ready_list);
         CFS_INIT_LIST_HEAD(&cli->cl_loi_hp_ready_list);
@@ -394,11 +394,11 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
 
        if (!strcmp(name, LUSTRE_MDC_NAME)) {
                cli->cl_max_rpcs_in_flight = MDC_MAX_RIF_DEFAULT;
-       } else if (num_physpages >> (20 - PAGE_CACHE_SHIFT) <= 128 /* MB */) {
+       } else if (totalram_pages >> (20 - PAGE_CACHE_SHIFT) <= 128 /* MB */) {
                cli->cl_max_rpcs_in_flight = 2;
-       } else if (num_physpages >> (20 - PAGE_CACHE_SHIFT) <= 256 /* MB */) {
+       } else if (totalram_pages >> (20 - PAGE_CACHE_SHIFT) <= 256 /* MB */) {
                cli->cl_max_rpcs_in_flight = 3;
-       } else if (num_physpages >> (20 - PAGE_CACHE_SHIFT) <= 512 /* MB */) {
+       } else if (totalram_pages >> (20 - PAGE_CACHE_SHIFT) <= 512 /* MB */) {
                cli->cl_max_rpcs_in_flight = 4;
        } else {
                if (osc_on_mdt(obddev->obd_name))