lizardfs-v.3.9.4/000077500000000000000000000000001263177242700136245ustar00rootroot00000000000000lizardfs-v.3.9.4/.gitignore000066400000000000000000000014541263177242700156200ustar00rootroot00000000000000*~ .DS_Store # External libraries # ###################### /external/gtest-1.7.0 # Vim files # ############# .clang_complete tags *.taghl compile_commands.json .ycm_extra_conf.py # Commonly used build directory # ################################# /build* # Eclipse project files # ######################### /.project /.cproject /.settings # KDevelop4 project file # ########################## *.kdev4 # QtCreator user profiles # ########################### *.user # Debian builds # ################# /Makefile /debian/files /debian/*.debhelper /debian/*.substvars /debian/*.debhelper.log /debian/lizardfs-adm/ /debian/lizardfs-cgi/ /debian/lizardfs-cgiserv/ /debian/lizardfs-chunkserver/ /debian/lizardfs-client/ /debian/lizardfs-common/ /debian/lizardfs-master/ /debian/lizardfs-metalogger/ /debian/tmp/ lizardfs-v.3.9.4/CMakeLists.txt000066400000000000000000000253051263177242700163710ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8) set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_MODULE_PATH}) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "In-source builds are disabled for this project. This is for your " "safety. To build the project, please create a build tree in " "a separate directory, for example:\n" " mkdir ${CMAKE_SOURCE_DIR}/build\n" " cd ${CMAKE_SOURCE_DIR}/build\n" " cmake ..\n" "Before doing that you may need to clean up after this try by removing " "CMakeCache.txt file and CMakeFiles/ directory.\n" "If you REALLY need an in-source build, remove this check from " "${CMAKE_CURRENT_LIST_FILE} and try again." ) endif() project(lizardfs) set(PACKAGE_VERSION_MAJOR 3) set(PACKAGE_VERSION_MINOR 9) set(PACKAGE_VERSION_MICRO 4) set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_MICRO}") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) endif() set(CXX_STD c++0x) if(CYGWIN) set(CXX_STD gnu++11) endif() if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64" ) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m64") endif() if(MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=0") endif() string(REPLACE "-DNDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -std=${CXX_STD} -pthread -Wall -Wextra -fwrapv") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -ftree-vectorize -g -fno-omit-frame-pointer") set(CMAKE_CXX_FLAGS_COVERAGE "-O0 -g --coverage") set(CMAKE_CXX_FLAGS_CLANG_ANALYZE "--analyze -Xanalyzer -analyzer-output=text") set(CMAKE_CXX_FLAGS_CLANG_SANITIZE_THREAD "-g -O0 -fsanitize=thread") add_definitions(-D_LARGEFILE_SOURCE) add_definitions(-D_FILE_OFFSET_BITS=64) add_definitions(-DLIZARDFS_HAVE_CONFIG_H) add_definitions(-D__STDC_LIMIT_MACROS) add_definitions(-D__STDC_CONSTANT_MACROS) add_definitions(-D__STDC_FORMAT_MACROS) if(MINGW) add_definitions(-DWINVER=0x0602) add_definitions(-D_WIN32_WINNT=0x0602) add_definitions(-DFD_SETSIZE=1024) set(MINGW_MSVCRT "msvcr110") endif() # XXX(lamvak): what about OS X? set(DEFAULT_USER "mfs" CACHE STRING "Default user to run daemons as") set(DEFAULT_GROUP "mfs" CACHE STRING "Default group to run daemons as") set(LIZARDFS_BLOCKS_IN_CHUNK 1024 CACHE INT "Number of blocks in one chunk") set(LIZARDFS_BLOCK_SIZE 65536 CACHE INT "Number of bytes in one block") option(ENABLE_WERROR "Enable treating compilation warnings as errors" OFF) option(ENABLE_LIGHTMFS "Enable light version of LizardFS" OFF) option(ENABLE_DEBIAN_PATHS "Enable Debian-style install paths" OFF) option(ENABLE_UTILS "Enable building additional binaries used e.g. in tests" OFF) option(ENABLE_TESTS "Enable building unit and functional tests" OFF) option(ENABLE_DOCS "Enable building the documentation" ON) option(ENABLE_EXIT_ON_USR1 "Enable handler for SIGUSR1 which calls exit()" OFF) option(THROW_INSTEAD_OF_ABORT "Throw std::exception instead of calling abort" OFF) option(ENABLE_DEBUG_LOG "Enable prefix based debug logs" OFF) option(ENABLE_VERBOSE_ASCIIDOC "Enable verbose output of asciidoc" OFF) option(ENABLE_TCMALLOC "Enable use of tcmalloc-minimal library" OFF) # end of LizardFS options option(ENABLE_TRACES "Enable traces" OFF) option(ENABLE_CRC "Enable checksums" ON) option(ENABLE_REQUEST_LOG "Enable logging request times" OFF) option(USE_LEGACY_READ_MESSAGES "Enable sending old type of messages by mount" OFF) message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") message(STATUS "DEFAULT_USER: ${DEFAULT_USER}") message(STATUS "DEFAULT_GROUP: ${DEFAULT_GROUP}") message(STATUS "LIZARDFS_BLOCKS_IN_CHUNK: ${LIZARDFS_BLOCKS_IN_CHUNK}") message(STATUS "LIZARDFS_BLOCK_SIZE: ${LIZARDFS_BLOCK_SIZE}") message(STATUS "ENABLE_WERROR: ${ENABLE_WERROR}") message(STATUS "ENABLE_LIGHTMFS: ${ENABLE_LIGHTMFS}") message(STATUS "ENABLE_DEBIAN_PATHS: ${ENABLE_DEBIAN_PATHS}") message(STATUS "ENABLE_UTILS: ${ENABLE_UTILS}") message(STATUS "ENABLE_TESTS: ${ENABLE_TESTS}") message(STATUS "ENABLE_DOCS: ${ENABLE_DOCS}") message(STATUS "ENABLE_EXIT_ON_USR1: ${ENABLE_EXIT_ON_USR1}") message(STATUS "THROW_INSTEAD_OF_ABORT: ${THROW_INSTEAD_OF_ABORT}") message(STATUS "ENABLE_DEBUG_LOG: ${ENABLE_DEBUG_LOG}") message(STATUS "ENABLE_VERBOSE_ASCIIDOC: ${ENABLE_VERBOSE_ASCIIDOC}") message(STATUS "ENABLE_TCMALLOC: ${ENABLE_TCMALLOC}") # end of LizardFS options values message(STATUS "ENABLE_TRACES: ${ENABLE_TRACES}") message(STATUS "ENABLE_CRC: ${ENABLE_CRC}") message(STATUS "ENABLE_REQUEST_LOG: ${ENABLE_REQUEST_LOG}") message(STATUS "USE_LEGACY_READ_MESSAGES: ${USE_LEGACY_READ_MESSAGES}") # All the environment tests (libs, includes, etc.) live here: include(EnvTests.cmake) include(Libraries) include(GNUInstallDirs) check_includes("${INCLUDES}") # Disable -pedantic for old gcc because of unfounded # "no comma at end of enumerator list" warning during crcutil compilation execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION) if(ENABLE_WERROR AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND COMPILER_VERSION VERSION_LESS 4.7) message(STATUS "Flag '-pedantic' disabled for GCC < 4.7") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments") endif() if(CXX_HAS_WNOGNU) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu") endif() if(ENABLE_WERROR) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") endif() if(ENABLE_TESTS AND NOT THROW_INSTEAD_OF_ABORT) message(STATUS "Tests require THROW_INSTEAD_OF_ABORT to be set to YES, changing passed value:") set(THROW_INSTEAD_OF_ABORT YES) message(STATUS "THROW_INSTEAD_OF_ABORT: ${THROW_INSTEAD_OF_ABORT}") endif() if(ENABLE_DEBIAN_PATHS) if (NOT CMAKE_INSTALL_PREFIX STREQUAL "/") message(WARNING "Debian paths enabled, but CMAKE_INSTALL_PREFIX is different than /") endif() set(BIN_SUBDIR "usr/bin") set(SBIN_SUBDIR "usr/sbin") set(LIB_SUBDIR "usr/lib") set(ETC_SUBDIR "etc/mfs") set(RUN_SUBDIR "var/run/mfs") set(DATA_SUBDIR "var/lib/mfs") set(MAN_SUBDIR "usr/share/man") set(CGI_SUBDIR "usr/share/mfscgi") else() set(BIN_SUBDIR "bin") set(SBIN_SUBDIR "sbin") set(LIB_SUBDIR "lib") set(ETC_SUBDIR "etc/mfs") set(RUN_SUBDIR "var/run/mfs") set(DATA_SUBDIR "var/lib/mfs") set(MAN_SUBDIR "share/man") set(CGI_SUBDIR "share/mfscgi") endif() string(REGEX REPLACE "/$" "" INSTALL_PREFIX_NO_SLASH ${CMAKE_INSTALL_PREFIX}) set(BIN_PATH ${INSTALL_PREFIX_NO_SLASH}/${BIN_SUBDIR}) set(SBIN_PATH ${INSTALL_PREFIX_NO_SLASH}/${SBIN_SUBDIR}) set(LIB_PATH ${INSTALL_PREFIX_NO_SLASH}/${LIB_SUBDIR}) set(ETC_PATH ${INSTALL_PREFIX_NO_SLASH}/${ETC_SUBDIR}) set(RUN_PATH ${INSTALL_PREFIX_NO_SLASH}/${RUN_SUBDIR}) set(DATA_PATH ${INSTALL_PREFIX_NO_SLASH}/${DATA_SUBDIR}) set(MAN_PATH ${INSTALL_PREFIX_NO_SLASH}/${MAN_SUBDIR}) set(CGI_PATH ${INSTALL_PREFIX_NO_SLASH}/${CGI_SUBDIR}) if(ENABLE_LIGHTMFS) set(PROTO_BASE 65536) set(LIGHT_MFS 1) else() set(PROTO_BASE 0) set(LIGHT_MFS 0) endif() if(ENABLE_UTILS) set(BUILD_UTILS ON) endif() if(ENABLE_TESTS) set(BUILD_TESTS ON) set(BUILD_UTILS ON) set(LIZARDFS_ENABLE_DEBUG_LOG ON) endif() if(ENABLE_DEBUG_LOG) set(LIZARDFS_ENABLE_DEBUG_LOG ON) endif() if(ENABLE_TRACES) if(NOT Boost_INCLUDE_DIRS) message(FATAL_ERROR "Boost headers are required if traces are enabled") endif() add_definitions(-DENABLE_TRACES) endif() if(ENABLE_REQUEST_LOG) if(NOT Boost_IOSTREAMS_FOUND) message(FATAL_ERROR "Boost iostreams is required if request time logging is enabled") endif() set(ADDITIONAL_LIBS ${Boost_IOSTREAMS_LIBRARY}) add_definitions(-DENABLE_REQUEST_LOG) endif() set(CHARTS_CSV_CHARTID_BASE 90000) if(THROW_INSTEAD_OF_ABORT) add_definitions(-DTHROW_INSTEAD_OF_ABORT) endif() if(USE_LEGACY_READ_MESSAGES) add_definitions(-DUSE_LEGACY_READ_MESSAGES) endif() if(ENABLE_CRC) message(STATUS "CRC checksums enabled") add_definitions(-DENABLE_CRC) else() message(STATUS "CRC checksums disabled") endif() set(CHARTS_CSV_CHARTID_BASE 90000) # Create config.h file configure_file(config.h.in config.h) include_directories(${CMAKE_BINARY_DIR}) # Here we have generated config.h # main.cc shared by some LizardFS applications set(MAIN_SRC ${CMAKE_SOURCE_DIR}/src/main/main.cc) # functions & macros macro(collect_sources VAR_PREFIX) file(GLOB ${VAR_PREFIX}_TESTS *_unittest.cc) file(GLOB ${VAR_PREFIX}_SOURCES *.cc *.h) file(GLOB ${VAR_PREFIX}_MAIN main.cc) if(${VAR_PREFIX}_MAIN OR ${VAR_PREFIX}_TESTS) list(REMOVE_ITEM ${VAR_PREFIX}_SOURCES ${${VAR_PREFIX}_TESTS} ${${VAR_PREFIX}_MAIN}) endif() endmacro(collect_sources) function(add_tests TESTED_LIBRARY) if(NOT BUILD_TESTS OR ARGC EQUAL 1) return() endif() list(REMOVE_AT ARGV 0) set(TEST_LIBRARY_NAME ${TESTED_LIBRARY}_tests) include_directories(${GTEST_INCLUDE_DIRS}) add_library(${TEST_LIBRARY_NAME} ${ARGV}) target_link_libraries(${TEST_LIBRARY_NAME} ${TESTED_LIBRARY}) set(TMP ${TEST_LIBRARIES}) list(APPEND TMP ${TEST_LIBRARY_NAME}) set(TEST_LIBRARIES ${TMP} CACHE INTERNAL "" FORCE) endfunction(add_tests) if(ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) endif() include_directories(src) # Allow paths relative to src, eg. #include common/crc.h link_directories( ${LINK_DIRECTORIES} ${PC_FUSE_LIBRARY_DIRS} ) add_subdirectory(external) add_subdirectory(src/admin) add_subdirectory(src/common) add_subdirectory(src/protocol) add_subdirectory(src/mount) add_subdirectory(src/mount/polonaise) if(NOT MINGW) if(BUILD_DEVTOOLS) add_subdirectory(src/devtools) endif() add_subdirectory(src/chunkserver) add_subdirectory(src/master) add_subdirectory(src/metadump) add_subdirectory(src/metalogger) add_subdirectory(src/metarestore) add_subdirectory(src/tools) if (FUSE_LIBRARY) add_subdirectory(src/mount/fuse) endif() add_subdirectory(src/data) add_subdirectory(src/cgi) if(BUILD_UTILS) add_subdirectory(utils) endif() if(BUILD_TESTS) add_subdirectory(src/unittests) add_subdirectory(tests) endif() if(ENABLE_DOCS) add_subdirectory(doc) endif() endif() lizardfs-v.3.9.4/COPYING000066400000000000000000001043741263177242700146700ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . lizardfs-v.3.9.4/CheckCXXExpression.cmake000066400000000000000000000010721263177242700203060ustar00rootroot00000000000000include(CheckCXXSourceRuns) function(check_cxx_expression _EXPR _HEADER _RESULT) set(_INCLUDE_FILES) foreach (it ${_HEADER}) set(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") endforeach () set(_CHECK_CXX_EXPRESSION_SOURCE_CODE " ${_INCLUDE_FILES} template struct bool_value { }; template<> struct bool_value { typedef int value_type; }; int main() { typename bool_value<(bool)(${_EXPR})>::value_type r = 0; return r; } ") CHECK_CXX_SOURCE_COMPILES("${_CHECK_CXX_EXPRESSION_SOURCE_CODE}" ${_RESULT}) endfunction() lizardfs-v.3.9.4/CheckFunctions.cmake000066400000000000000000000011411263177242700175310ustar00rootroot00000000000000function(check_functions FUNCTIONS REQUIRED) foreach(FUNC ${FUNCTIONS}) string(TOUPPER "LIZARDFS_HAVE_${FUNC}" VAR) CHECK_FUNCTION_EXISTS(${FUNC} ${VAR}) if(${REQUIRED}) if("${${VAR}}" STREQUAL "" OR NOT ${${VAR}} EQUAL 1) message(SEND_ERROR "function ${FUNC} is required") endif() endif() endforeach() endfunction() function(check_template_function_exists HEADER CALL OUTPUT_VARIABLE) if (NOT DEFINED ${OUTPUT_VARIABLE}) check_cxx_source_compiles(" #include <${HEADER}> int main(int, char**) { ${CALL}; return 0; }" ${OUTPUT_VARIABLE}) endif() endfunction() lizardfs-v.3.9.4/CheckIncludes.cmake000066400000000000000000000013231263177242700173310ustar00rootroot00000000000000function(check_includes INCLUDES) set(INCLUDE_MISSING FALSE) foreach(INCLUDE_FILE ${INCLUDES}) check_include_files(${INCLUDE_FILE} ${INCLUDE_FILE}_FOUND) if(NOT ${INCLUDE_FILE}_FOUND) set(INCLUDE_MISSING TRUE) set(MISSING_INCLUDES ${MISSING_INCLUDES} ${INCLUDE_FILE}) else() # Auto '#cmakedefine' variable generation string(REPLACE "/" "_" INCLUDE_FILE_STR ${INCLUDE_FILE}) string(REPLACE "." "_" INCLUDE_FILE_STR ${INCLUDE_FILE_STR}) string(TOUPPER "LIZARDFS_HAVE_${INCLUDE_FILE_STR}" VAR) set(${VAR} TRUE PARENT_SCOPE) endif() endforeach() if(INCLUDE_MISSING) message("Some include files were not found: ${MISSING_INCLUDES}") endif() endfunction() lizardfs-v.3.9.4/CheckMembers.cmake000066400000000000000000000006421263177242700171600ustar00rootroot00000000000000function(check_members STRUCT MEMBERS HEADER) foreach(MEMBER ${MEMBERS}) string(REPLACE " " "_" STRUCT_STR ${STRUCT}) string(TOUPPER "LIZARDFS_HAVE_${STRUCT_STR}_${MEMBER}" VAR) CHECK_STRUCT_HAS_MEMBER(${STRUCT} ${MEMBER} ${HEADER} ${VAR}) if(NOT ${${VAR}} EQUAL 1) set(${VAR} 0) message(WARNING "${STRUCT} has no member ${MEMBER}") endif() endforeach() endfunction(check_members) lizardfs-v.3.9.4/EnvTests.cmake000066400000000000000000000055741263177242700164140ustar00rootroot00000000000000# comparing build config with (old) autotools build, # refer to ced2e72776fd01e71f1c7eece9c4414b1fe23c54 / configure.ac # discarded tests: # keywords tests for inline, volatile and const # functions marked here as required, that don't appear in the code: atexit strchr # checking for fork and vfork, but vfork unused # XXX(lamvak): didn't add check for strerror_r function compatible with # AC_FUNC_STRERROR_R include(CheckCXXCompilerFlag) include(CheckCXXExpression.cmake) include(CheckCXXSourceCompiles) include(CheckFunctionExists) include(CheckFunctions) include(CheckIncludes) include(CheckLibraryExists) include(CheckMembers) include(CheckStructHasMember) include(CheckTypeSize) include(TestBigEndian) set(INCLUDES arpa/inet.h endian.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/mman.h sys/resource.h sys/rusage.h sys/socket.h sys/statvfs.h sys/time.h syslog.h unistd.h stdbool.h Judy.h ) TEST_BIG_ENDIAN(BIG_ENDIAN) if(BIG_ENDIAN) set(WORDS_BIGENDIAN 1) endif() set(TYPES_CHECKED int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t uid_t mode_t off_t pid_t size_t) set(CMAKE_EXTRA_INCLUDE_FILES stdint.h) foreach(TYPE ${TYPES_CHECKED}) string(TOUPPER ${TYPE} TYPE_SIZE_VAR) CHECK_TYPE_SIZE(${TYPE} ${TYPE_SIZE_VAR}) endforeach() set(CMAKE_EXTRA_INCLUDE_FILES) #XXX(lamvak): now handle possible missing types or different type sizes set(ST_MEMBERS_CHECKED st_blocks st_rdev st_birthtime st_blksize st_flags) check_members("struct stat" "${ST_MEMBERS_CHECKED}" "sys/stat.h") check_members("struct tm" "tm_gmtoff" "time.h") check_members("struct rusage" "ru_maxrss" "sys/resource.h") CHECK_FUNCTION_EXISTS(fork LIZARDFS_HAVE_WORKING_FORK) CHECK_FUNCTION_EXISTS(vfork LIZARDFS_HAVE_WORKING_VFORK) CHECK_TEMPLATE_FUNCTION_EXISTS("string" "std::to_string(0)" LIZARDFS_HAVE_STD_TO_STRING) CHECK_TEMPLATE_FUNCTION_EXISTS("string" "std::stoull(\"0\")" LIZARDFS_HAVE_STD_STOULL) set(REQUIRED_FUNCTIONS atexit ftruncate gettimeofday memmove memset mkdir strchr strdup strtol strtoul ftello fseeko) if(NOT MINGW) list(APPEND REQUIRED_FUNCTIONS getpass poll realpath) endif() check_functions("${REQUIRED_FUNCTIONS}" TRUE) set(OPTIONAL_FUNCTIONS strerror perror pread pwrite readv writev getrusage setitimer posix_fadvise splice) check_functions("${OPTIONAL_FUNCTIONS}" false) CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" LIZARDFS_HAVE_CLOCK_GETTIME) set(CMAKE_REQUIRED_INCLUDES "sys/mman.h") set(OPTIONAL_FUNCTIONS2 dup2 mlockall getcwd) check_functions("${OPTIONAL_FUNCTIONS2}" false) set(CMAKE_REQUIRED_FLAGS "-std=c++11") check_cxx_expression(::std::chrono::steady_clock::is_steady chrono LIZARDFS_HAVE_STD_CHRONO_STEADY_CLOCK) check_cxx_expression("sizeof(::std::allocator_traits>::pointer)" memory LIZARDFS_HAVE_STD_ALLOCATOR_TRAITS) unset(CMAKE_REQUIRED_FLAGS) check_cxx_compiler_flag(-mcrc32 CXX_HAS_MCRC32) lizardfs-v.3.9.4/FindFUSE.cmake000066400000000000000000000002701263177242700161700ustar00rootroot00000000000000 find_package(PkgConfig REQUIRED) if(PKG_CONFIG_FOUND) pkg_check_modules(PC_FUSE REQUIRED fuse) message(STATUS "FUSE version ${PC_FUSE_VERSION} found") endif(PKG_CONFIG_FOUND) lizardfs-v.3.9.4/FindPAM.cmake000066400000000000000000000010371263177242700160450ustar00rootroot00000000000000# - Try to find the PAM libraries # # PAM_FOUND - system has pam # PAM_INCLUDE_DIR - the pam include directory # PAM_LIBRARIES - pam libraries find_path(PAM_INCLUDE_DIR NAMES pam_appl.h PATH_SUFFIXES security pam) find_library(PAM_LIBRARY pam) find_library(PAM_MISC_LIBRARY pam_misc) if(PAM_LIBRARY AND PAM_MISC_LIBRARY) set(PAM_LIBRARIES ${PAM_LIBRARY} ${PAM_MISC_LIBRARY}) endif() find_package_handle_standard_args(PAM FOUND_VAR PAM_FOUND REQUIRED_VARS PAM_LIBRARY PAM_MISC_LIBRARY PAM_INCLUDE_DIR) lizardfs-v.3.9.4/FindSocket.cmake000066400000000000000000000031441263177242700166610ustar00rootroot00000000000000# You may redistribute this program and/or modify it under the terms of # the GNU General Public License as published by the Free Software Foundation, # either version 3 of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # This is for finding berkley socket functions # it specifically looks for socket() # brought from: https://raw.github.com/cjdelisle/cjdns/master/cmake/modules/FindSocket.cmake include(CheckFunctionExists) if(NOT SOCKET_FOUND AND NOT NO_SOCKET) check_function_exists(socket LIZARDFS_HAVE_SOCKET) if(LIZARDFS_HAVE_SOCKET) set(SOCKET_FOUND TRUE) set(SOCKET_LIBRARIES "") else() message("socket() not found, searching for library") endif() # mingw32 uses ws2_32 # illumos uses socket if(NOT SOCKET_FOUND) find_library(SOCKET_LIBRARIES NAMES ws2_32 socket PATHS ${SOCKET_PREFIX}/ /lib/ ) if(SOCKET_LIBRARIES) message("Socket library was found at [${SOCKET_LIBRARIES}]") set(SOCKET_FOUND TRUE) set(LIZARDFS_HAVE_SOCKET) elseif(Socket_FIND_REQUIRED) message(FATAL_ERROR "Could not find socket library, try to setup SOCKET_PREFIX accordingly") else() message("Could not find socket library, skipping because Socket_FIND_REQUIRED is not set") endif() endif() endif() lizardfs-v.3.9.4/FindThrift.cmake000066400000000000000000000034471263177242700166770ustar00rootroot00000000000000# Finds Thrift # Input: # THRIFT_ROOT -- Thrift installation prefix (optional) # Output: # THRIFT_FOUND # THRIFT_INCLUDE_DIRS # THRIFT_LIBRARIES # THRIFT_COMPILER # Dependencies: if (NOT Boost_INCLUDE_DIRS) if(Thrift_FIND_REQUIRED) message(FATAL_ERROR "Thrift requires Boost headers") elseif(NOT Thrift_FIND_QUIETLY) message(STATUS "Thrift requires Boost headers") endif() return() endif() # Find all possible components, ie. library and compiler find_path(THRIFT_INCLUDE_DIR thrift/Thrift.h HINTS $ENV{THRIFT_ROOT}/include ${THRIFT_ROOT}/include /opt/thrift-0.9.1/include /opt/thrift-0.9.0/include) mark_as_advanced(THRIFT_INCLUDE_DIR) find_library(THRIFT_LIBRARY thrift HINTS ${THRIFT_INCLUDE_DIR}/../lib) mark_as_advanced(THRIFT_LIBRARY) find_program(THRIFT_COMPILER thrift HINTS ${THRIFT_INCLUDE_DIR}/../bin $ENV{THRIFT_ROOT}/bin ${THRIFT_ROOT}/bin /opt/thrift-0.9.1/bin /opt/thrift-0.9.0/bin) mark_as_advanced(THRIFT_COMPILER) # Call find_package_handle_standard_args for components required in find_package(Thrift) set(REQUIRED_ITEMS "") foreach(COMPONENT ${Thrift_FIND_COMPONENTS}) if (COMPONENT STREQUAL "library") set(REQUIRED_ITEMS ${REQUIRED_ITEMS} "THRIFT_INCLUDE_DIR" "THRIFT_LIBRARY") elseif(COMPONENT STREQUAL "compiler") set(REQUIRED_ITEMS ${REQUIRED_ITEMS} "THRIFT_COMPILER") else() message(FATAL_ERROR "Requested an unknown Thrift component '${COMPONENT}'") endif() endforeach() if (REQUIRED_ITEMS STREQUAL "") set(REQUIRED_ITEMS "THRIFT_INCLUDE_DIR" "THRIFT_LIBRARY") endif() include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Thrift DEFAULT_MSG ${REQUIRED_ITEMS}) if (THRIFT_INCLUDE_DIR) set(THRIFT_INCLUDE_DIRS ${THRIFT_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) endif() if (THRIFT_LIBRARY) set(THRIFT_LIBRARIES ${THRIFT_LIBRARY}) endif() lizardfs-v.3.9.4/INSTALL000066400000000000000000000014461263177242700146620ustar00rootroot00000000000000Installing LizardFS from source. Current LizardFS source code can be obtained at: http://lizardfs.com/download/ LizardFS uses cmake as its build system. To compile the sources, follow the directions outlined below. 1. Create a build directory inside the source directory. cd lizardfs-source mkdir build 2. Run 'cmake ..' inside the build directory. Useful options include '-DCMAKE_INSTALL_PREFIX', '-DCMAKE_BUILD_TYPE' as well as various LizardFS-specific '-DENABLE_...' options. Options are listed when cmake is ran and can be changed by re-running cmake. cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/lizardfs 3. Run make in the build directory. make 4. Run make install to install files (you may need to be root). make install lizardfs-v.3.9.4/Libraries.cmake000066400000000000000000000113731263177242700165470ustar00rootroot00000000000000# Download GoogleTest if(ENABLE_TESTS) set(GTEST_VERSION 1.7.0) set(GTEST_NAME gtest-${GTEST_VERSION}) if(NOT IS_DIRECTORY ${CMAKE_SOURCE_DIR}/external/${GTEST_NAME}) set(GTEST_ARCHIVE ${GTEST_NAME}.zip) set(GTEST_URL http://googletest.googlecode.com/files/${GTEST_ARCHIVE}) set(GTEST_ARCHIVE_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7) message(STATUS "Downloading ${GTEST_URL}...") file(DOWNLOAD ${GTEST_URL} ${CMAKE_BINARY_DIR}/${GTEST_ARCHIVE} INACTIVITY_TIMEOUT 15 SHOW_PROGRESS STATUS DOWNLOAD_STATUS EXPECTED_MD5 ${GTEST_ARCHIVE_MD5}) list(GET DOWNLOAD_STATUS 0 DOWNLOAD_CODE) if(NOT DOWNLOAD_CODE EQUAL 0) list(GET DOWNLOAD_STATUS 1 DOWNLOAD_MESSAGE) message(FATAL_ERROR "Download ${GTEST_URL} error ${DOWNLOAD_CODE}: ${DOWNLOAD_MESSAGE}") endif() message(STATUS "Unpacking ${GTEST_ARCHIVE}...") execute_process(COMMAND unzip -q ${CMAKE_BINARY_DIR}/${GTEST_ARCHIVE} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/external RESULT_VARIABLE UNZIP_ERROR ERROR_VARIABLE UNZIP_ERROR_MESSAGE) if(NOT UNZIP_ERROR STREQUAL 0) message(FATAL_ERROR "unzip ${GTEST_ARCHIVE} failed: ${UNZIP_ERROR} ${UNZIP_ERROR_MESSAGE}") endif() if(NOT IS_DIRECTORY ${CMAKE_SOURCE_DIR}/external/${GTEST_NAME}) message(FATAL_ERROR "Extracting ${GTEST_ARCHIVE} didn't produce directory '${GTEST_NAME}'") endif() message(STATUS "Downloading ${GTEST_NAME} finished successfully") else() message(STATUS "Found ${GTEST_NAME}") endif() endif() # Find standard libraries find_package(Socket REQUIRED) find_package(Threads REQUIRED) if(APPLE) find_package(FUSE REQUIRED) find_path(FUSE_INCLUDE_DIRS "fuse/fuse.h" PATHS ${PC_FUSE_INCLUDE_DIRS} ${PC_FUSE_INCLUDE_DIRS}/..) set(FUSE_LIBRARY ${PC_FUSE_LIBRARIES}) else() find_library(FUSE_LIBRARY fuse) endif() message(STATUS "FUSE_LIBRARY: ${FUSE_LIBRARY}") find_library(RT_LIBRARY rt) message(STATUS "RT_LIBRARY: ${RT_LIBRARY}") if(ENABLE_TCMALLOC) find_library(TCMALLOC_LIBRARY NAMES tcmalloc_minimal) message(STATUS "TCMALLOC_LIBRARY: ${TCMALLOC_LIBRARY}") endif() # Find extra binaries find_program(A2X_BINARY a2x) message(STATUS "a2x: ${A2X_BINARY}") # Find Zlib find_package(ZLIB) if(ZLIB_FOUND) message(STATUS "Found Zlib ${ZLIB_VERSION_STRING}") set(LIZARDFS_HAVE_ZLIB_H 1) else() message(STATUS "Could not find Zlib") message(STATUS " This dependency is optional.") message(STATUS " If it's installed in a non-standard path, set ZLIB_ROOT variable") message(STATUS " to point this path (cmake -DZLIB_ROOT=...)") endif() # Find Boost set(BOOST_MIN_VERSION "1.48.0") find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS filesystem iostreams program_options system) # Find Thrift find_package(Thrift COMPONENTS library) if(THRIFT_FOUND) message(STATUS "Found Thrift") else() message(STATUS "Could NOT find Thrift (but it's not required)") message(STATUS " If it's installed in a non-standard path, set THRIFT_ROOT variable") message(STATUS " to point this path (cmake -DTHRIFT_ROOT=...)") endif() # Find Polonaise set(POLONAISE_REQUIRED_VERSION 0.3.1) find_package(Polonaise ${POLONAISE_REQUIRED_VERSION} EXACT QUIET NO_MODULE NO_CMAKE_BUILDS_PATH) if(POLONAISE_FOUND) message(STATUS "Found Polonaise") else() message(STATUS "Could NOT find Polonaise v${POLONAISE_REQUIRED_VERSION} (but it's not required)") if(Polonaise_CONSIDERED_VERSIONS) message(STATUS " Incompatible versions ${Polonaise_CONSIDERED_VERSIONS} " "found in ${Polonaise_CONSIDERED_CONFIGS}") endif() message(STATUS " If it's installed in a non-standard path, set Polonaise_DIR variable") message(STATUS " to point this path (cmake -DPolonaise_DIR=...)") endif() # Find crcutil if(NOT BIG_ENDIAN) INCLUDE(FindPkgConfig) pkg_check_modules(CRCUTIL libcrcutil) if(CRCUTIL_FOUND) message(STATUS "Found libcrcutil") set(HAVE_CRCUTIL 1) else() message(STATUS "Could NOT find system libcrcutil (but it's not required)") set(CRCUTIL_VERSION crcutil-1.0) message(STATUS "Using bundled ${CRCUTIL_VERSION}") set(HAVE_CRCUTIL 1) set(CRCUTIL_LIBRARIES "crcutil") set(CRCUTIL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/external/${CRCUTIL_VERSION}/code) set(CRCUTIL_SOURCE_DIR ${CMAKE_SOURCE_DIR}/external/${CRCUTIL_VERSION}/code) if(CXX_HAS_MCRC32) set(CRCUTIL_CXX_FLAGS "-mcrc32") else() set(CRCUTIL_CXX_FLAGS "") endif() endif() endif() # Find GoogleTest if(ENABLE_TESTS) set(GTEST_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/external/${GTEST_NAME}/include) set(TEST_LIBRARIES "" CACHE INTERNAL "" FORCE) endif() # Find Judy find_library(JUDY_LIBRARY Judy) message(STATUS "JUDY_LIBRARY: ${JUDY_LIBRARY}") # Find PAM libraries find_package(PAM) if(PAM_FOUND) set(LIZARDFS_HAVE_PAM YES) endif() lizardfs-v.3.9.4/NEWS000066400000000000000000000500321263177242700143230ustar00rootroot00000000000000This file lists noteworthy changes in LizardFS. * Lizardfs (3.9.4) (2015-12-02) - (master) Removed master server overload on restarting chunkservers - (master) Improved global file locks engine - (chunkserver) Fixed leaking descriptors problem - (chunkserver) Improved mechanism of moving chunks to new directory layout - (chunkserver) Fixed issues related to scanning directories with new chunk format present - (mount) Removed hang in mount when chunkserver reported no valid copies of a file - (master) Changed handling of legacy (pre-3.9.2) chunkservers in new installations - (cgi) Added XOR replication to statistics - (all) Removed default linking to tcmalloc library due to performance drop * Lizardfs (3.9.2) (2015-10-23) - (all) Introduced XOR goal types - (all) Added file locks (flock & fcntl) - (all) Increased max number of files from 500 million to over 4 billion - (all) Introduced managing open file limits by PAM - (master) Improved consistency of applying changelogs by shadow masters - (master) Redesigned snapshot execution in master - (master) Redesigned chunk loop logic - (master) Removed hard coded connection limit - (master) Added option to limit chunk loop's CPU usage - (chunkserver) Added new network threads responsible for handling requests sent by chunkserver's clients - (chunkserver) Introduced new more efficient directory layout - (chunkserver) Added option to choose if fsync should be performed after each write for increased safety - (chunkserver) Removed hard coded connection limit - (chunkserver) Added replication network bandwidth limiting - (mount) Improved symlink cache and added configurable timeout value - (all) Minor bug fixes and improvements * Lizardfs (2.6.0) (2015-02-09) - (all) Added comments in all config files - (all) Improve messages printed by daemons when starting - (cgi) A new chunkserver's chart: number of chunk tests - (cgi) Fixed paths to static content - (cgi) New implementation of the CGI server; mfscgiserv is now deprecated. - (cgi) New table: 'Metadata Servers' in the 'Servers' tab - (chunkserver) Allowed starts with damaged disks - (chunkserver) A new option: HDD_ADVISE_NO_CACHE - (chunkserver) Improved handling of disk read errors - (chunkserver) Removed 'testing chunk: xxxxxx' log messages - (master) A new feature: disabling atime updates (globally) - (master) Added possibility to set priority on handling endangered chunks - (master) Fixed rotating changelogs and downloading files in shadow mode - (master) Fixed handling replication delay on chunkserver disconnection - (probe) New commands - (probe) Renamed to lizardfs-admin - (all) Minor bug fixes and improvements * Lizardfs (2.5.4) (2014-11-07) - (all) Boost is no longer required to build the source code of LizardFS or use the binary version - (all) Added tiering (aka 'custom goal') feature, which allows users to label chunkservers and to request chunks to be stored on specific groups of servers - (cgi) "Exports" tabs renamed to "Config", now it also shows goal definitions - (cgi) Added new tab "Chunks" - (probe) New command "chunks-health" makes it possible to get number of missing or endangered chunks - (master) Fixed reporting memory usage in CGI - (mount) Fixed caching contents of open directories - (mount) Add a .lizardfs_tweaks file - (all) Other minor fixes and improvements * Lizardfs (2.5.2) (2014-09-15) - (master, shadow) Metadata checksum mechanism, allowing to find and fix possible metadata inconsistencies between master and shadow - (mount, master) ACL cache in mount, reducing the load of the master server - (packaging) Support packaging for RedHat based systems - (master) Improved chunkserver deregistration mechanism in order to avoid temporary master unresponsiveness - (polonaise) Add filesystem API for developers allowing to use the filesystem without FUSE (and thus working also on Windows) - (all) Minor fixes and improvements * LizardFS 2.5.0 (2014-07-15) - (master) High availability provided by shadow master servers - (mount, chunkserver) CRC algorithm replaced with a 3 times faster implementation - (mount, master) Support for quotas (for users and groups) - (mount, master) Support for posix access contol lists (requires additional OS support) - (mount, master) Support for global I/O limiting (bandwidth limiting) - (mount) Support for per-mountpoint I/O limiting (bandwidth limiting) - (adm) New package lizardfs-adm with a lizardfs-probe command-line tool which can be used to query the installation for variuos parameteres - (master) New mechanism of storing metadata backup files which improves performance of the hourly metadata dumps - (all) A comprehensive test suite added - (all) Multiple bugfixes * LizardFS 1.6.28 (2013-10-16) - (all) compile with g++ by default - (deb) fix init scripts for debian packages - (all) fix build on Mac OS X - (cgi) introducing LizardFS logo * MooseFS 1.6.27 (2012-08-09) - (mfsrestore) fixed bug - freeing filenames memory too early - (all) added initial support for extra attributes (xattr), which will be introduced in upcoming version 1.7 - (master+metalogger) better change log synchronization (storage in master memory and sending expected version in metalogger - inspired by Davies Liu) - (master) acceptable difference of percent of hdd usage added to configuration (up to this version this parameter was constantly set to 0.01% - patch contributed by Davies Liu) - (master) added emergency store metadata to some other places on errors during standard hourly store (inspired by Davies Liu) - (cs) default space to be left (256MB) moved to config file (inspired by Davies Liu) - (cs) added extra limits in mfshdd.cfg (minimum space to be left, maximum space to be used) - (cs) fixed charts overflow issue (overflow in net transfer on about 575Mbps and hdd transfer on about 77MBps) - (metalogger) fixed issue: file variable was not clear after close (on rare occasions might cause segfault after disconnecting from master) - (all) cfg files moved form PREFIX/etc/ to PREFIX/etc/mfs/ - (cgiserv) improved CGI handle (added support for custom http responses, such as "302 Found") - (master+cgi) showing disconnected chunkservers in "Servers" tab. - (deb+rpm) mfscgiserv moved from mfscgi to separate package, changes in init scripts - (mount) added option 'mfsdelayedinit' - for being run from fstab/init scripts - (master) optimized goal management in chunks - (master) fixed rare race-condition on clear/preserve cache during open in mount - (mount) fixed compiling problems on Mac OS X - (all) changed code to be more compatible with new gcc 4.7 (gcc 4.7 has too strong optimizations - it can generate unpredictable code) - (master) sustain session time could be defined in mfsmaster.cfg * MooseFS 1.6.26 (2012-02-01) - (all) fixed signal handling in multithreaded modules - (master) added goal and trashtime limits to mfsexports.cfg - (metalogger) added simple check for downloaded metadata file (inspired by Davies Liu) - (master) better handle disk full (inspired by Davies Liu) - (master+metalogger) added keeping previous copies of metadata (inspired by Davies Liu) - (all) reload all settings on "reload" (SIGHUP) - (cs) disk scanning in background - (cs) fixed long termination issue (found by Davies Liu) - (master) fixed modify/open cache race * MooseFS 1.6.25 (2011-12-30) - (metadump) fixed dumping big files (>2TiB) - (metarestore) fixed bug: nonexisting changelog file caused segv - (master+mount) added 'sugidclearmode' and 'mkdircopysgid' compatibility options - (master) improved chunk deletion algorithm (soft/hard limits per server) - (all) ready for new metadata file format, which will be introduced in upcomoing version 1.7 - (all) ready for quota handling, which will be introduced in upcoming version 1.7 * MooseFS 1.6.24 (2011-12-06) - (master+mount) proxy in mount for mfstools (fixes problems with frequent connect to master) * MooseFS 1.6.23 (2011-11-08) - (master+mount) removed directory cache (didn't increase performance as expected and caused many troubles) - (metarestore) added option (-i) - ignore some structure inconsistencies - (metarestore) added option (-b) - in case of errors save the best metadata file - (mount) more dynamic write cache management (changed condition ib