]> sourceware.org Git - lvm2.git/commitdiff
Use C locales and use_mlockall for clvmd.
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 13 Apr 2010 19:54:16 +0000 (19:54 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 13 Apr 2010 19:54:16 +0000 (19:54 +0000)
Use same steps for clvmd as for dmeventd - using C locales to avoid reading
large mmaps and use mlockall() for threaded version.

WHATS_NEW
daemons/clvmd/clvmd.c
daemons/clvmd/lvm-functions.c

index d1c7a92ec7cc8f7233a92287a9c0e6cdb7ff521b..b4c4f46f14b967a3b01f0bb99aeb4e7f72dd4bd1 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.63 -  
 ================================
+  Use C locales and use_mlockall for clvmd.
   Refactor code related to vg->pvs list and add pv->vg link.
   Mask LCK_HOLD flag in cluster VG locks for compatibility reasons.
   Add activation/polling_interval to lvm.conf as --interval default.
index d0ea1422d1d5809cc3bc9aa58bff8f5631fc6300..b7ba20098811ec4716e98b94294fc385435bb9df 100644 (file)
@@ -360,6 +360,13 @@ int main(int argc, char *argv[])
                return debug_clvmd(debug, clusterwide_opt)==1?0:1;
        }
 
+       /*
+        * Switch to C locale to avoid reading large locale-archive file
+        * used by some glibc (on some distributions it takes over 100MB).
+        * Daemon currently needs to use mlockall().
+        */
+       setenv("LANG", "C", 1);
+
        /* Fork into the background (unless requested not to) */
        if (debug != DEBUG_STDERR) {
                be_daemon(start_timeout);
index 376605177fa39211b5b1813bad4d4ab0005b28d7..aaafae08a4496c7133be83a70170b9645f4aa86a 100644 (file)
@@ -878,13 +878,16 @@ int init_lvm(int using_gulm)
 
        /* Trap log messages so we can pass them back to the user */
        init_log_fn(lvm2_log_fn);
+       memlock_inc_daemon(cmd);
 
        return 1;
 }
 
 void destroy_lvm(void)
 {
-       if (cmd)
+       if (cmd) {
+               memlock_dec_daemon(cmd);
                destroy_toolcontext(cmd);
+       }
        cmd = NULL;
 }
This page took 0.044796 seconds and 5 git commands to generate.