mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
When a command is flagged with NO_METADATA_PROCESSING flag, it means such command does not process any metadata and hence it doens't require lvmetad, lvmpolld and it can get away with no locking too. These are mostly simple commands (like lvmconfig/dumpconfig, version, types, segtypes and other builtin commands that do not process metadata in any way). At first, when lvm command is executed, create toolcontext without initializing connections (lvmetad,lvmpolld) and without initializing filters (which depend on connections init). Instead, delay this initialization until we know we need this. That is, until the lvm_run_command fn is called in which we know what the actual command to run is and hence we can avoid any connection, filter or locking initiliazation for commands that would not make use of it anyway. For all the other create_toolcontext calls, we keep the original behaviour - the filters and connections are initialized together with the toolcontext.