diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5d1403070f..7b75431f2d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,9 @@ concurrency: group: build-${{ github.ref }} cancel-in-progress: true +env: + USER_VERSION: v5.6-rc1 + jobs: cmake-almalinux8: diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 6a3084b7891..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "src/XrdCeph"] - path = src/XrdCeph - url = https://github.com/xrootd/xrootd-ceph diff --git a/CMakeLists.txt b/CMakeLists.txt index ec47ab07053..410c20bc4cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,23 +54,6 @@ macro( add_executable _target ) add_dependencies( ${_target} XrdVersion.hh ) endmacro() -#------------------------------------------------------------------------------- -# Checkout the vomsxrd submodule -#------------------------------------------------------------------------------- -find_package(Git QUIET) -if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") - option(GIT_SUBMODULES "Check submodules during build" ON) - if(GIT_SUBMODULES) - message(STATUS "Submodule update") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GIT_SUBMOD_RESULT) - if(NOT GIT_SUBMOD_RESULT EQUAL "0") - message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") - endif() - endif() -endif() - #------------------------------------------------------------------------------- # Build in subdirectories #------------------------------------------------------------------------------- diff --git a/gen-tarball.sh b/gen-tarball.sh index aa1605e6ed5..588c372f7f2 100755 --- a/gen-tarball.sh +++ b/gen-tarball.sh @@ -29,8 +29,6 @@ if [ $? -ne 0 ] ; then exit 1 fi git archive --prefix xrootd-${fver}/ ${ver} -o ${tdir}/xrootd-${fver}.tar -git submodule update --init -git submodule foreach --recursive "git archive --prefix xrootd-${fver}/\$path/ \$sha1 -o ${tdir}/\$sha1.tar ; tar -A -f ${tdir}/xrootd-${fver}.tar ${tdir}/\$sha1.tar ; rm ${tdir}/\$sha1.tar" cd ${tdir} gzip xrootd-${fver}.tar mv xrootd-${fver}.tar.gz ${curdir} diff --git a/packaging/makesrpm.sh b/packaging/makesrpm.sh index 817ffdd2f1f..6dbfa6479e3 100755 --- a/packaging/makesrpm.sh +++ b/packaging/makesrpm.sh @@ -239,39 +239,6 @@ if test $? -ne 0; then exit 6 fi -#------------------------------------------------------------------------------- -# Make sure submodules are in place -#------------------------------------------------------------------------------- -git submodule init -git submodule update -- src/XrdClHttp -git submodule update -- src/XrdCeph -#git submodule foreach git pull origin master - -#------------------------------------------------------------------------------- -# Add XrdCeph sub-module to our tarball -#------------------------------------------------------------------------------- -cd src/XrdCeph - -if [ -z ${TAG+x} ]; then - COMMIT=`git log --pretty=format:"%H" -1` -else - COMMIT=$TAG -fi - -git archive --prefix=xrootd/src/XrdCeph/ --format=tar $COMMIT > $RPMSOURCES/xrootd-ceph.tar -if test $? -ne 0; then - echo "[!] Unable to create the xrootd-ceph source tarball" 1>&2 - exit 6 -fi - -tar --concatenate --file $RPMSOURCES/xrootd.tar $RPMSOURCES/xrootd-ceph.tar -if test $? -ne 0; then - echo "[!] Unable to add xrootd-ceph to xrootd tarball" 1>&2 - exit 6 -fi - -cd - > /dev/null - #------------------------------------------------------------------------------- # gzip the tarball #------------------------------------------------------------------------------- diff --git a/src/XrdCeph b/src/XrdCeph deleted file mode 160000 index 6ba517522a7..00000000000 --- a/src/XrdCeph +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6ba517522a7a15e08ad061b96996e8ee14328014 diff --git a/src/XrdCeph/.gitattributes b/src/XrdCeph/.gitattributes new file mode 100644 index 00000000000..0893fe6afee --- /dev/null +++ b/src/XrdCeph/.gitattributes @@ -0,0 +1 @@ +VERSION_INFO export-subst diff --git a/src/XrdCeph/.gitignore b/src/XrdCeph/.gitignore new file mode 100644 index 00000000000..9bf47afb3b4 --- /dev/null +++ b/src/XrdCeph/.gitignore @@ -0,0 +1,58 @@ +*.o +*.lo +.libs +.deps +Makefile +Makefile.in +*.la +GNUmakefile.classic +aclocal.m4 +autom4te.cache/ +compile +config/GNUmake.rules.sunCC +config/GNUmake.rules.sunCCamd +config/GNUmake.rules.sunCCamd510 +config/GNUmake.rules.sunCCamd64 +config/GNUmake.rules.sunCCi86pc +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +lib/ +libtool +ltmain.sh +missing +src/GNUmake.env +src/GNUmake.options +src/Makefile_include +src/XrdAcc/XrdAccTest +src/XrdApps/mpxstats +src/XrdApps/wait41 +src/XrdApps/xrdadler32 +src/XrdClient/TestXrdClient +src/XrdClient/TestXrdClient_read +src/XrdClient/XrdClientAdmin_c_wrap.cc +src/XrdClient/xprep +src/XrdClient/xrd +src/XrdClient/xrdcp +src/XrdClient/xrdstagetool +src/XrdCms/cmsd +src/XrdCns/XrdCnsd +src/XrdCns/cns_ssi +src/XrdFrm/frm_admin +src/XrdFrm/frm_purged +src/XrdFrm/frm_xfragent +src/XrdFrm/frm_xfrd +src/XrdSec/testclient +src/XrdSec/testserver +src/XrdSecgsi/xrdgsiproxy +src/XrdSecpwd/xrdpwdadmin +src/XrdSecssl/xrdsecssltest +src/XrdSecsss/xrdsssadmin +src/XrdXrootd/xrootd +test/testconfig.sh +xrootd.spec + diff --git a/src/XrdCeph/.gitlab-ci.yml b/src/XrdCeph/.gitlab-ci.yml new file mode 100644 index 00000000000..3b097867e8e --- /dev/null +++ b/src/XrdCeph/.gitlab-ci.yml @@ -0,0 +1,75 @@ +stages: + - build:rpm + +release:cc7:ceph: + stage: build:rpm + image: gitlab-registry.cern.ch/linuxsupport/cc7-base + script: + - yum install --nogpg -y cmake3 make gcc-c++ rpm-build which git yum-plugin-priorities sssd-client sudo createrepo + - git checkout tags/${CI_COMMIT_TAG} + - cd packaging/ + - ./makesrpm.sh --define "dist .el7" + - echo -e '[ceph]\nname=ceph\nbaseurl=http://linuxsoft.cern.ch/mirror/download.ceph.com/rpm-nautilus/el7/x86_64/\npriority=4\ngpgcheck=0\nenabled=1\n' >> /etc/yum.repos.d/ceph.repo + - echo -e '[xrootd-testing]\nname=XRootD Testing repository\nbaseurl=http://xrootd.org/binaries/testing/slc/7/$basearch http://xrootd.cern.ch/sw/repos/testing/slc/7/$basearch\ngpgcheck=1\nenabled=1\nprotect=0\ngpgkey=http://xrootd.cern.ch/sw/releases/RPM-GPG-KEY.txt\n' >> /etc/yum.repos.d/xrootd-testing.repo + - echo -e '[xrootd-stable]\nname=XRootD Stable repository\nbaseurl=http://xrootd.org/binaries/stable/slc/7/$basearch http://xrootd.cern.ch/sw/repos/stable/slc/7/$basearch\ngpgcheck=1\nenabled=1\nprotect=0\ngpgkey=http://xrootd.cern.ch/sw/releases/RPM-GPG-KEY.txt\n' >> /etc/yum.repos.d/xrootd-stable.repo + - yum-builddep --setopt=cern*.exclude=xrootd* --nogpgcheck -y *.src.rpm + - rpmbuild --rebuild --define "_rpmdir RPMS/" --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" -D "dist .el7" *.src.rpm + - repo=/eos/project/s/storage-ci/www/xrootd/ceph-release/cc-7/x86_64/ + - sudo -u stci -H mkdir -p $repo + - sudo -u stci -H cp *.src.rpm $repo + - sudo -u stci -H cp RPMS/* $repo + - sudo -u stci -H createrepo --update -q $repo + tags: + - docker_node + only: + - tags + except: + - schedules + +weekly:cc7:ceph: + stage: build:rpm + image: gitlab-registry.cern.ch/linuxsupport/cc7-base + script: + - yum install --nogpg -y cmake3 make gcc-c++ rpm-build which git yum-plugin-priorities sssd-client sudo createrepo + - cd packaging/ + - echo -e '[ceph]\nname=ceph\nbaseurl=http://linuxsoft.cern.ch/mirror/download.ceph.com/rpm-nautilus/el7/x86_64/\npriority=4\ngpgcheck=0\nenabled=1\n' >> /etc/yum.repos.d/ceph.repo + - echo -e '[xrootd-experimental]\nname=XRootD Experimental repository\nbaseurl=http://storage-ci.web.cern.ch/storage-ci/xrootd/experimental/epel-7/$basearch\ngpgcheck=1\nenabled=1\nprotect=0\n' >> /etc/yum.repos.d/xrootd-experimental.repo + - yum clean all + - version=$(yum info xrootd-devel | grep Version | cut -d':' -f2 | tr -d "[:blank:]") + - release=$(yum info xrootd-devel | grep Release | cut -d':' -f2 | tr -d "[:blank:]") + - release=${release%.el7.cern} + - ./makesrpm.sh --version "$version-$release" + - yum-builddep --setopt=cern*.exclude=xrootd* --nogpgcheck -y *.src.rpm + - rpmbuild --rebuild --define "_rpmdir RPMS/" --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" *.src.rpm + tags: + - docker_node + only: + - schedules + +build:cc7:ceph: + stage: build:rpm + image: gitlab-registry.cern.ch/linuxsupport/cc7-base + script: + - yum install --nogpg -y cmake3 make gcc-c++ rpm-build which git yum-plugin-priorities sssd-client sudo createrepo + - cd packaging/ + - echo -e '[ceph]\nname=ceph\nbaseurl=http://linuxsoft.cern.ch/mirror/download.ceph.com/rpm-nautilus/el7/x86_64/\npriority=4\ngpgcheck=0\nenabled=1\n' >> /etc/yum.repos.d/ceph.repo + - echo -e '[xrootd-experimental]\nname=XRootD Experimental repository\nbaseurl=http://storage-ci.web.cern.ch/storage-ci/xrootd/experimental/epel-7/$basearch\ngpgcheck=1\nenabled=1\nprotect=0\n' >> /etc/yum.repos.d/xrootd-experimental.repo + - yum clean all + - version=$(yum info xrootd-devel | grep Version | cut -d':' -f2 | tr -d "[:blank:]") + - release=$(yum info xrootd-devel | grep Release | cut -d':' -f2 | tr -d "[:blank:]") + - release=${release%.el7.cern} + - ./makesrpm.sh --version "$version-$release" + - yum-builddep --setopt=cern*.exclude=xrootd* --nogpgcheck -y *.src.rpm + - rpmbuild --rebuild --define "_rpmdir RPMS/" --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" *.src.rpm + - path=/eos/project/s/storage-ci/www/xrootd/ceph/cc-7/x86_64/$(date +'%Y%m%d') + - sudo -u stci -H mkdir -p $path; + - sudo -u stci -H find ${path} -type f -name '*.rpm' -delete; + - sudo -u stci -H cp RPMS/* $path; + - sudo -u stci -H createrepo --update -q $path; + tags: + - docker_node + only: + - master + except: + - tags + diff --git a/src/XrdCeph/.travis.yml b/src/XrdCeph/.travis.yml new file mode 100644 index 00000000000..0f57d7cb54e --- /dev/null +++ b/src/XrdCeph/.travis.yml @@ -0,0 +1,22 @@ +sudo: false +dist: trusty +addons: + apt: + packages: + - libxml2-dev + - libcppunit-dev +language: cpp +compiler: + - clang + - gcc +script: + - mkdir build + - pushd build + - cmake -DCMAKE_INSTALL_PREFIX=$HOME/xrootd -DENABLE_TESTS=1 .. + - make + - make install + - popd +#after_script: +# - pushd build +# - ./tests/common/text-runner ./tests/XrdClTests/libXrdClTests.so 'All Tests' +# - popd diff --git a/src/XrdCeph/CMakeLists.txt b/src/XrdCeph/CMakeLists.txt new file mode 100644 index 00000000000..bce584b15a9 --- /dev/null +++ b/src/XrdCeph/CMakeLists.txt @@ -0,0 +1,62 @@ +#------------------------------------------------------------------------------- +# Project description +#------------------------------------------------------------------------------- +cmake_minimum_required( VERSION 3.1 ) + +project( xrootd-ceph ) + +set( CMAKE_MODULE_PATH + ${PROJECT_SOURCE_DIR}/src + ${PROJECT_SOURCE_DIR}/cmake ) + +if( NOT XRDCEPH_SUBMODULE ) + if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) + cmake_policy(SET CMP0054 OLD) + endif() +endif() + +include( XRootDUtils ) +CheckBuildDirectory() + +include( XRootDOSDefs ) +include( XRootDDefaults ) +include( XRootDFindLibs ) + +add_definitions( -DXRDPLUGIN_SOVERSION="${PLUGIN_VERSION}" ) + +#------------------------------------------------------------------------------- +# Generate the version header +#------------------------------------------------------------------------------- +if( NOT XRDCEPH_SUBMODULE ) + execute_process( + COMMAND ${CMAKE_SOURCE_DIR}/genversion.sh --print-only ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE XROOTD_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE ) + + add_custom_target( + XrdVersion.hh + ${CMAKE_SOURCE_DIR}/genversion.sh ${CMAKE_SOURCE_DIR} ) + + # sigh, yet another ugly hack :( + macro( add_library _target ) + _add_library( ${_target} ${ARGN} ) + add_dependencies( ${_target} XrdVersion.hh ) + endmacro() + + macro( add_executable _target ) + _add_executable( ${_target} ${ARGN} ) + add_dependencies( ${_target} XrdVersion.hh ) + endmacro() +endif() + +#------------------------------------------------------------------------------- +# Build in subdirectories +#------------------------------------------------------------------------------- +add_subdirectory( src ) + +if( BUILD_TESTS ) + ENABLE_TESTING() + add_subdirectory( tests ) +endif() + +include( XRootDSummary ) diff --git a/src/XrdCeph/COPYING b/src/XrdCeph/COPYING new file mode 100644 index 00000000000..94a9ed024d3 --- /dev/null +++ b/src/XrdCeph/COPYING @@ -0,0 +1,674 @@ + 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 +. diff --git a/src/XrdCeph/COPYING.BSD b/src/XrdCeph/COPYING.BSD new file mode 100644 index 00000000000..ea8ff31a74e --- /dev/null +++ b/src/XrdCeph/COPYING.BSD @@ -0,0 +1,35 @@ +******************************************************************************** +*Prior to September 2nd, 2012 the XRootD software suite was licensed under a * +*modified BSD license shown below. This applies to all code that was in the * +*XRootD git repository prior to that date. All code is now licensed under LGPL.* +* See files LICENSE, COPYING.LGPL, and COPYING for license details. * +******************************************************************************** + +Copyright (c) 2005-2012, Board of Trustees of the Leland Stanford, Jr. University. +Produced under contract DE-AC02-76-SF00515 with the US Department of Energy. +All rights reserved. + Conditions of Use +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: +a. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +b. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +c. Neither the name of the Leland Stanford, Jr. University nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. +d. Products derived from this software that do not adhere to the xrootd or cmsd + protocol specifications may not use the acronyms 'cmsd', 'Scalla', 'xroot', + and 'xrootd', regardless of capitalization, to describe such derivative works. + DISCLAIMER +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/XrdCeph/COPYING.LGPL b/src/XrdCeph/COPYING.LGPL new file mode 100644 index 00000000000..65c5ca88a67 --- /dev/null +++ b/src/XrdCeph/COPYING.LGPL @@ -0,0 +1,165 @@ + GNU LESSER 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. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser 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 +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/src/XrdCeph/Doxyfile b/src/XrdCeph/Doxyfile new file mode 100644 index 00000000000..0531e916456 --- /dev/null +++ b/src/XrdCeph/Doxyfile @@ -0,0 +1,316 @@ +# Doxyfile 1.3.7 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = xrootd +PROJECT_NUMBER = +OUTPUT_DIRECTORY = doxydoc +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +DISTRIBUTE_GROUP_DOC = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = \ +src/XrdSec/XrdSecEntity.hh \ +src/XrdSec/XrdSecInterface.hh \ +src/Xrd/XrdJob.hh \ +src/Xrd/XrdBuffer.hh \ +src/Xrd/XrdScheduler.hh \ +src/Xrd/XrdLink.hh \ +src/Xrd/XrdLinkMatch.hh \ +src/Xrd/XrdProtocol.hh \ +src/XrdXrootd/XrdXrootdMonData.hh \ +src/XrdVersionPlugin.hh \ +src/XrdCks/XrdCksData.hh \ +src/XrdCks/XrdCksManager.hh \ +src/XrdCks/XrdCksCalc.hh \ +src/XrdCks/XrdCks.hh \ +src/XrdSfs/XrdSfsInterface.hh \ +src/XrdSfs/XrdSfsAio.hh \ +src/XrdNet/XrdNet.hh \ +src/XrdNet/XrdNetCmsNotify.hh \ +src/XrdNet/XrdNetConnect.hh \ +src/XrdNet/XrdNetOpts.hh \ +src/XrdNet/XrdNetSocket.hh \ +src/XrdSys/XrdSysError.hh \ +src/XrdSys/XrdSysPlatform.hh \ +src/XrdSys/XrdSysLogger.hh \ +src/XrdSys/XrdSysPthread.hh \ +src/XrdSys/XrdSysTimer.hh \ +src/XrdSys/XrdSysHeaders.hh \ +src/XrdSys/XrdSysDNS.hh \ +src/XrdSys/XrdSysXSLock.hh \ +src/XrdSys/XrdSysIOEvents.hh \ +src/XrdSys/XrdSysAtomics.hh \ +src/XrdSys/XrdSysPlugin.hh \ +src/XrdSys/XrdSysSemWait.hh \ +src/XrdClient/XrdClientConst.hh \ +src/XrdClient/XrdClientVector.hh \ +src/XrdClient/XrdClientAbs.hh \ +src/XrdClient/XrdClientAbsMonIntf.hh \ +src/XrdClient/XrdClient.hh \ +src/XrdClient/XrdClientUnsolMsg.hh \ +src/XrdClient/XrdClientAdmin.hh \ +src/XrdClient/XrdClientUrlSet.hh \ +src/XrdClient/XrdClientUrlInfo.hh \ +src/XrdClient/XrdClientEnv.hh \ +src/XrdOuc/XrdOucRash.hh \ +src/XrdOuc/XrdOucStream.hh \ +src/XrdOuc/XrdOuca2x.hh \ +src/XrdOuc/XrdOucTrace.hh \ +src/XrdOuc/XrdOucCRC.hh \ +src/XrdOuc/XrdOucErrInfo.hh \ +src/XrdOuc/XrdOucDLlist.hh \ +src/XrdOuc/XrdOucCache.hh \ +src/XrdOuc/XrdOucTList.hh \ +src/XrdOuc/XrdOucName2Name.hh \ +src/XrdOuc/XrdOucTable.hh \ +src/XrdOuc/XrdOucIOVec.hh \ +src/XrdOuc/XrdOucCallBack.hh \ +src/XrdOuc/XrdOucEnum.hh \ +src/XrdOuc/XrdOucLock.hh \ +src/XrdOuc/XrdOucTokenizer.hh \ +src/XrdOuc/XrdOucEnv.hh \ +src/XrdOuc/XrdOucString.hh \ +src/XrdOuc/XrdOucChain.hh \ +src/XrdOuc/XrdOucUtils.hh \ +src/XrdOuc/XrdOucHash.hh \ +src/XrdOss/XrdOss.hh \ +src/XrdOss/XrdOssStatInfo.hh \ +src/XrdOss/XrdOssDefaultSS.hh \ +src/XrdPosix/XrdPosixXrootd.hh \ +src/XrdPosix/XrdPosixExtern.hh \ +src/XrdPosix/XrdPosixXrootdPath.hh \ +src/XrdPosix/XrdPosixOsDep.hh \ +src/XrdPosix/XrdPosixCallBack.hh \ +src/XrdAcc/XrdAccAuthorize.hh \ +src/XrdAcc/XrdAccPrivs.hh \ +src/XProtocol/XPtypes.hh \ +src/XProtocol/XProtocol.hh \ +src/XrdCms/XrdCmsClient.hh \ +src/XrdCl/XrdClEnv.hh \ +src/XrdCl/XrdClPostMaster.hh \ +src/XrdCl/XrdClFileSystem.hh \ +src/XrdCl/XrdClPostMasterInterfaces.hh \ +src/XrdCl/XrdClBuffer.hh \ +src/XrdCl/XrdClConstants.hh \ +src/XrdCl/XrdClCopyProcess.hh \ +src/XrdCl/XrdClDefaultEnv.hh \ +src/XrdCl/XrdClMessage.hh \ +src/XrdCl/XrdClMonitor.hh \ +src/XrdCl/XrdClStatus.hh \ +src/XrdCl/XrdClTransportManager.hh \ +src/XrdCl/XrdClURL.hh \ +src/XrdCl/XrdClAnyObject.hh \ +src/XrdCl/XrdClXRootDResponses.hh \ +src/XrdCl/XrdClFile.hh \ +src/XrdFileCache/XrdFileCacheDecision.hh +src/XrdFileCache/XrdFileCacheFile.hh +src/XrdFileCache/XrdFileCache.hh +src/XrdFileCache/XrdFileCacheInfo.hh +src/XrdFileCache/XrdFileCacheIOEntireFile.hh +src/XrdFileCache/XrdFileCacheIOFileBlock.hh +src/XrdFileCache/XrdFileCacheIO.hh +src/XrdFileCache/XrdFileCachePrint.hh +src/XrdFileCache/XrdFileCacheStats.hh +src/XrdFileCache/XrdFileCacheTrace.hh + +FILE_PATTERNS = *.hh +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 0 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/src/XrdCeph/LICENSE b/src/XrdCeph/LICENSE new file mode 100644 index 00000000000..8fd5621be2c --- /dev/null +++ b/src/XrdCeph/LICENSE @@ -0,0 +1,18 @@ +"Copyright (c) 2005-2012, Board of Trustees of the Leland Stanford, Jr. University.\n" +"Produced under contract DE-AC02-76-SF00515 with the US Department of Energy. \n" +"All rights reserved. The copyright holder's institutional names may not be used to\n" +"endorse or promote products derived from this software without specific prior \n" +"written permission.\n\n" +"This file is part of the XRootD software suite. \n\n" +"XRootD is free software: you can redistribute it and/or modify it under the terms \n" +"of the GNU Lesser General Public License as published by the Free Software \n" +"Foundation, either version 3 of the License, or (at your option) any later version.\n\n" +"XRootD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n" +"without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR \n" +"PURPOSE. See the GNU Lesser General Public License for more details. \nn" +"You should have received a copy of the GNU Lesser General Public License along \n" +"with XRootD in a file called COPYING.LESSER (LGPL license) and file COPYING (GPL \n" +"license). If not, see .\n\n" +"Prior to September 2nd, 2012 the XRootD software suite was licensed under a\n" +"modified BSD license (see file COPYING.BSD). This applies to all code that\n" +"was in the XRootD git repository prior to that date.\n" diff --git a/src/XrdCeph/README b/src/XrdCeph/README new file mode 100644 index 00000000000..e2bf17c3df6 --- /dev/null +++ b/src/XrdCeph/README @@ -0,0 +1,54 @@ + +-------------------------------------------------------------------------------- + _ _ ______ _____ + \ \ / (_____ \ _ (____ \ + \ \/ / _____) ) ___ ___ | |_ _ \ \ + ) ( (_____ ( / _ \ / _ \| _)| | | | + / /\ \ | | |_| | |_| | |__| |__/ / + /_/ \_\ |_|\___/ \___/ \___)_____/ + +-------------------------------------------------------------------------------- + +0. xrootd-ceph is a OSS layer XRootD plug-in for interfacing with Ceph storage + platform. The plug-in has to be build against respective Ceph version, the + repository can be found at: + + https://download.ceph.com/rpm-{ceph-release}/{distro}/$basearch + +1. S U P P O R T E D O P E R A T I N G S Y S T E M S + + XRootD is supported on the following platforms: + + * RedHat Enterprise Linux 7 and derivatives (Scientific Linux) + compiled with gcc + +2. B U I L D I N S T R U C T I O N S + +2.1 Build system + + xrootd-ceph uses CMake to handle the build process. Please use CMake version 3 or greater (e.g. cmake3). + +2.2 Build steps + + * Create an empty build directory: + + mkdir build + cd build + + * Ensure that the correct plugin version number is set in cmake/XRootDDefaults.cmake: + + if( NOT XRDCEPH_SUBMODULE ) + define_default( PLUGIN_VERSION 5 ) + endif() + + * Generate the build system files using cmake, ie: + + cmake /path/to/the/xrootd-ceph/source -DCMAKE_INSTALL_PREFIX=/opt/xrootd + + * Build the source: + + make + + * Install the shared libraries: + + make install diff --git a/src/XrdCeph/VERSION_INFO b/src/XrdCeph/VERSION_INFO new file mode 100644 index 00000000000..5ac45999939 --- /dev/null +++ b/src/XrdCeph/VERSION_INFO @@ -0,0 +1 @@ +$Format:RefNames: %d%nShortHash: %h%nDate: %ai%n$ \ No newline at end of file diff --git a/src/XrdCeph/cmake/FindCPPUnit.cmake b/src/XrdCeph/cmake/FindCPPUnit.cmake new file mode 100644 index 00000000000..9b015db1b96 --- /dev/null +++ b/src/XrdCeph/cmake/FindCPPUnit.cmake @@ -0,0 +1,30 @@ +# Try to find CPPUnit +# Once done, this will define +# +# CPPUNIT_FOUND - system has cppunit +# CPPUNIT_INCLUDE_DIRS - the cppunit include directories +# CPPUNIT_LIBRARIES - cppunit libraries directories + +find_path( CPPUNIT_INCLUDE_DIRS cppunit/ui/text/TestRunner.h + HINTS + ${CPPUNIT_DIR} + $ENV{CPPUNIT_DIR} + /usr + /opt + PATH_SUFFIXES include +) + +find_library( CPPUNIT_LIBRARIES cppunit + HINTS + ${CPPUNIT_DIR} + $ENV{CPPUNIT_DIR} + /usr + /opt + PATH_SUFFIXES lib +) + +set(CPPUNIT_INCLUDE_DIRS ${CPPUNIT_INCLUDE_DIR}) +set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(cppunit DEFAULT_MSG CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES) diff --git a/src/XrdCeph/cmake/FindXRootD.cmake b/src/XrdCeph/cmake/FindXRootD.cmake new file mode 100644 index 00000000000..48fe966b858 --- /dev/null +++ b/src/XrdCeph/cmake/FindXRootD.cmake @@ -0,0 +1,35 @@ +# Try to find XRootD +# Once done, this will define +# +# XROOTD_FOUND - system has xrootd +# XROOTD_INCLUDE_DIRS - the xrootd include directories +# XROOTD_LIBRARIES - xrootd libraries directories + +if( XRDCEPH_SUBMODULE ) + set( XROOTD_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/src ) + set( XROOTD_LIBRARIES XrdUtils ) +else() + find_path( XROOTD_INCLUDE_DIRS XrdSfs/XrdSfsAio.hh + HINTS + ${XROOTD_DIR} + $ENV{XROOTD_DIR} + /usr + /opt + PATH_SUFFIXES include/xrootd + ) + + find_library( XROOTD_LIBRARIES XrdUtils + HINTS + ${XROOTD_DIR} + $ENV{XROOTD_DIR} + /usr + /opt + PATH_SUFFIXES lib + ) +endif() + +set(XROOTD_INCLUDE_DIR ${XROOTD_INCLUDE_DIRS}) +set(XROOTD_LIBRARY ${XROOTD_LIBRARIES}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(xrootd DEFAULT_MSG XROOTD_INCLUDE_DIRS XROOTD_LIBRARIES) diff --git a/src/XrdCeph/cmake/Findceph.cmake b/src/XrdCeph/cmake/Findceph.cmake new file mode 100644 index 00000000000..661891de850 --- /dev/null +++ b/src/XrdCeph/cmake/Findceph.cmake @@ -0,0 +1,43 @@ +# - Find ceph +# +# RADOS_INCLUDE_DIR - location of the ceph-devel header files for rados +# RADOS_LIBS - list of rados libraries, with full path +# RADOS_FOUND + +find_path( + RADOS_INCLUDE_DIR + radosstriper/libradosstriper.hpp + HINTS + ${CEPH_DIR} + $ENV{CEPH_DIR} + /usr + /opt + PATH_SUFFIXES include +) + +find_library( + RADOSSTRIPER_LIB + NAMES radosstriper + HINTS + ${CEPH_DIR} + $ENV{CEPH_DIR} + /usr + /opt + PATH_SUFFIXES lib +) + +find_library( + RADOS_LIB + NAMES rados + HINTS + ${CEPH_DIR} + $ENV{CEPH_DIR} + /usr + /opt + PATH_SUFFIXES lib +) + +set(RADOS_LIBS ${RADOS_LIB} ${RADOSSTRIPER_LIB}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ceph DEFAULT_MSG RADOS_INCLUDE_DIR RADOS_LIBS) diff --git a/src/XrdCeph/cmake/GNUInstallDirs.cmake b/src/XrdCeph/cmake/GNUInstallDirs.cmake new file mode 100644 index 00000000000..a114dcb2e18 --- /dev/null +++ b/src/XrdCeph/cmake/GNUInstallDirs.cmake @@ -0,0 +1,182 @@ +# - Define GNU standard installation directories +# Provides install directory variables as defined for GNU software: +# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html +# Inclusion of this module defines the following variables: +# CMAKE_INSTALL_ - destination for files of a given type +# CMAKE_INSTALL_FULL_ - corresponding absolute path +# where is one of: +# BINDIR - user executables (bin) +# SBINDIR - system admin executables (sbin) +# LIBEXECDIR - program executables (libexec) +# SYSCONFDIR - read-only single-machine data (etc) +# SHAREDSTATEDIR - modifiable architecture-independent data (com) +# LOCALSTATEDIR - modifiable single-machine data (var) +# LIBDIR - object code libraries (lib or lib64) +# INCLUDEDIR - C header files (include) +# OLDINCLUDEDIR - C header files for non-gcc (/usr/include) +# DATAROOTDIR - read-only architecture-independent data root (share) +# DATADIR - read-only architecture-independent data (DATAROOTDIR) +# INFODIR - info documentation (DATAROOTDIR/info) +# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) +# MANDIR - man documentation (DATAROOTDIR/man) +# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) +# Each CMAKE_INSTALL_ value may be passed to the DESTINATION options of +# install() commands for the corresponding file type. If the includer does +# not define a value the above-shown default will be used and the value will +# appear in the cache for editing by the user. +# Each CMAKE_INSTALL_FULL_ value contains an absolute path constructed +# from the corresponding destination by prepending (if necessary) the value +# of CMAKE_INSTALL_PREFIX. + +#============================================================================= +# Copyright 2011 Nikita Krupen'ko +# Copyright 2011 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Installation directories +# +if(NOT DEFINED CMAKE_INSTALL_BINDIR) + set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SBINDIR) + set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR) + set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR) + set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR) + set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR) + set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_LIBDIR) + set(_LIBDIR_DEFAULT "lib") + # Override this default 'lib' with 'lib64' iff: + # - we are on Linux system but NOT cross-compiling + # - we are NOT on debian + # - we are on a 64 bits system + # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf + # Note that the future of multi-arch handling may be even + # more complicated than that: http://wiki.debian.org/Multiarch + if(CMAKE_SYSTEM_NAME MATCHES "Linux" + AND NOT CMAKE_CROSSCOMPILING + AND NOT EXISTS "/etc/debian_version") + if(NOT DEFINED CMAKE_SIZEOF_VOID_P) + message(AUTHOR_WARNING + "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " + "Please enable at least one language before including GNUInstallDirs.") + else() + if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") + set(_LIBDIR_DEFAULT "lib64") + endif() + endif() + endif() + set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})") +endif() + +if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR) + set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR) + set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)") +endif() + +if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR) + set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)") +endif() + +#----------------------------------------------------------------------------- +# Values whose defaults are relative to DATAROOTDIR. Store empty values in +# the cache and store the defaults in local variables if the cache values are +# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes. + +if(NOT CMAKE_INSTALL_DATADIR) + set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)") + set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}") +endif() + +if(NOT CMAKE_INSTALL_INFODIR) + set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)") + set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info") +endif() + +if(NOT CMAKE_INSTALL_LOCALEDIR) + set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)") + set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale") +endif() + +if(NOT CMAKE_INSTALL_MANDIR) + set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)") + set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man") +endif() + +if(NOT CMAKE_INSTALL_DOCDIR) + set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)") + set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}") +endif() + +#----------------------------------------------------------------------------- + +mark_as_advanced( + CMAKE_INSTALL_BINDIR + CMAKE_INSTALL_SBINDIR + CMAKE_INSTALL_LIBEXECDIR + CMAKE_INSTALL_SYSCONFDIR + CMAKE_INSTALL_SHAREDSTATEDIR + CMAKE_INSTALL_LOCALSTATEDIR + CMAKE_INSTALL_LIBDIR + CMAKE_INSTALL_INCLUDEDIR + CMAKE_INSTALL_OLDINCLUDEDIR + CMAKE_INSTALL_DATAROOTDIR + CMAKE_INSTALL_DATADIR + CMAKE_INSTALL_INFODIR + CMAKE_INSTALL_LOCALEDIR + CMAKE_INSTALL_MANDIR + CMAKE_INSTALL_DOCDIR + ) + +# Result directories +# +foreach(dir + BINDIR + SBINDIR + LIBEXECDIR + SYSCONFDIR + SHAREDSTATEDIR + LOCALSTATEDIR + LIBDIR + INCLUDEDIR + OLDINCLUDEDIR + DATAROOTDIR + DATADIR + INFODIR + LOCALEDIR + MANDIR + DOCDIR + ) + if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") + else() + set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") + endif() +endforeach() diff --git a/src/XrdCeph/cmake/XRootDDefaults.cmake b/src/XrdCeph/cmake/XRootDDefaults.cmake new file mode 100644 index 00000000000..15416a3046d --- /dev/null +++ b/src/XrdCeph/cmake/XRootDDefaults.cmake @@ -0,0 +1,17 @@ +#------------------------------------------------------------------------------- +# Define the default build parameters +#------------------------------------------------------------------------------- +if( "${CMAKE_BUILD_TYPE}" STREQUAL "" ) + if( Solaris AND NOT SUNCC_CAN_DO_OPTS ) + set( CMAKE_BUILD_TYPE Debug ) + else() + set( CMAKE_BUILD_TYPE RelWithDebInfo ) + endif() +endif() + +if( NOT XRDCEPH_SUBMODULE ) + define_default( PLUGIN_VERSION 5 ) +endif() + +define_default( ENABLE_TESTS FALSE ) +define_default( ENABLE_CEPH TRUE ) diff --git a/src/XrdCeph/cmake/XRootDFindLibs.cmake b/src/XrdCeph/cmake/XRootDFindLibs.cmake new file mode 100644 index 00000000000..93b4a8fbf32 --- /dev/null +++ b/src/XrdCeph/cmake/XRootDFindLibs.cmake @@ -0,0 +1,16 @@ +#------------------------------------------------------------------------------- +# Find the required libraries +#------------------------------------------------------------------------------- + +find_package( XRootD REQUIRED ) + +find_package( ceph REQUIRED ) + +if( ENABLE_TESTS ) + find_package( CPPUnit ) + if( CPPUNIT_FOUND ) + set( BUILD_TESTS TRUE ) + else() + set( BUILD_TESTS FALSE ) + endif() +endif() diff --git a/src/XrdCeph/cmake/XRootDOSDefs.cmake b/src/XrdCeph/cmake/XRootDOSDefs.cmake new file mode 100644 index 00000000000..eadc24952b7 --- /dev/null +++ b/src/XrdCeph/cmake/XRootDOSDefs.cmake @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------- +# Define the OS variables +#------------------------------------------------------------------------------- + +include( CheckCXXSourceRuns ) + +add_definitions( -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ) +set( LIBRARY_PATH_PREFIX "lib" ) + +#------------------------------------------------------------------------------- +# GCC +#------------------------------------------------------------------------------- +if( CMAKE_COMPILER_IS_GNUCXX ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter" ) + # gcc 4.1 is retarded + execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion + OUTPUT_VARIABLE GCC_VERSION ) + if( (GCC_VERSION VERSION_GREATER 4.1 OR GCC_VERSION VERSION_EQUAL 4.1) + AND GCC_VERSION VERSION_LESS 4.2 ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" ) + endif() + + # for 4.9.3 or greater the 'omit-frame-pointer' + # interfears with custom semaphore implementation + if( (GCC_VERSION VERSION_GREATER 4.9.2) AND (USE_LIBC_SEMAPHORE EQUAL 0) ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer" ) + endif() + + # gcc 6.0 is more pedantic + if( GCC_VERSION VERSION_GREATER 6.0 OR GCC_VERSION VERSION_EQUAL 6.0 ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=misleading-indentation" ) + endif() +endif() + +#------------------------------------------------------------------------------- +# Linux +#------------------------------------------------------------------------------- +set( Linux TRUE ) +include( GNUInstallDirs ) +add_definitions( -D__linux__=1 ) +set( EXTRA_LIBS rt ) + diff --git a/src/XrdCeph/cmake/XRootDSummary.cmake b/src/XrdCeph/cmake/XRootDSummary.cmake new file mode 100644 index 00000000000..0fa0a49500c --- /dev/null +++ b/src/XrdCeph/cmake/XRootDSummary.cmake @@ -0,0 +1,19 @@ +#------------------------------------------------------------------------------- +# Print the configuration summary +#------------------------------------------------------------------------------- +set( TRUE_VAR TRUE ) +component_status( CEPH TRUE_VAR CEPH_FOUND ) +component_status( XROOTD TRUE_VAR XROOTD_FOUND ) +component_status( TESTS BUILD_TESTS CPPUNIT_FOUND ) + +message( STATUS "----------------------------------------" ) +message( STATUS "Installation path: " ${CMAKE_INSTALL_PREFIX} ) +message( STATUS "C Compiler: " ${CMAKE_C_COMPILER} ) +message( STATUS "C++ Compiler: " ${CMAKE_CXX_COMPILER} ) +message( STATUS "Build type: " ${CMAKE_BUILD_TYPE} ) +message( STATUS "Plug-in version: " ${PLUGIN_VERSION} ) +message( STATUS "" ) +message( STATUS "CEPH: " ${STATUS_CEPH} ) +message( STATUS "XRootD: " ${STATUS_XROOTD} ) +message( STATUS "Tests: " ${STATUS_TESTS} ) +message( STATUS "----------------------------------------" ) diff --git a/src/XrdCeph/cmake/XRootDUtils.cmake b/src/XrdCeph/cmake/XRootDUtils.cmake new file mode 100644 index 00000000000..6fbdf0fc9e7 --- /dev/null +++ b/src/XrdCeph/cmake/XRootDUtils.cmake @@ -0,0 +1,39 @@ + +#------------------------------------------------------------------------------- +# Add a compiler define flag if a variable is defined +#------------------------------------------------------------------------------- +macro( define_default variable value ) + if( NOT DEFINED ${variable} ) + set( ${variable} ${value} ) + endif() +endmacro() + +macro( component_status name flag found ) + if( ${flag} AND ${found} ) + set( STATUS_${name} "yes" ) + elseif( ${flag} AND NOT ${found} ) + set( STATUS_${name} "libs not found" ) + else() + set( STATUS_${name} "disabled" ) + endif() +endmacro() + +#------------------------------------------------------------------------------- +# Detect in source builds +#------------------------------------------------------------------------------- +function( CheckBuildDirectory ) + + # Get Real Paths of the source and binary directories + get_filename_component( srcdir "${CMAKE_SOURCE_DIR}" REALPATH ) + get_filename_component( bindir "${CMAKE_BINARY_DIR}" REALPATH ) + + # Check for in-source builds + if( ${srcdir} STREQUAL ${bindir} ) + message( FATAL_ERROR "XRootD cannot be built in-source! " + "Please run cmake outside the " + "source directory and be sure to remove " + "CMakeCache.txt or CMakeFiles if they " + "exist in the source directory." ) + endif() + +endfunction() diff --git a/src/XrdCeph/docs/PreReleaseNotes.txt b/src/XrdCeph/docs/PreReleaseNotes.txt new file mode 100644 index 00000000000..a414e1aa765 --- /dev/null +++ b/src/XrdCeph/docs/PreReleaseNotes.txt @@ -0,0 +1,8 @@ +====== +XRootD +====== + +Prerelease Notes +================ + + diff --git a/src/XrdCeph/docs/ReleaseNotes.txt b/src/XrdCeph/docs/ReleaseNotes.txt new file mode 100644 index 00000000000..c8a8ceb19dc --- /dev/null +++ b/src/XrdCeph/docs/ReleaseNotes.txt @@ -0,0 +1,1692 @@ +====== +XRootD +====== + +Release Notes +============= + + +------------- +Version 4.8.0 +------------- + ++ **New Features** + * **[XrdCl]** Local redirection and local file support. + * **[XrdCl]** merge xrdfs ls results if not unique, closes #541. + * **[XrdCl]** Provide client specific CGI info. + * **[XrdCl]** File::WriteV implementation, closes #388. + * **[XrdHttp]** Pass the HTTP verb to the external handler for path + matching. + * **[XrdHttp]** Allow one to access the XrdSecEntity object associated + with a request. + * **[XrdHttp]** Allow filtering based on HTTP verb in MatchesPath. + * **[XrdHttp]** Allow overwrites to be done on PUT. + * **[XrdHttp]** Allow multiple external handlers to be loaded by XrdHttp. + ++ **Major bug fixes** + * **[Server]** Correctly handle monEnt on file close to avoid SEGV. + Fixes #618. + * **[Server]** Poperly handle file descriptors up to 65535. + Fixes #607. + * **[Server]** Fix handling of >65K attached files (active links). + Fixes #623. + * **[Server]** Make sure doPost does not become <0 (regression introduced + in 4.7.1). + * **[Proxy]** Avoid SEGV when localroot specified w/o remote root. + Fixes #627. + * **[XrdCl]** Connection Window should be applied per IP address. + Fixes #625. + * **[XrdCl]** Write request and raw data with single writev, fixes #609. + * **[XrdHttp]** Allow XrdSfsGetDefaultFileSystem to be called multiple + times. + * **[XrdHttp]** Correct external handling logic. + * **[XrdSecgsi]** Use stack for proper cleaning of invalidated CRLs and CAs. + ++ **Minor bug fixes** + * **[Server]** Print error msg and close socket when a FD cannot. + be handled. + * **[Server]** Close additional loophole for fstream disconnect. + * **[Server]** Always unhook the statistcs object from xfr monitoring + if hooked. + * **[Server]** Ruggedize TPC to be less sensitive to protocol violations. + * **[Server]** Correct tpc directive scanning and make it more obvious. + Fixes #604. + * **[Server]** Enable url rewrites. Eliminates GSI roadblock. + * **[Server]** Do not reference a deleted object. + * **[XrdSsi]** Make sure to finalyze all requests upon disc, fixes #616. + * **[XrdHttp]** Handle properly http.secretkey. + * **[XrdCl]** various memory releated fixes. + * **[XrdPy]** Translate binary buffers into bytes objects, closes #632 + ++ **Miscellaneous** + * **[RPM]** Add python3 sub package. + * **[RPM]** Rename python sub-package, closes #614. + * **[Py]** Facilitate building python bindings with wheel. + +------------- +Version 4.7.1 +------------- + ++ **Major bug fixes** + * **[XrdSecgsi]** Fix segv in cache checking, fixes #595 + * **[XrdHttp]** Fix for the persistent connection issue. + * **[XrdHttp]** Fix FD leak when a socket error is encountered. + * **[XrdSsi]** Avoid race condition when response is posted. + * **[XrdSsi]** Avoid state conflict when request is being processed and + client asks for response. + * **[XrdCl]** Prevent segv in case user has no name. + * **[Server]** Close link on enable errors to prevent socket leaks. + ++ **Minor bug fixes** + * **[XrdLink]** Increment the IOSemaphore once for each waiting thread. + * **[XrdHttp]** Make sure that the preexisting url tokens are properly + quoted when generating a redirection. + * **[XrdCl]** Fix invalid memory reads/writes when RAII finalizes mutex + after the object has been deleted. + ++ **Miscellaneous** + * **[XrdCl]** Log last error in case redirect limit has been reached. + * **[XrdCl]** Add option to read credentials under different fsuid/fsgid. + * **[XrdCl]** Accept empty login response for protocol <= 2.8.9 + (This is only to ensure compatibility with dCache, which + due to its inaccurate implementation of XRoot protocol in + some cases returns an empty login response for protocol + version <= 2.8.9.) + * **[XrdCl]** Add envar to config Nagle algorithm. + * **[XrdSsi]** Reinitializ response object after Finished() so it can + reused. +* **[XrdHttp]** Header2cgi directive. + +------------- +Version 4.7.0 +------------- + ++ **New Features** + * **[Proxy]** Make cache I/O synchronization tunable. + * **[Proxy]** Allow caching of S3-style objects. + * **[Proxy/Posix]** Allow Name2Name to populate cache using the LFN. + * **[Posix]** Enable LITE feature in Posix preload library. + * **[Posix]** Implement serverless file caching (disk or memory). + * **[Server]** Allow storing S3-style objects in a file system. + * **[Server]** Add xrootd.fsoverload directive to handle filesystem overloads. + * **[Server]** Allow port to be specified for a supervisor. + * **[Server]** Add org and role types to AuthDB authorization. + * **[Server]** Allow definition and test of compound authorization identifiers. + * **[Server/Packaging]** Handle systemd socket inheritance. + * **[XrdApps]** Add XrdClProxyPlugin implementation. + * **[XrdCl]** Extreme copy implementation. + * **[XrdCl]** Delegate all callbacks to the thread-pool. + * **[XrdCl]** xrdfs: add recursive list, closes #421. + * **[XrdCeph]** Added support for namelib in ceph plugin . + * **[XrdFfs]** Implement xrootdfs_create. + * **[Python]** Python 3 support in C / Python interface. + * **[XrdHttp]** Make XrdHTTP able to forward HTTP requests to an external, + optional plugin (conceptually similar to CGI). + * **[Server]** XrdSsi V2 (scalable service interface) implementation. + ++ **Major bug fixes** + * **[XrdCl]** Avoid deadlock between FSH deletion and Tick() timeout. + * **[XrdCl]** Process virtual redierections in the threadpool. + * **[Xrd] Fix handling of sendfile offset argument. + ++ **Minor bug fixes** + * **[Server]** Make file locking independent of FS plugin. Fixes #533 + * **[Server]** Correct debug message interval for free space report. + * **[XrdCeph]** Fixed internal (f)stat so that it sets S_IFREG in returned mode. + * **[XrdCeph]** properly return ENOENT when file does not exist in open for read. + * **[XrdCeph]** Fixed configuration of the XrdCephOss module. + * **[XrdCeph]** Fixed some resource leak when Posix_Open fails. + * **[XrdFfs]** Remove default fuse argument "allow_other" as it is impossible + to unset. + * **[XrdFfs]** Check file descriptor before using it in xrootdfs wcache. + * **[XrdFfs]** Add more error checks when creating write cache. + * **[XrdFfs]** Avoid using literal 1024, replace with MAXROOTURLLEN. + * **[XrdFfs]** Control allow_other by env XROOTD_NOALLOWOTHER. + * **[XrdFfs]** Rewrite xrootdfs_mknod, extract low-level function. + * **[XrdCl]** Check login resp size, fixes #530 + * **[XrdCl]** Avoid FileStateHandler deadlock while forking. + * **[XrdCl]** Handle failed stateful operations without XrdCl::File lock + being locked. + * **[XrdPosix]** Use strncpy when copying checksum. + * **[RPM]** Fix init script bad exit code, fixes #536 + * **[XrdBuffer]** Decrement total buffer count when freeing buffers. + ++ **Miscellaneous** + * **[Server]** Re-enable the oss.fdlimit directive to allow POSIX preload+xrootd. + * **[Server]** Avoid thread pile-up durin slow close operations. + * **[Proxy]** Simplify delayed destruction on wait vs post. + * **[Posix]** Convert to using universal tracing facility. + * **[CI]** Add Travis CI configuration. + * **[CI]** Add .gitlab-ci.yml for gitlab CI. + * **[Packaging]** Add a sample XrdHttp config file. + * **[Packaging]** Make RPM version configurable by the user. + * **[Packaging]** Debian packaging. + * **[RPM/CMake]** Enable c++0x/c++11 by default. + * **[Crypto] Remove unused crypto code. + * **[XrdFileCache]** Add configuration parameter for flush frequency. + * **[XrdFileCache]** Alter ram limits and blocks size parameter if caching + is on the client side. + * **[XrdSut]** New XrdSutCache based on XrdOucHash. + * **[XrdSecgsi]** do not delete explicitely the CRL in Delete. + * **[XrdSut/Crypto]** Secgsi improvements: new version of XrdSutCache, + lightweith locking (PR #539). + +------------- +Version 4.6.1 +------------- + ++ **Major bug fixes** + + * **[Server/Proxy]** Avoid SEGV when close(), closedir() returns an error. + * **[cmsd]** Fix feature interaction causing improper file existence to be sent. + * **[XrdCrypto/XrdSecgsi]** Make sure the CRL is loaded for the right CA. + * **[XrdCrypto]** Support for OpenSSL 1.1 + * **[XrdSecgsi]** do not build/package libXrdSecgsiGMAPLDAP-4.so. + * **[XrdSecgsi]** Improve detection of errors when loading CRL. + * **[XrdSecgsi]** Fix for valid legacy proxy detection (PR #469) + * **[XrdSecgsi]** Absent CRLs not an error (#465) + * **[XrdSecgsi]** Fix for CA chain verification segfault (issue #463) + * **[XrdSecgsi]** Two memory leaks (PR #503) + * **[XrdCl]** Make sure there is no request/response mismatch, when + the retry logics tries to recover from an error. + * **[XrdCl/Server]** Be case insensitive when it comes to checksum names. + * **[XrdCeph]** Fix ability to read back a file written with O_RDWR flags. + * **[XrdCeph]** Disable logging of every read and write operation. A proper + debug-level logging would be needed instead. + * **[XrdCeph]** Added statistics about read/write operations in the + close log. + ++ **Minor bug fixes** + * **[XrdHttp]** Make the XrdHttpSecXtractor API backwards compatible. + * **[XrdFileCache]** Make caching proxy configuration backwards + compatible. + * **[XrdFileCache]** Fix cache v1 to cache v2 bridge after introducing + cache v2. + * **[XrdSec]** Use CommonCrypto header instead of openssl for SHA on OSX. + * **[XrdSeckrb5]** Fix memory leaks in client context and cache. + * **[Server/Logrotate]** Make sure XRootD logrotate does not interfire with + system logrotate, fixes #490 + * ** [Server]** Avoid std::ABORT should a naked logfile path be specified. + * **[XrdCl]** Make sure ForkHandler doesn't segv if PostMaster is null, + fixes #489 + * **[Packaging]** Set the working dir to /var/spool/xrootd on CC7, + fixes #365 + * **[Packaging]** On platforms where systemd is available, manage files in + /var/run with tmpfiles.d, fixes #485 + ++ **Miscellaneous** + * **[XrdPosix]** Add new minpages option to pss.cache to support large pages. + * **[XrdPosix]** Make XrdPosix.hh a public header; closes #479 + * **[XrdApps]** Remove XrdClient dependency from xrdadler32. + * **[Server]** Add XrdCksAssist functions to help handle XRootD checksums. + * **[Server/Proxy]** Move disk sync operations out of IO::ioActive() call. + * **[Server/Proxy]** Change severity IO::initLocalStat() log message. + * **[XrdFileCache]** Ease development of decision plugins. +* **[XrdFileCache]** Use ref-counts on File objects. + +------------- +Version 4.6.0 +------------- + ++ **New Features** + * **[XrdCms]** Add non-blocking sends to avoid slow links. + * **[XrdFileCache]** File caching proxy V2 (and new pss async interface). + ++ **Major bug fixes** + * **[XrdCeph]** Account for return Ceph xattr return codes. + * **[XrdCeph]** Fixed initialization of Ceph clusters when stripers are not used. + * **[XrdCrypto]** Improved determination of X509 certificate type, + including proxy version + * **[XrdHttp]** Fix memory leak in Bridge protocol (affects HTTP). + * **[XrdSecgsi]** Several improvements in the way CRLs are checked and reloaded. + * **[XrdCl]** Protect against spurious wakeups in SyncResponseHandler. + * **[XrdCl]** On read-timeout, if the stream is broken, make sure the request and + its handler are not double deleted. + ++ **Minor bug fixes** + * **[XrdCl]** Check if the file was correctly closed upon ZipArchiveReader destruction. + * **[Server]** Add limits for prepare requests. + * **[Server]** Delete buffers when the buffer manager is deleted. Fixes #414 + * **[Server]** Do not double count overlapping spaces. Fixes #425 + * **[XrdHttp]** Allow unauthenticated https clients. + * **[XrdHttp]** Make Xrdhttp secure by default (rejecting proxy cert in the absence + of a proper SecXtractor plugin) + ++ **Miscellaneous** + * **[XrdSecgsi]** Re-activate xrdgsitest + * **[RPM]** Include xrdgsitest in xrootd-client-devel package. + * **[XrdFileCache]** Add example of filecache configuration. + +------------- +Version 4.5.0 +------------- + ++ **New Features** + * **[XrdCms]** Allow specifying a different timeout for null cached entries; fixes #413 + * **[XProtocol/XrdSec/Server/XrdCl]** Implement request signing. + * **[XrdCl]** Add ZIP extracting capability to xrdcp. + * **[XrdCl]** Include the release number in client Login request cgi. + * **[XrdCl]** Add support for spaces in file names for mv operation. + ++ **Major bug fixes** + * **[XrdCrypto/Secgsi]** Fix XrdCryptosslMsgDigest::Init ; set 'sha256' as + default algorithm. + * **[XrdCl]** Use posix semaphores for fedora >= 22. Disable + omit-frame-ponter for gcc >= 4.9.3 if custom semaphores are used. + ++ **Minor bug fixes** + * **[XrdSecsss]** Fix memory leak in sss protocol. + * **[XrdNet]** Allow hostnames to begin with a digit. + * **[XrdCl]** Fix segfault in case a user cannot be mapped to a home directory. + * **[XrdCl]** Make sure a socket is always associated with a proper poller + object (not null). + * **[XrdCl]** Fix deadlock in XrdCl::PollerBuiltIn during finalize. + * **[XrdCrypto]** Do not use md5 checksum on OSX platform. + ++ **Miscellaneous** + * **[RPM]** Include xrdacctest in xrootd-server package. + * **[RPM]** Add conditional BuildRequires for ceph >= 11. + * **[RPM]** Use compat-openssl10-devel for fedora>=26. + * **[XrdCl]** Make sure the Log class can be used by any client plugin implementation. + +------------- +Version 4.4.0 +------------- + ++ **New Features** + * **[Server]** Add new [no]rpipa option to xrd.network directive. + * **[Server]** Allow objectid's to be specified in the authorization file. + * **[Server]** Add new logging plugin interface. + * **[Server]** Fixes #345 - add sid to TOD structure (ABI compliant). + * **[Server]** Implement resource selection affinity (primarily for ssi). + * **[XrdCl]** Add Metalink support (xrdcp & API). + * **[XrdCl]** Enable metalink processing on default. + * **[XrdCl]** xrdcp: use cks.type cgi tag to select the checksum type. + * **[XrdCl]** Support local metalink files. + * **[XrdCl]** Add support for GLFN redirector of last resort. + * **[XrdCeph]** Implemented pools of ceph objects. + ++ **Major bug fixes** + * **[Posix]** Remove double unlock of a mutex. + * **[Client]** Serialize security protocol manager to allow MT loads. + * **[Authentication/sss]** Fix dynamic id incompatibility introduced in 4.0. + * **[XtdHttp]** Removed the deprecated cipher SSLv3, in favor of TLS1.2 + * **[XrdCl]** Close file on open timeout. + * **[XrdCl]** Differentiate between a handshake and an xrootd request/response + while processing an incoming/outgoing message. + * **[XrdCl]** Fix dangling pointer issue that occurs while forking. + * **[XrdCl]** Ensure DefaultEnv is finalized after last use of the object. + ++ **Minor bug fixes** + * **[Proxy]** Avoid SEGV when printing memory cache statistics. + * **[Server]** Avoid XrdNetIF static initialization issues. + * **[Server]** Honor DFS setting when forwarding operations. + * **[Server]** Make sure lockfile time is updated in deprecated runmodeold. + * **[Server]** Fixes #344 - squash path before checking for static redirect. + * **[Server]** Free Entity before replacing it from the cache (memleak). + * **[XrdCl]** xrdfs ls does not include opaque info in a listing. + * **[XrdCl]** Eliminate unnecessary write notifications. + * **[XrdCl]** Forward xrd.* parameters from the original to the redirection URL. + * **[XrdCl]** Do not preset CWD in batch mode. + * **[XrdCl]** Be complaint with file URI scheme. + * **[XrdCl]** Fix wrong query string used for opaquefile code. + * **[XrdCl]** Translate XRootD error code to errno before passing to strerror. + * **[XrdCeph]** Fixed thread safety of filedescriptors in the ceph plugin. + * **[XrdCeph]** Protected initialization of ioCtx object and striper objects + by mutex in the ceph plugin. + * **[XrdCeph]** Fixed memory corruption in asynchronous read from ceph. + * **[XrdXml]** Make sure c-string buffes are properly terminated. + * **[XtdHttp]** Don't trim printable characters. + ++ **Miscellaneous** + * **[XrdCl]** Change the way handlers and messages are matched (use maps). + * **[Apps]** Add xrdacctest to the tools set to test access control databases. + * **[Packaging/RPM]** Set max open files limit to 65k for systemd services. + +------------- +Version 4.3.0 +------------- + ++ **New Features** + * Add option to query network configuration via configured interfaces. + * **[Proxy]** Default event loops to 3 and allow it to be set via config. + * **[Server]** Let client inform redirector why it's retrying a lookup + using the triedrc CGI element. + * **[Server]** Add cms.cidtag directive to qualify the global cluster id + (solves dpm problem). + * **[Server]** Make it possible to effeciently query an external database + for file existence via the statlib plug-in (largely for DPM).` + * **[Server]** Allow declaring extra large I/O buffers (mostly for Ceph). + * **[Server]** Allow iovec based data responses (no ABI changes). + * **[Misc]** Add back trace capability to the tool set. + * **[Misc]** Add generalized XML parsing ability. + * **[Misc]** Add metalink parsing for future integration. + * **[XrdCl]** xrdcp add env var to disable recovery + * **[XrdCl]** Add support for multiple event loops. + ++ **Major bug fixes** + * **[Server]** Correct IP address matching between IPv4 and IPv6. Fixes #300. + * **[Server]** Ruggedize cmsd thread synchronization during node deletion. + * **[Server]** Delete extraneous semaphore wait to avoid deadlock (#290). + * **[Server]** Return correct response to a delayed open. + * **[Server]** Fix build of kXR_wait message in case of delayed open. + * **[XrdCl]** Detect whether client is dual stacked based on outgoing + connection in addition to DNS registration. + * **[XrdCl]** Avoid EAGAIN loop. Fixes #303. + * **[XrdCl]** Append opaque info in case we retry at a data server after + being redirected. + * **[XrdCl]** Fix: FileStateHandler::OnOpen seqfaults when both write timeout + and OpenHandler timeout at the same time. + * **[XrdCl]** Avoid SEGV when server fails after it responds waitresp. + * **[XrdCl]** Continue processing remaining files after error occurrence. + * **[XrdCl]** Fix for dangling pointer problem in deep locate, fixes #324 + * **[Misc]** Add possibility to specify disk usage parameters in .. G, T units + using XrdOuca2x::a2sz(). + * **[Python]** Fix lock inversion in python bindings. + * **[Python]** Check if python interpreter is still initialized. + ++ **Minor bug fixes** + * **[All]** Fix numerous issues with space reporting (spaceinfo, query space, + statvfs) such a double counting, scaling, and format issues. + * **[Proxy]** Do not use the ffs code path if nothing is writable. This avoids + initialization failure when the origin is a large WAN cluster. + * **[Server]** Be agnostc NTP defaults when rotating logs (fixes new RH7 defaults). + * **[Server]** Pass correct total data length in iovec to Send(). + * **[Server]** Avoid redirection loop during error recovery in a uniform cluster. + * **[Server]** Make sure N2N gets configured for the cmsd when actually needed. + * **[Server]** Properly handle an inifit NPROC limit. Fixes #288. + * **[Server]** Make sure the cluster ID is always formatted the same way. + * **[Server]** Correctly compute timeout wait. + * **[Server/Logrotate]** Make sure rotating pattern is not expanded in an if statement, fixes #302 + * **[Misc]** Include XrdXmlReader in the spec file. + * **[Misc]** Fix bug in access statistics print. + * **[Misc]** Allow conversion of decimal numbers in XrdOuca2x::a2sz() + * **[XrdCl]** xrdfs prepare has to be provided with a filename, fixes #309 + * **[XrdCl]** Make sure recursive copy is disallowed only for checksum with user provided value, fixes #304 + * **[XrdCl]** Use the same timeout value for all close operations in xrdcp with TPC enabled. + * **[XrdCeph]** Fixed race condition in multistream access to files fo CEPH + ++ **Miscellaneous** + * **[Server]** Prevent cmsd reconnect storm when things get way slow. + * **[Server]** Changes to allow for Solaris compilation. + * **[Server]** Changes to allow for OSX compilation. + * **[Server]** Detect cyclic DNS host registration when processing '+' hosts. + * **[Server]** Display manager IP addresses during '+' host resolution. + * **[Util]** Avoid compiler warning about unsafe mktemp. + * **[App]** Do not report expected errors as errors. + * **[App]** Always show any unusual node status in the display. + * **[Client/Python]** Add MANIFEST.in for python bindings. + * **[XrdFileCache]** Implement blacklisting in a FileCache decision plugin. + * **[XrdFileCache]** Make sure requested offset is reasonable. + * **[XrdFileCache]** Return -1 and set errno when bad offset is passed in. + * **[XrdFileCache]** Only generate error for negative offsets, as per posix. + * **[XrdFileCache]** Add startup protection for ReadV, too. It was already there for Read. + * **[XrdFileCache]** Fix bug in cache scanning; simplify deletion loop. + * **[XrdFileCache]** Use bytes to calculate how many files to purge, not blocks; + subtract actual size of the file, not the length of it returned by stat. + * **[XrdFileCache]** In cache purge, use stat.mtime of cinfo file if last access time can not + be determined from contents of cinfo file. + * **[XrdFileCache]** Fix argument type from int to long long (was n_blocks, is size_in_bytes now). + * **[XrdCl/XrdSys]** Use custom semaphores only for glibc<2.21. + * **[XrdCl]** Remove libevent-based poller implementaion. + * **[XrdCl]** Report reason for reselection via triedrc CGI element. + * **[XrdClient]** Changes to allow for Fedora rawhide C++11 compilation. + * **[XrdCeph]** Fixed XrdCeph compilation for C++11 enabled compilers + * **[XrdCeph/CMake]** Fix for undefined symbols (link XrdUtils). + +------------- +Version 4.2.3 +------------- + ++ **Major bug fixes** + * **[Server]** Avoid SEGV if cmsd login fails very early. + * **[Server]** Avoid SEGV when an excessively long readv vector is presented. + * **[Server]** Rationalize non-specfic locate requests. + * **[XrdCl]** Process waitresp synchronously via Ignore return to avoid SEGV. + * **[XrdCl]** Avoid memory leak when a handler returns Ignore for a taken message. + * **[XrdCl]** Fix "tried" logic by forwarding the errNo + +------------- +Version 4.2.2 +------------- + ++ **Major bug fixes** + * **[Proxy]** Protect forwarding proxy server from slow connections. This should + fix most, if not all, SEGV's that the server encountered under heavy load. + * **[Server]** Fixes #248 Prevent infinite loop when shift arg is negative. + * **[Server]** Complain when passed I/O length is negative. + * **[Server]** Avoid execution stall during node logout when the thread limit + has been reached. + * **[Server]** Make sure to capture return code for stat() to prevent random + results. + * **[XrdCl]** Make sure to get filestate lock during timeout processing to + avoid MT intereference and possible random results. + * **[XrdClient]** Restore commented out abort() when an attemp is made to index a + vector outside of its current bounds (avoids random results). + * **[Server/Proxy]** Delay deleting a file object if the close was not successful. + This avoids deleting objects that may have pending activity resulting in an + eventual SEGV. This is a bypass fix to another problem. + ++ **Minor bug fixes** + * **[Server]** Fixes #234 Properly register all components in a mkpath request. + * Correctly handle copying into a non-existent directory when automatic + path creation is enabled. + * **[XrdCl]** xrdfs correctly handles quotations (fixes the problem with ALICE token) + ++ **Miscellaneous** + * Fixes #245 Provide compatibility when cmake version is > 3.0. + * Use atomics to manipulate unlocked variable pollNum. + * Bugfix: release lock when a file is closed before the prefetch thread is started. + Observed with xrdcp ran without -f option and an existing local file. Fixes #239. + * Protect from reads exceeding file size. Fixes #249. + * Release Stream lock before invoking callbacks. Fixes #216 + * TPC: Fix deadlock in case of error in the TPC authentication + * Increase max size of write to disk queues. + * Fix bug in endswith. Fixes #260 + * XrdCeph : fixed problem with files bigger than 2GB for synchronous writes + * **[XrdCl]** Change message loglevel from Error to Debug. Fixes #246. + * **[XrdCl]** Fix race condition in PostMaster initialization + * **[XrdCl]** Provide atomicity for PostMaster value using built-in functions + * **[XrdFileCache]** fixed deadlock on immediate file close (e.g. xrdcp to non-writable output) + * **[XrdFileCache]** fixed errors on some posix operations using virtual mount + +------------- +Version 4.2.1 +------------- + ++ **Miscellaneous** + * **[Client/Cl]** Make sure kXR_mkpath is set for classic copy jobs when the + destination is xrootd (backward compatibility fix). + +------------- +Version 4.2.0 +------------- + ++ **New Features** + * **[Client/Python]** Integrate xrootd-python into the main package. + * **[Server]** Include a Ceph OSS plug-ing. + * **[Server]** Implement throttling. + * **[Server]** Detect redirect loops using "tried" token. + * **[Server]** Implement the "cid" option for config query to display the + unique cluster ID. + * **[Server]** Allow suspending and enabling remote debugging without a + restart. + * **[Server]** Implement black/whitelist with optional redirection. + * **[Server/Proxy]** Add the xrdpfc_print tool to print the caching + proxy metadata. + * **[Server/PlugIns]** Provide a mechanism to pass command line arguments + to plug-ins. + * **[Server/PlugIns]** Provide access to the native and the active extended + attribute implementation. ++ **Major bug fixes** + * **[All]** Fix various memory access issues. + * **[Server]** Fix various IPv4/IPv6 compatibility issues. + * **[Server]** Avoid disabling of frm notifications due to plug-in + initialization issues. + * **[Server/Proxy]** Avoid holding a global lock when opening/closing files + to solve timeout issues. + * **[Security/GSI]** Fix reloading of CA and CRLs. ++ **Minor bug fixrs** + * **[Server/HTTP]** Fix issues related to invalid chunk sizes. + * **[Server/Proxy]** Various logic and permission processing fixes. ++ **Miscellaneous** + * **[Client/Cl]** Make the compiler issue warnings when the return codes + from the File and FileSystem methods are unchecked. (issue #188) + * **[RPM]** Disable building of the compat package by default. + * **[Server/Proxy]** Avoid serializing stat() via the proxy to improve + performance. + * **[Tests]** Factor out the common testing code from the client tests so + that it can be re-used. + +------------- +Version 4.1.2 +------------- + ++ **Major bug fixes** + * **[Utils]** Don't confuse -I and --tpc while parsing commandline parameters + for xrdcp. (issue #213) + * **[Server]** Fix various IPv4/IPv6 issues. (issues #164, #227) ++ **Minor bug fixes** + * **[Client/Cl]** Print mtime when doing xrdfs stat. + * **[All]** Fix some memory access issues. (issues #186, #197, #205) + * **[Server]** Recreate logfile fifo if it already exists and is a file. + (issue #183) + * **[Server]** Properly reset suspend state when reconnecting cmsd. + (issue #218) + * **[Server]** Avoid disabling async I/O when using an oss plugin that does + not implement file compression. (issue #219) + * **[Server]** Do not debit space when relocating a file within the same + partition. + * **[Server]** Fix meta-manager port directive ordering. + * **[Server/Logrotate]** Do not print anything to stdout to avoid making cron + send emails to admins. (issue #221) ++ **Miscellaneous** + * **[Server/Proxy]** Disable POSC processing when a proxy plugin is loaded. + +------------- +Version 4.1.1 +------------- + ++ **Major bug fixes** + * **[RPM]** Remove the library patch from xrootd-config to enable multiarch + installations. + * **[RPM]** Move the user creation scriptlets to xrootd-server where they + belong. (issue #179) + * **[Server]** Fix PowerPC compilation. (issue #177) + * **[Server]** Avoid the pitfalls of infinite nproc hard limit in Linux. + * **[Server]** Correct flag definition to include cms plugin loading. (issue #176) ++ **Miscellaneous** + * **[Man]** Update documentation. + * **[Client/Cl]** Set the multi-protocol ability basing on an environment + variable. + +------------- +Version 4.1.0 +------------- + ++ **New Features** + * **[Everyting]** Implement dynamic plugin shared library filename versioning + to allow multiple major versions to co-exist. + * **[Server]** Compelete IPv6/IPv6 and public/private network routing. + * **[Server]** Allow the checksum manager to use OSS layer to access data. + (issue #140) + * **[Server]** Allow the definition of subordinate clusters. + * **[Server]** Support multiple checksum types. Client can select non-default + checksum using the "cks.type=" cgi element. + * **[Server]** Provide plugin interface for handling extended attributes. + * **[Server]** Add options to xrd.network to control keepalive. + * **[Server]** Control core file generation via xrd.sched core directive. + * **[Server]** Add pss.permit directive to restrict outbound connections for + forwarding proxies. + * **[Server]** Allow xrootd to handle objectid names as exports. + * **[Server]** Install and package the cluster mapping utility: xrdmapc. + * **[Server]** Allow the specification of xrootd.seclib default. + * **[Server]** Pass along XRD_MONINFO setting and application name to + monitoring. + * **[Server/Proxy]** Implement a forwarding proxy option. + * **[Server/Proxy]** New configuration of XrdFileCache using 'pfc.' prefix. + * **[Sever/HTTP]** Support gridmap parsing. + * **[Client/Cl]** Inform the server about availability of local IP address + types (IPv6/IPv4, public/private) to in order to facilitate redirections. + * **[Client/Cl]** Make the client send kXR_endsess request when recovering + broken connection - avoids 'file already open' errors. + * **[Client/Cl]** Implement TCP keep-alive support. + * **[Client/Cl/xrdcp]** Optimize xrdcp uploads by compensating for latency. + * **[Client/Cl/xrdcp]** Make it possible for xrdcp to run multiple transfers + in parallel using the '--parallel' option. + * **[Client/Cl/xrdcp]** Make it possible for xrdcp to concatenate multiple + sources to stdout. + * **[Client/Cl/xrdfs]** Add xrdfs locate -i option to ignore network + dependencies (IPv6/IPv4). + * **[Security]** Add new security framework loader to allow external pacakges + that linked against security plugins to dynamically load them instead. + * **[Security/sss]** Allow forwardable sss tokens when ecrypted with a + forwarding key as defined by the xrdsssadmin command. + * **[Plugins]** Implement generic matching rules to version check 3rd party + plug-ins. + * **[Packaging/RPM]** Add SystemD configuration files for RHEL7. + * **[Packaging/RPM]** Introduce compat RPM packaging providing xrootd 3.3.6 + deamons and libraries with the ability to switch between desired versions + using the sysconfig file. + * **[Packaging/RPM]** The RPM naming has been switched back to xrootd + (from xrootd4). + * **[Utils]** Add xrootd-config utility. + ++ **Major bug fixes** + * **[Server/HTTP]** Make it possible to handle files larger than 2GB. + * **[Server]** Prevent blacklisting of all connctions when role is supervisor. + * **[Server]** Fix bug in handling cms.dfs redirect verify that would keep + the client is an infinite wait loop. This also affected locate requests + regardless of what the redirect option was set to. + * **[Server/Proxy]** Avoid SEGV when no environment has been passed in the + proxy server. + ++ **Minor bug fixes** + * **[C++ API]** Provide complete portability and correct behaviour across + platforms with and without Atomics. This patch does not change any ABI's. + * **[Server]** Do not set *TCP_NODELAY* for unix domain sockets as this + issues a nasty error message. + * **[Server]** Allow cms.dfs mdhold argument to be 0 as documented. + * **[Server/Plugins]** Add missing initializer to the LocInfo structure. + * **[Server/Plugins]** Correct header define gaurd in XrdSfsFlags.hh. + * **[Server/Proxy]** Fully support extended file system features and pass + those features through a proxy server. (issue #115) + * **[Client/Cl]** Remove duplicates from the HostList. + * **[Client/Cl]** Fix minor atomicity issues (C++11). + ++ **Miscellaneous** + * **[Server]** Actually remove xmi plugin handling as xmilib is no longer + supported. + * **[Server]** Make sure to always passhrough CGI information. + * **[Server]** Honor network routing when creating the client's i/f + selection mask. + * **[Server]** Efficiently handle replicated subscribers (i.e. managers). + * **[Server/HTTP]** Remove useless loading the security framework. + * **[Server/Security]** Add new NetSecurity::Authorize() method that accepts + text. + * **[Server/Proxy]** Properly support proxying objectids. + * **[Server/Proxy]** Clean-ups in the caching proxy. + +------------- +Version 4.0.4 +------------- + +* **Major bug fixes** + * **[Client/Cl]** Properly allocate buffers for error messages. (issue #136) + * **[Client/Cl]** Check if there is enough data before unmarshalling. + * **[Client/Cl]** Fix a memory leak in MessageUtils::WaitForResponse + affecting all synchronous calls. + * **[Client/Cl]** Prevent a segfault in the destructor when called after + the libXrdCl library has been finalized by the linker - ROOT garbage + collection. https://github.com/cms-externals/xrootd/pull/1 + * **[Client/Posix]** Fix broken readdir_r() and readdir_r64() functions. + * **[Server]** Use correct flag when adding a cluster. The bug made it + impossible to have more than one supervisor node. + * **[Server/Logrotate]** Prevent stack corruption by correctly sizing the + timestamp buffer. + ++ **Minor bug fixes** + * **[Client/Cl]** Properly check if a recursive copy was requested to avoid + unnecessarily stating the source. + * **[Client/Cl]** Avoid inserting duplicate entries to HostList when retrying + at the same server. + * **[Client/Cl]** Normalize (trim leading zeroes) before comparing adler and + crc checksums. (issue #139) + * **[Client/Posix]** Prevent mkdir failure in a clustered environment by + creating the full directory path by default. + * **[Client/Possix]** Fix a memory leak when doing deep locate. + * **[Server/Logrotate]** Use expect to send a ping to pipes. This prevents + logrotate from hanging when nobody is listening at the other end of the + pipe. + * **[Authentication/Client]** Pass the external environment to the protocol + manager. (issue #133) + * **[Authentication/sss]** Fix a memory leak. + * **[Utils]** Avoid SEGV when assigning a unix domain address to a + NetAddrInfo object previously used to hold a TCP domain address. + * **[Server/cmsd]** Use the same write selection rules for dfs and non-dfs + environments. + ++ **Miscellaneous** + * **[Server/Logrotate]** Prevent the default configuration from sending + emails to admins and from creating a new log after the old one has + been rotated. (issue #135) + * **[Server/SELinux]** Using expect in logrotate requires the logrotate_t + context to have access to pseudoterminals and tmpfs as well as stating + fifos + * **[Client/Commandline Parser]** Allow local to local copy in new xrdcp but + not in the old one. + * **[Client/Cl]** Discard a whole cluster on failure in federation context. + (issue #132) + +------------- +Version 4.0.3 +------------- + ++ **Major bug fixes** + * **[Server]** Make sure the network routing is honored in all cases. This + fixes problems encountered by sites whose clients use a private IP address + to connect to a redirector's public IP address. (issue #130) + +------------- +Version 4.0.2 +------------- + ++ **Minor bug fixes** + * **[Client/Cl]** Handle all non-NULL-terminated error responses correctly. + * **[Client/Cl]** Release old auth buffer when reconnecting after TTL + expiration. + ++ **Miscellaneous** + * **[Client/Cl]** Retry after an incomplete local write. This produces + clearer error messages. Ie: "Run: [ERROR] OS Error: No space left on + device" instead of: "Run: [ERROR] OS Error: Operation now in progress". + * **[Client/Cl]** Don't force a server to issue a short read when fetching + last data chunk. This works around issues for proxied FAX sites. + +------------- +Version 4.0.1 +------------- + ++ **Major bug fixes** + * **[Server]** Prohibit accessing memory via /proc using digFS. + ++ **Minor bug fixes** + * **[Server]** Prevent over-scan of the xrd.network routes option which may cause + a config file error message and initialization failure. + * **[Server]** Fixes to make things compile on ix86, arm and ppc64. + * **[Server]** Correct protocol name supplied to monitoring for userid. + * **[Server/Proxy]** Various minor fixes to caching proxy. + * **[Security]** Check the length before looking inside a SUT buffer. (issue #126) + * **[Client/Cl]** Check for copy source and target validity to display proper error + messages. + * **[Client/Cl]** Return default plug-in factory for an empty URL. (issue #120) + * **[Client/Posix]** Provide full error mapping for POSIX interface. + * **[All]** Remove some unnecessary commas and semicolons. (issue #121) + ++ **Miscellaneous** + * **[Server]** Pass client login information to monitoring. + * **[Client/Cl]** Make xrdfs locate -h synonymous to locate -m. + * **[Client/Cl]** Add -i option to xrdfs locate setting the Force flag. + * **[Docs]** Various documentation updates. + +------------- +Version 4.0.0 +------------- + ++ **New Features** + * Supprt IPv6. Please read docs/README_IPV4_To_IPV6 for details. + * Introduce the XrdFileCache library - a proxy server plugin used for caching + of data into local files. + * Beta support HTTP(S). + * Provide protocol bridge to let other protocols use xrootd back-end plugins. + * Provide full support for public/private IP networks. + * Allow remote debugging via the xrootd.diglib directive. + * Provide a mechanism to manually control log file rotation via -k and add + support for logrotate. + * Add -z option to enable high recision log file timestamps. + * Define a new plug-in to allow replacement of the stat() function when + used to determine exported file characteristics. This plug-in is meant + to be used by tape-backed file systems that identify offline files in + odd ways (e.g. GPFS). Patch assumes XRDROLE patch below. + * Implement full readv-passthru for enhanced performance. + * Add a disconnect record to the f-stream. + * xrdcp is now the same as xrdcopy, and old xrdcp is now xrdcp-old + * Make clients configurable via /etc/xrootd/client.conf and + ~/.xrootd/client.conf + * Implement a plug-in system for client's File and FileSystem queries. + * Make it possible for 'xrdfs stat' to query for combination of flags. + * Make third party copies cancellable. + * Implement xrdfs spaceinfo, cat and tail commands + * Terminate iddle connections after a timeout and treat timeouts on streams + that should be active (because of outstanding requests with no delay times) + as errors. + * Implement XrdCl::File::Visa and XrdCl::File::Fcntl. + * Support for full URL redirects. + * File and Filesystem objects implement property system to pass custom + information to and from them (including plug-ins) without breaking + ABI. + * Add --dynamic-src to xrdcp options to allow dynamic file copying. + * Implement the directory listing in bulk. + * Enable locate to return host names not just IP addreses. + * Implement node blacklisting for the cmsd (see cms.blacklist directive). + * Add mv command to frm_admin. + * Allow query of current role and dynamic cms state via kXR_query. + * Implement query config chksum to return supported chksum name. + * Add version as a variable that can be returned by kXR_Qconfig. + * Add sitename as an argument to kXR_Query+kXR_Qconfig. + * Provide disconnect notifiation to underlying file system. + * Provide the filesystem plugin a way of creating a session storage area. + * Add flag to indicates a secondary copy of a file exists. + * Allow testing for undefined set/env vars via if-else-fi. + * Add '-L' flag to the xrootd command to allow loading a protocol library + * Add flag to indicates a secondary copy of a file exists + + ++ **Bug fixes** + * Fix various dead locks in the IOEvents poller. + * Implement LinuxSemaphore class in order to replace buggy POSIX semaphores + on Linux. + * Honor the cmsd.dfs directive for locate request to avoid placing a + file in ENOENT status. + * Make sure that the old client runs only in IPv4 mode as mixing modes does + not work for a variety of reasons. + * Accept old-style as well as new-style IPv6 addresses in the sss + protocol. This allows the new client to use this protocol after + it implemented IPv6 support. + * Prevent invalid mutex operations in auto-termination routine. + * Resolve naming conflicts within the frm that resulted from the + statlib plugin implementation. + * Do not rely in file locking to serialize inter-thread access. This + fixes the prolem of usage file drift. + * Fix various parse context issues in copy config with --recursive. + * Recognize object deletion in the error handling path. + * Use atomic FD_CLOEXEC where available to prevent FD leaks. + * Squelch casting complaints from C++11. + * Make sure to return all nodes in a star locate request. + * Always load protocols in the specified order. + * Fix xrootdfs wcache crashing issue when using virtual file descriptor. + * Fix selection of a server when a DNS entry resolves to more than one. + * Correct pthread_cond_timedwait() time calculation and error handling. + * Fix null insertion of hostname in error message when open fails. + * Fix issues with extensions in GSI proxies + * Fix problem with creation of the forwarded KRB5 ticket + * Correctly handle reading of a partial readv headers (issue #45) + * Make sure to propagate username and password when redirecting + * Honor request timeouts when processing kXR_wait + ++ **Miscellaneous** + * XrdClient and associated commandline utilities are now obsoleted. + * Propagate info about partial success from deeplocate to dirlist. + * Remove perl interface. + * Send timezone, country code and application name while logging in. + * Change interfaces to copy process to use property system (allows for + adding features without breaking the ABI). + * Final change to f-stream monitoring. Replace standard deviation + (sdv) calc with reporting sum of squares (ssq) counts. + * Make public headers compile cleanly with -Wall -Wextra -Werror. + * Support passing cert, key paths via URLs + * Allow testing of undefined set/env vars via if-else-fi + * Pass user environment settings settings in the login CGI + * Use DNS names instead of addresses for kXR_locate when listing + +------------- +Version 3.3.6 +------------- + ++ **Minor bug fixes** + * Prevent SEGV when error occurs during stat (issue #70) + * Prevent SEGV in redirect monitoring (issue #61) + * Set reasonable linux thread limit and warn it we cannot do so. + ++ **Miscellaneous** + * Support for C++11 (narrowing fixes, unique_ptr vs. auto_ptr) + * Support for CMake 2.8.12 (interface link libraries) + +------------- +Version 3.3.5 +------------- + ++ **Minor bug fixes** + * Fix minor Coverity issues in XrdCl + * Fix a rarely occuring segfault when forking XrdCl under heavy load + * Fix various issues related to group name retrieval (issues #51, #52, #53) + ++ **Miscellaneous** + * Make XrdSys/XrdSysIOEvents.hh private - could not have been used anyways + * Add a sysconfig template to preload custom allocators in order to fix + memory issues on RHEL6 + * Allow up to 63 characters for a site name + +------------- +Version 3.3.4 +------------- + ++ **Major bug fixes** + * Serialize sss authentication client initialization to prevent race + conditions + * Actually cancel the JobManager threads while stopping it - this affected + client side fork handling (new client) + * Restore original meaning of -adler and -md5 to xrdcp (issue #44) + ++ **Minor bug fixes** + * Append CGI info when retrying at a server that handshaked but never + respnded to the request (xrdcp) + * Do socket accepts asynchronously to prevent DNS resolution from blocking + accepts (issue #33) + * Warn about incomplete dirlist responses (xrdfs) + * Cast the utilization statistics to uint16_t before printing to + print actual numbers instead of letters corresponding to ASCII codes + (xrdfs) + ++ **Miscellaneous** + * When calling File::Stat use file handle instead of path + * Improve handling of malformed kXR_readv responses (new client) + * Explain parameters of xrdcopy --tpc (documentation, issue #46) + +------------- +Version 3.3.3 +------------- + ++ **Major bug fixes** + * Prevent SEGV's when reusing a recycled protocol object under certain + conditions (xrootd server) + * Prevent SEGV when using the -DS/-DI commandline parameters in xrdcp + (issue #13) + * Prevent integer overflow when calculating client recovery windows + * Make sure the new client tries all available authentication protocols + when connecting to a security enabled server (issue #14) + * Detect buffer size mis-matches when server returned valid response with + invalid size (xrdcopy) + * Recognize /dev/null and /dev/zero as special files when using copy + commands + ++ **Minor bug fixes** + * Prevent the new client deadlock on Solaris and MacOS when using + the built-in poller and connecting to localhost (issue #5) + * Compensate for ROOT garbage colletion issues when calling the + new client code + * Avoid favoring socket writes when using new client with the built-in + poller + * Strip off opaque information from dest filename when copying to local + filesystem using xrdcp (issue #21) + * Fix setting client timeout resolution while connecting to a server + ++ **Miscellaneous** + * Change the RPM package layout to match the one used by EPEL (issue #12) + * Drop the daemon user RPMs + * Allow new client connection parameters to be tweaked by connection URL CGI + * Make the built-in poller default again in the new client - after resolving + issue #5 + +------------- +Version 3.3.2 +------------- ++ **Major bug fixes** + * Fix the opaque information setting in xrdcp using -OD (issue #1) + * Fix compilation on Solaris 11 (issue #7) + * Fix issues with semaphore locking during thread cancellation on + MaxOSX (issue #10) + * Solve locking problems in the built-in poller (issue #4) + * Solve performance issues in the new client. Note: this actually + changes some low level public interfaces, so the soname of + libXrdCl.so has been bumped to libXrdCl.so.1. The xrootd.org + RPMs also provide the old libXrdCl.so.0 in order to preserve the + binary compatibility with the clients linked against it. + +------------- +Version 3.3.1 +------------- ++ **Major bug fixes** + * Correct XrdClient ABI incompatibility issue introduced in 3.3.0 + * Install additional private headers + +------------- +Version 3.3.0 +------------- ++ **New Features** + * Stable interfaces immutable in minor releases (except XrdCl). Only + public header files are installed in the usual include directory. + In order to ease up transition of some clients some of the private + include files are also installed in private subdirectory. + * New asynchronous and thread-safe client libraries and executables + (XrdCl). The ABI compatibility is not guaranteed until 4.0.0. + * Build the xrootd protocol plugin as a shared library. + * Add the altds directive to allow pairing a cmsd with an alternate data + server. + * Differentiate between packed and unpacked readv monitoring records. + * Allow plugin libraries to be preloaded. This feature is only meant + for MacOS. + * Include optional site name in summary monitoring records. + * Include optional site name in server identification record if the + site name was specified on the command line (-S) or via config + file (all.sitename directive). + * Define a standard supported mechanism to obtain the default storage + system object. + * Provide an ABI-compatible interface to obtain a default cmsd client + object. This patch does not change the definition of the XrdCmsClient + object and is ABI compatible with all previous releases (DPM support). + * Allow multiple comma separated protocols in XrdSecPROTOCOL client-side + envar. This allows the client to select 1 of n protocols. + * Implement new "f" stream monitoring. + * Add new summary counters for readv and readv segs. + * Add boiler plate comments indicating the all software is licensed under + LGPL. No functional source code was modified by this patch. + * Add GPL and LGPL license text. + * Liberlize locking structure to prevent lock inversion relative to + external locks. + * Provide libevent replacement for Linux (epoll), Solaris (poll_create), + and others (poll). Note: versions of Solaris less than 10 are no longer + supported and they will no longer compile with this update! + * Provide a libevent type replacement package. + * Allow tracker files (e.g. ".fail") to be placed in a shadow directory. + This is controlled by the new fdir option on the oss.xfr directive. + * Allow meta-files (i.e. .fail file) to be relocated to a shadow directory + using the oss.xfr directive. This avoids polluting the exported name + space when an frm transfer operation fails. + * Create a general place for platform dependent utility methods. + * Add third party copy statistics to the summary record. + * zlib compatible checksum plugin + ++ **Major bug fixes** + * Serialize access to cache entries to prevent SEGV's. + * Fix the fast response queue so that it doesn't run out of response + slots causing a big performance penalty. This is a high priority fix. + * Properly disarm the mutex helper when the mustex object is deleted. + * Use correct variable to hold osslib parameters. This patch fixes commit + 2e27f87a (version checking) and without this patch makes it impossible + to load an oss plug-in. + * Properly check for errors when client read returns 0 and reflect true + status. This only affects the Posix client interface. + * Remove redundant flag indicating a running poller. This may cause the + poller to never be woken up when a timeout value changes. + * Fix tag in ofs statistics. It is improperly terminated and may + cause certain xml parsers to fail; rendering monitoring useless. + * Undo the side-effect of commit ff8bdbd6 that prevented the frm from + sending stage notifications to xrootd; causing opens and xrdstagetool + to hang with dynamic staging enabled. + * Make sure the id buffer is large enough to hold all id combinations. + * Avoid deadlock when closing a Posix File with an active preread. + * For concurrent queries for the same file allow servers to respond to the + query and only redirect clients to a stageable server if the file is not found. + ++ **Minor bug fixes** + * Add EPOLLRDHUP to avoid leaving sockets in CLOSE_WAIT with a one-shot + poll framework. + * Fully integrate checksum processing into a manager node. When configured, + it does not matter whether a client directs a checksum request to a manager + or a server. This also fixes bug report #93388. + * Make sure to reflect proper range of errors during read/write operations. + This also provides filesystem plugins full range of allowed return codes. + * Initialize the rMon toggle to avoid valgrind complaint. + * Fix minor issues reported by Coverity. + * Make sure opendir() returns a null pointer when the directory doesn't + exist. + * Make sure that XrootdFS returns ENOENT when opendir() returns a null. + * Make sure to use correct time to set mtime/atime after a physical reloc. + * Prevent hangs when doing exterme copy from server to server. + * Fix the -force option to really work for the mark subcommand. + * Pass through error code returned by the N2N plug-in. This only affects + the proxy server and caused feature interference. + * Automatically exclude originating server/cluster on an enoent static + redirect. + * Correct typos XRDPSOIX envars should really be named XRDPOSIX. + ++ **Miscellaneous** + * Remove superfluous includes or other move includes to eliminate + unnecessary dependencies in ".hh" files. This patch is required + to create an EPEL conformable include directory. + * Add port to prepare request struct as documented in 2.9.9. + * Add pathid to readv request struct as documented in 2.9.9. + +------------- +Version 3.2.6 +------------- ++ **Major bug fixes** + * GSI authentication: fix possible race condition while re-loading CA + certificates; fix also related memory leaks. + * GSI authentication: make sure the CA cache is not initialized twice (e.g. + server and client inside there), and that the cache entry pointers are + always initialized. + * Crypto OpenSSL modules: use more appropriate way to read the RSA complete key, + solving various issues for RH6 and derivations, included SL(C)6. + * Make sure redirect opaque information is passed along for all filename + based requests. This is required for DPM and EOS N2N services to work + in all cases (most importantly, stat). + * Make sure buffer ends with null byte before read suspension. This only + occurs on very heavily loaded connections. + * Fix the fast response queue so that it doesn't run out of response + slots causing a big performance penalty. This is a high priority fix. + ++ **Minor bug fixes** + * Properly detect external process failure and report correct error status + to a client. This also fixes bug report #91141. + * [XRootDPosix] Make sure to use a supplied cache even when no cache + directives given. + * Make sure to return a usable path string via XrdOucCacheIO::Path(). + * Actually support 4 different redirect destinations. + ++ **Miscellaneous** + * Transparent support for new name hashing algorithm adopted in openssl + 1.0.0x (GSI authentication protocol) + * Verbosity levels revised for GSI and PWD authentication protocols. + * Notification of initialization option for GSI and PWD authentication + protocols. + * Do not repudiate file existence on an "cancelled" error during open. + this patch addresses overloaded dCache pool nodes. + +------------- +Version 3.2.5 +------------- ++ **Major bug fixes** + * Make realoading gridmapfile atomic (protect from segfault) + * Propagate to clients proper range of errors during read/write operations + * Fix segfault when handling writes to files that have not been opened + +------------- +Version 3.2.4 +------------- ++ **Major bug fixes** + * Work around a dead-lock in the client fork handlers. + +------------- +Version 3.2.3 +------------- ++ **Major bug fixes** + * Make sure read statistics are updated for sendfile() and mmap I/O. + * Make sure refresh thread is dead before deleting deleting the keytab to + avoid SEGV's. + * Add missing include for compiling with gcc-4.7 (from Sebastien Binet). + This patch is required for successful compilation. + * Avoid segfaults when limiting number of redirections caused by failed + authorization. + * Avoid deadlock in the client fork handlers. + ++ **Minor bug fixes** + * Correct monitor initialization test to start monitor under all configs. + * Fix a memory leak in the client handshake algorithm. + ++ **Miscellaneous** + * Make RHEL6-created SRPMs buildable on RHEL5 by forcing RPM to use MD5 + digests. + * Fuse: Use default TTL values for data server connection and load + balance server connection. + +------------- +Version 3.2.2 +------------- ++ **Major bug fixes** + * Correct test whether or not to initialize redirect monitoring. The old + code never initialized it this disabling redirect monitoring. + * Backport frm notification fix that stalled stage-in requests from commit + 69e38cfd6b8bb024dd34f8eb28a666fbf97f346b + * Prevent SEGV when xrd.monitor rbuff value not specified + * Prevent xrdcp hangs when doing exterme copy from server to server. + * In case of 'limited proxy' look for VOMS attributes also in the parent + proxy. + * Correct log processing for sites that use the root directory as the + stomping ground for newly created files. + +------------- +Version 3.2.1 +------------- ++ **Major bug fixes** + * Don't build sendfile support on MacOSX because it doesn't work + * Prevent double-free abort when more than 16 files have been opened by a + client and the client terminates the session without closing the 17th one. + +------------- +Version 3.2.0 +------------- ++ **New Features** + * Retool the XrdOucCache object so that cache implementations can be + implemented as plugins. + * Add FSize method to the XrdOucCacheIO object to ease implementation + of disk caches containing partial files. + * Add the pss.cachelib directive to specify a cache plugin. + * Implement ultralow overhead redirect monitoring. + WARNING: ofs plugin writers will need to recompile their plugin interface + to be fully compatible with this commit due to additional + information passed to the ofs object "new" methods. + * Allow the XrdCmsClient interface (a.k.a Finder) to be a plug-in. + * Add ofs.cmslib directive to specify the XrdCmsClient plug-in. + * Add new class, XrdOucCallBack, to simplify using callbacks in the + XrdCmsClient plug-in. + * Define the frm.all.monitor directive to enable migration, purging, and + staging monitoring. This was originally part of xrootd.monitor but that + just was odd. Note that the stage, purge, migr events are no longer + accepted on the xrootd.monitor directive. + * Collapse he staging (s) and migration (m) records into a single transfer + (x) record. While not compatible, the previous implementation was new + code and no one actually was capturing these records. + * Implement a server identification record (=) that unquely identifies each + server. The record can be sent periodically and can be used as a heartbeat. + * Add -y option to xrdcp to limit number of extreme copy sources. + * Uniformly pass the execution environment to all oss and cms client + methods. This is largely for DPM support. + WARNING: While this update is binary backwad compatible to existing oss + plug-ins it is not source compatible. Plug-in writers will need + to modify their oss methods to successfully compile. + * Allow an automatic redirect when a file operation ends with ENOENT. + Allow redirects for chsum and trunc operations. + Both of the above are controlled via the xrootd.redirect directive. + * Report the timezone when connecting to a [meta]manager. + * Allow configuration of staging, migration, and purging events. + * Allow transfer script to inject information into the monitoring stream. + * Report number of attempted login, authentication failures, successful + authenticated and unauthenticated logins in the summary statistics. + * Indicate whether a disconnect was forced and whether it was a parallel + path (as opposed to a control path) in the monitoring record. + ++ **Major bug fixes** + * Provide compatibility for sprintf() implementations that check output + buffer length. This currently only affects gentoo and Ubuntu Linux. + We place it in the "major" section as it causes run-time errors there. + * Reinsert buffer size calculation that was mistakenly deleted. + This eventually causes a SEGV when detailed monitoring is enabled. + * Remove improper initialization that may cause a SEGV in the checksum + manager. + * Add missing initializer without which we will get a SEGV. This is a fix + for the just added monitoring code. + * Remove regressions that prevent a proxy cluster from being fully + configured. + ++ **Minor bug fixes** + * Correct debug message frequency that caused people to think some file + system partitions were being ignored. + * Correct pthread Num() to return thread-specific numbers. + * Make sure the sendfile interrupt counter is initialized to zero. + * Make sure to honor absolute cms.space values when percentage not + specified. + * Prevent double user map record when monitoring when auth is configured + but not actually monitored. + * Take timezone changes into account when waiting for midnight. This solves + the log rolling problem when changing between DST and standard time. + * Make sure to cut close records for open files during a forced disconnect + when monitoring file information. + * Do not create meta-files or update extended attributes when placing a + file into read-only space. + ++ **Miscellaneous** + * Bonjour code dropped + * Complete implementation of the fstat() version of stat(). + * Consistently pass the enviroment to the cms client enterface. + * Make return codes consistent between synchronous & async XrdCmsClient + returns. + * Document the XrdCmsClient interface in the header file. + * Cut close monitor records before cutting the disconnect record. + * Make frm_purged and frm_xfrd use sparate log files. + +------------- +Version 3.1.1 +------------- + ++ **New Features** + * Compile on Solaris 11 + * Add support for sending DN with monitoring information + * Add possibility to switch off automatic download of CRL from the web; + default is OFF; to enable it multiply by 10 the relevant CRL options + (i.e. 12 and 13 are like 2 and 3 but trying download if the file is not + found). + * Add refresh frequency time for CRL's; default 1 day . + ++ **Major bug fixes** + * Fix various client threading issues. + * [bug #87880] Properly unpack the incoming vector read data. + * Rework the handshake when making a parallel connection. Previous method + caused a deadlock when parallel connections were requested (e.g. xrdcp). + * Add HAVE_SENDFILE definition to cmake config. All post-cmake version of + xrootd until now have disabled use of sendfile() with resulting poor + performance. This fix corrects this. + * Don't force libXrdPss.so to be loaded for proxy managers. + * Fix various CMake issues: disable library inheritance, fix underlinking + problems, make sure libcom_err is present when building kerberos. + * Replace non-reentrant versions of getpwxxx and getgrxxx with reentrant + versions. This should prevent spurious uid/gid translations. + * Fix RedHat bug #673069: Missing header files required by DPM + * Don't ignore errors returned by kXR_close + * Init scripts: don't change the ownership of the sysconfig files + preventing the xrootd user from executing arbitrary code as root + ++ **Minor bug fixes** + * Add 'k' to the option list. It was wrongly deleted in the last option + refalgamization. + * Fix a typo in the specfile causing problems with multithreaded + compilation. + * Initialize xattr variable name so that xrdadler32 can fetch previous + checksum. The error caused xrdadler32 to always recompute the checksum. + * Make sure that monitor write length is really negative. + * Add the oss.asize hint to the destination URL in all possible cases. + * Properly print adler32 checksum in xrdcp. + * When the server certificate is expired, try to renew from the same path + before failing. + * Get the signing certificate for the CRL from its issuer hash, which can be + different from the CA hash. + * Add check for the format of the downloaded CRLs: DER or PEM + * Solaris init script: switch to xrootd user when invoked as root + * RHEL init scripts: always create /var/run/xrootd to handle /var/run + being mounted as tmpfs + ++ **Miscellaneous** + * Relax requirements on the permission mode of the x509 key files + * Disable client redirections reports to the console. + * Stop doing XrdFfsPosix_statall() if task queue is long. + * Get rid of compiler warnings + * Improve some log messages + * At server startup, only initialize the CA (and CRL, if required) for the + authority issuing the server certificate; additional CA's are initialized + only if needed. + +------------- +Version 3.1.0 +------------- + ++ **New Features** + * Use CMake to build the source code and retire all the other build systems. + * Add IOV as a selectable detail to xrootd.monitor directive. + * Provide a mode in xrootdfs to auto-update internal list of data servers. + and extend client connection TTL from one hour to infinity. + * Provide virtual xattr ("xroot.cksum") to obtain checksum for consistency. + * Make xrdadler32 use the new checksum format if it is set (fallback to old + format otherwise). In all cases, the old format is converted to the new + format whenever possible. + * Enforce r/o exports in the proxy server (finally added). + * Allow auto-fluching of I/O stream monitoring (default is off). + Patch submitted by Matevz Tadel, UCSD. + * Make proxy honor the export list at the storage layer. This allows sites + to disable staging via the proxy by specifying nostage for otherwise locally + stageable paths. + * Do not export the stage attribute to the meta-manager unless the path is + tagged with the stage+ attrbute on the export directive. + * WARNING: This update makes the oss plug-in source incompatible because an + additional parameter was added to the Stat() method. The update is binary + compatible and so only affects sites that recompile their plug-in. + * Allow the query checksum request to be issued via a proxy server. + * Add a query checksum interface to the POSIX interface. + * Defines the livXrdSecgsiAuthzVO plug-in to allow easy mapping from voms + vo names to users and groups. The plugin is configurable at run-time. + * Allow the OucErrInfo object to point to an environment. + * Add method to SysDNS to format an AF_INETx address into the RFC IPV6 + recommended format. + * Allow pointers to be placed in the OucEnv environment table. + * Extend the kXR_protocol request to allow the server to return detailed + information about node's role. This is backwardly compatible. + * The client uses kXR_protocol request to query for the server's role + (to distinguish managers from meta managers). + * The client goes back to a meta manager on authentication failure. + * The client prints to stdout the redirections it gets. This behavior may be + disabled by setting the XRD_PRINTREDIRECTS environment variable to 0, or, + from C++ by saying: EnvPutInt( NAME_PRINT_REDIRECTS, 0 ) + * Set $HOST value for possible copycmd substitution. + * Phase 1 to allow for redirection monitoring. Add rbuff and redir options + to the xrootd.monitor directive. + * Add error, redirect, and delay counts to the xrootd protocol summary + statistics. + * Allow file additions/deletion to be communicated to the XrdCnsd so that is + can maintain an accurate inventory. This update adds the frm.all.cnsd + directive which specifies how the information is to be commuincated. + * Enable cmsd monitoring. For now, only [meta]manager information is reported. + * Add new repstats config directive to increase reporting detail. + * New class, XrdCmsRole, to make role naming/handling consistent. + * Implement the 'cms.delay qdn' directive which allows one to tell the + meta-manager the minimum number of responses needed to satisfy a hold + delay (i.e. fast redirect). + * Accept XrdSecSSSKT envar as documented but also continue to support + XrdSecsssKT for backward compatibility. + * Allow servers to specify to the meta-manager what share of requests they + are willing to handle. Add the 'cms.sched gsdflt' and 'cms.sched gshr' + configuration directives to specify this. + * Include additional information in the protocol statistics. + * Resize some counters to prevent overflows. + * Add the 'cms.delay qdn' directive to allow better redirection control in + the future. + * Allow a plugin (notably the proxy plugin) to disable async I/O. + * Implement a general memory caching object. Currently, this will be used + by the Posix object. + * Allow optional memory caching when using the Posix library. This is + primarily used by the proxy object to reduce trips to a data server when + small blocks are accessed via the proxy server. This requires + configuration using the new 'pss.memcache' directive. + * Finally implement adding authentication information to the user monitoring + record (requested by Matevz Tadel, CMS). This adds a new generic option, + auth, to the xrootd.monitor directive. It needs to be specified for the + authentication information to be added. This keeps backward compatibility. + * Add a new method, chksum, to the standard filesystem interface. + * Integrate checksums into the logical filesystem layer implementation. + See the ofs.ckslib directive on how to do non-default configuration. + This also added a more effecient lfn2pfn() method to the storage system. + * Allow native checksums to be enabled in the xrootd layer. + See the xrootd.chksum directive on how to do this. + * Add checksum management to the frm_admin command. + * Allow XrdOucProg to dispatch a local program as well as a process. + * Allow a line to be insrerted into an XrdOucStream managed stream. + * Implement native checksums usable stand-alone or as plugins. Three digests + are supported: adler32, crc32, and md5. An additional digest can be added + via a plugin. Also, the native digests can be over-ridden via a plugin. + * In XrdSecgsi, new interface for the authorization plug-in which has now full + access to the XrdSecEntity object, with the possibility to fill/modify all the + fields according to the proxy chain. The plug-in is now called at the end of + the all process, after a successful handshake and DN-username mapping. + Implementations must contain three extern C functions; see the dummy example + provided in src/XrdSecgsi/XrdSecgsiAuthzFunDN.cc. + See also the header of XrdSecProtocolgsi::LoadAuthzFun. + * In XrdCryptosslgsiAux, add function to extract the VOMS attributes; can be + used in authz plug-ins. + * In XrdSecgsi, add possibility to extract the VOMS attributes and save them + in the XrdSecEntity. New switch '-vomsat:0/1 [1]'. + * In 'xrdgsiproxy info' show also the VOMS attributes, if present. + * Automatically build the RPM for the xrootd user when an OSG build is detected + and add fedora > 15 init scripts dependencies + ++ **Major bug fixes** + * Do not close the loger's shadow file descriptor when backgrounding as + this may cause random crashes later on. + * Avoid SEGV by setting network pointer prior to loading the 1st protocol. + * Enforce r/o path during mkdir operations. + * Avoid segv when initializing the finder on a multi-core machine. + * Fix incorrect lock handling for multiple waiters. + * Fix possible deadlocks in XrdSutCache preventing the pwd security module + to work correctly + ++ **Minor bug fixes** + * Properly handle the case when a site has an excessive number of groups + assignments. + * Prevent the response to a query from being truncated on the client side. + * Report readv information in the detailed monitoring stream. + * Correct default settings due to feature interactions after the fact. Now, + oss.defaults acts as if the setting were actually specified via oss.export. + * Actually use the N2N library of specified or implied via pss.localroot + for proxy server interactions withthe origin (required for Atlas T2). + * Use re-enterant versions of getpwuid() and getpwgid(). This is need for + FUSE. + * Correct bad english in a few error messages. + * Set correct checksum length when converting ASCII to binary. + * Allow the sss protocol to work for multi-homed hosts. + * Correct definition of AtomicISM that caused the maximum link count to + never be updated in the statistics. + * Apply N2N mapping to source path when relocating the file. + * Report correct port when locate is directly issued to a data server + (before it was being reported as 0). + * Make the default file system a pointer to a dynamic instance of XrdOfs + instead of a global static (i.e. the Andreas Peters patch). This makes + writing an ofs plugin easier. + * Fix the RPM uninstall scriptlets incorrectly invoking /sbin/ldconfig. + * Install XrdOlbMonPerf and netchk tools. + * Fix a bug preventing the core of authentication errors to be logged to clients + * In the krb5 security plugin, define KRB5CCNAME to point to the credential + cache file /tmp/krb5cc_ only if this file exists and is readable. + Solves an issue with credentials cached in memory (API::n). + * Fix array deletion mismatches reported by cppcheck (from D. Volgyes) + * Make sure that loading of XrdSecgsi.so fails if either the GMAPFun or the + AuthzFun plug-ins fail to load. + ++ **Miscellaneous** + * Drop Windows support. + * Code cleanup: remove XrdTokenAuthzOfs, simple tests, broken utilities, + the gridftp code, krb4 and secssl plugins, obsolete documentation files + * Make the loadable module extensions configurable depending on the platform + (so on Linux and Solaris, dylib on MacOs) + * Add new XrdVNUMBER macro. + * Clean up the conditional compilation macros. + * Remove compression related attributes (compchk, ssdec) and directives + (compdetect) as they were never used nor fully implemented. + * Remove the userprty directive. It was deprecated and never specified. + * Refactor PosixPreeload and Posix libraries to prevent split initialization + of the preload library which will cause failures on certain systems. + * Provide automatic proxy checksum defaults when role is set to proxy. + * Remove all references via extern statements to object instances. This + only applies to the Xrd package. + * Do not echo lines qualified by an in-line if when the if fails. + * Remove the old "redirect" directive. It has passed its prime. + * Remove back references to symbols defined in XrdXrootd package used by + the cms client to allow for clean shared library builds. + * Remove externs to XrdSecGetProtocol and XrdSecGetService from + XrdSecInterface.hh to avoid having undefined references just because the + include file was included somewhere. + * Rename XrdNetDNS to XrdSysDNS to avoid cross-dependencies. This means that all + plug-in developers will need to do the same as XrdNetDNS no longer exists. + * Split XrdFrm into XrdFrm and XrdFrc. This prevents cross-dependencies in + packages that use the File Residency Manager. + +------------- +Version 3.0.5 +------------- + ++ **Major bug fixes** + * Avoid stage failures when target file exists in purgeable or writable space. + * Make sure all the threads are joined when closing a physical connection. + * Fix free/delete mismatch in XrdSecProtocolgsi et al. + ++ **Minor bug fixes** + * Remove old async shutdown workaround patch introduced in Linux 2.3. The + problem has been since fixed and the solution now causes problems. + * Install the netchk tool + +------------- +Version 3.0.4 +------------- + ++ **New features** + * xrdcp now has -version parameter + * xrdcp automatically ads the oss.asize hint to the url opaque data. + This functionality may be disabled by setting the XrdCpSizeHint + variable to 0 (XRD_XRDCPSIZEHIN in the shell). + * The client will try to resolve the server hostname on every retry to + enable DNS failovers. + * RPM: devel package split into libs-devel, client-devel and server-devel + * XrootdFS: all paramenters can be passed via command line, add -h. + * Allow a plugin (notably the proxy plugin) to disable async I/O. + * New class XrdSysRWLock interfacing the pthread_rwlock functionality + * In XrdSecEntity: Add new fields 'creds' and 'credslen' to be filled + with the raw client credentials + * In XrdSutCache: Use XrdSysRWLock to coordinate concurrent access to + the cache + * In XrdSecgsi: + + - Add option to have Entity.name filled with the plain DN, instead of + the DN hash, when no mapping is requested or found. + + - Enable cache also for authz mapping results. + + - Do not require the existence of a grid-mapfile if gmapopt=2 and there is at least + a gmapfun or an authzfun defined. + + - Add example of mapping function allowing to match parts of the DN + + - Extend existing option 'authzpxy' to allow exporting the incoming client credentials in + XrdSecEntity. + ++ **Major bug fixes** + * Async write errors are now being properly caught and reacted to. + XrdClient::Close will now fail if it cannot recover from async + write errors. + * xrdcp prints an error message and returns failure to the shell + when some of the write requests it issues fail. + * libXrdPosixPreload now builds with autotools and is included into + the xrootd-client RPM + * RPM: FFS moved from libs to client + * Properly parse oss.asize. This because a major problem when xrdcp started + adding this to the url which causes the copy to fail. + * Spin connection portion of proxy initialization to a background thread. + This prevents init.d hangs when a redirector is not available. + ++ **Minor bug fixes** + * Test for 64-bit atomics instead 32-bit ones. Fixes build on 32-bit PowerPC. + * RPM: xrootd-fuse now depends on fuse + * Take correctly into accoutn summer time in calculating the time left for + a proxy validity + * Add support for Ubuntu 11 which uses the directory /usr/lib/`dpkg-architecture + -qDEB_HOST_MULTIARCH` to store platform dependent libraries. + +------------- +Version 3.0.3 +------------- + ++ **New features** + * Change configure.classic to handle various versions of processors in a + more sane way (this fixes several Solaris issues and atomics for i686). + * Add fwdwait option to cms.request directive to allow pacing of forwarded + requests (off by default). + * Use native memory synchronization primitives when available when doing + network I/O. This will eventually be extended to cover all other cases. + * Add the qdl option to the cms.delay directive to allow changing the + query window independently of the time a client is asked to wait for the + query to actually complete. + * Add 'pss.namelib' directive to allow proxies to pre-translate the lfn + for servers that cannot do so (e.g., dCache xrootd door). + * Optimize handling of shared-everything ile systems (e.g., dCache, GPFS, + DFS, Lustre, etc.) in the cmsd. + * Implement optional throttling for meta-manager requests in the cmsd. + * New cmsd directive, cms.dfs, declares that the underlying file system + is a shared-everything system (i.e., distributed file system) and allow + for optimal configuration and meta-manager throttling. + * Change the oss and fm components to use file extended attributes instead + of meta-files. This affects copy, create, reloc, rename, and unlink in the + oss layer. Migrate, purge, transfer, and most admin commands in the frm + component. The 'all.export' directive now accepts the noxattr/xattr option. + WARNING: If the migrator or purge options have been specified for any path + in the 'all.export; directive then this change requires either the the + 'oss.runmodeold' directive be added to the configuration file to provide + backward compatibility or that the name and data spaces be migrated using + the frm_admin command. See "Migrating tp Extended Attributes" manual for + detailed information and the new 'frm_admin convert' subcommand. + * Avoid physical copy if the operation can be handled using hard links. This + greatly speeds up static space token reassignment. + * Add platform independent interface to extended file attributes. + * RPM packaging and Red Hat Enterprise Linux compatible init scripts + capable of handling multiple instances of the xrootd daemons. The instances + can be defined in the /etc/sysconfig/xrootd file and then handled using standard:: + + service xrootd start|stop|... + service cmsd start|stop|... + ... + + or handled by name:: + + service xrootd start instance1 instance5 + + * New '-s' commandline option for xrootd, cmsd, frm_purged and frm_xfrd + creating a pidfile. + * xrootd, cmsd, frm_purged and frm_xfrd now return failure to the shell + when called with '-b' option (daemonization) and the daemon fails to + initialize. + * New 'EnableTCPKeepAlive' client environment option added enabling the TCP + stack keep-alive functionality for the sockets. + On Linux three addtional fine-tunning options are available: + + - TCPKeepAliveTime - interval (in seconds) between the last data packet and the first keep-alive + probe + - TCPKeepAliveInterval - interval (in seconds) between the probes + - TCPKeepAliveProbes - number of probes lost to consider the connection broken + + * New functionality handling process forking. When enabled (via the 'EnableForkHandlers' + env option) prior to a call to fork it shuts down all the xrootd connection management + facilities (including the connections themselves) and reinitializes them after the fork + both in the parent and the child process. This ensures relative fork safety provided + that all the XrdClient and XrdAdmin instances are closed when the fork function is invoked. + ++ **Major bug fixes** + * Add missing braces that caused config failure in frm_admin command. + * Account for correct path when -M value is zero in hpsscp command. + * In XrdCryptossl, fix for thread-safeness; solves random crashes observed on the + server side under high authentication frequency + * In XrdOucBonjour, fix important issue with host domain name registration, preventing + the correct domain to be posted. + ++ **Minor bug fixes** + * Correct file discovery propogation for proxy manager relative to meta-managers. + * Correct oss partition selection algorithm to further spread out file + allocation. + * Allow underscores in set/setenv variables. + * Add null byte after checksum value response. + * Move mapping of errno to xrootd error code to the protocol package where it + belongs. This also removes a cross dependency. + * Correct RetToken() behaviour in the presence of multiple spaces between tokens and + the previous call returned the remainder of the line (very obscure circumstances). + * [bug #77535] xrdcp now returns an error to the shell when it fails to copy the file + * [bug #79710] xrdcp now gracefully aborts when it encounters a corrupted local file + * Reset the transaction timeout for the Query method. + This fixes transaction timeout issues for clients doing only queries. + * Rename variable to remove conflict between it and global of the same name. + * Fix frm_admin command line option parsing so it does not trip over + subcommand options. This also fixes a SEGV in MacOS when this actually + happens. + * Enable the '-md5' option when OpenSSL is present and xrootd is built with autotools. + ++ **Documentation** + * Added man pages for: xprep, xrd, xrdcp, xrdstagetool, xrdgsiproxy + +------------- +Version 3.0.2 +------------- + ++ **Minor bug fixes** + * Fix the build on Solaris 10. + * Fix the build on SLC4. + * Fix the out-of-the-source-tree builds with autotools. + * Fix a segfault while doing a recursive copy from root:// to root://. + +------------- +Version 3.0.1 +------------- + ++ **New features** + * New application, cconfing, added to display configuration files relative to a host-program-instance. + * New application, netchk, that tests that firewalls have been correctly setup. + * New configure.classic option to allow use of stl4port library for Solaris. + * New internal feature in XrdPosix library to not shadow files with actual file descriptors (used by the proxy + service). This increases scalability. + * Allow the xrootd server to tell the client that it is a meta-manager. + * Support fo proxies generated by Globus version 4.2.1 in libXrdSecssl. + ++ **Major bug fixes** + * Change link options for xrdadler32 to not use shared libraries. The previous setup caused the command to hang + upon exit. + * Remove instance of XrdPosixXrootd from that same file. Including it disallows defaults from being changed. + ++ **Minor bug fixes** + * Fix XrdOucStream to not return ending "fi". + * Correct network option interference -- do not turn on network nodnr option should the keepalive option + be specified. + * Remove duplicate option in option table used by the proxy service. + * Compile on Solaris 11 Express using SunCC. + * Compile on Windows using MSVC++2010. diff --git a/src/XrdCeph/genversion.sh b/src/XrdCeph/genversion.sh new file mode 100755 index 00000000000..81008e77822 --- /dev/null +++ b/src/XrdCeph/genversion.sh @@ -0,0 +1,239 @@ +#!/bin/bash + +#------------------------------------------------------------------------------- +# Process the git decoration expansion and try to derive version number +#------------------------------------------------------------------------------- +EXP1='^v[12][0-9][0-9][0-9][01][0-9][0-3][0-9]-[0-2][0-9][0-5][0-9]$' +EXP2='^v[0-9]+\.[0-9]+\.[0-9]+$' +EXP3='^v[0-9]+\.[0-9]+\.[0-9]+\-rc.*$' + +#------------------------------------------------------------------------------- +# Get the numeric version +#------------------------------------------------------------------------------- +function getNumericVersion() +{ + VERSION=$1 + if test x`echo $VERSION | egrep $EXP2` == x; then + echo "1000000"; + return; + fi + VERSION=${VERSION/v/} + VERSION=${VERSION//./ } + VERSION=($VERSION) + printf "%d%02d%02d\n" ${VERSION[0]} ${VERSION[1]} ${VERSION[2]} +} + +#------------------------------------------------------------------------------- +# Extract version number from git references +#------------------------------------------------------------------------------- +function getVersionFromRefs() +{ + REFS=${1/RefNames:/} + REFS=${REFS//,/} + REFS=${REFS/(/} + REFS=${REFS/)/} + REFS=($REFS) + + VERSION="unknown" + + for i in ${REFS[@]}; do + if test x`echo $i | egrep $EXP2` != x; then + echo "$i" + return 0 + fi + + if test x`echo $i | egrep $EXP1` != x; then + VERSION="$i" + fi + + if test x`echo $i | egrep $EXP3` != x; then + VERSION="$i" + fi + + done + echo $VERSION + return 0 +} + +#------------------------------------------------------------------------------- +# Generate the version string from the date and the hash +#------------------------------------------------------------------------------- +function getVersionFromLog() +{ + AWK=gawk + EX="`which gawk`" + if test x"${EX}" == x -o ! -x "${EX}"; then + AWK=awk + fi + + VERSION="`echo $@ | $AWK '{ gsub("-","",$1); print $1"-"$4; }'`" + if test $? -ne 0; then + echo "unknown"; + return 1 + fi + echo v$VERSION +} + +#------------------------------------------------------------------------------- +# Print help +#------------------------------------------------------------------------------- +function printHelp() +{ + echo "Usage:" 1>&2 + echo "${0} [--help|--print-only|--version] [SOURCEPATH]" 1>&2 + echo " --help prints this message" 1>&2 + echo " --print-only prints the version to stdout and quits" 1>&2 + echo " --version VERSION sets the version manually" 1>&2 +} + +#------------------------------------------------------------------------------- +# Check the parameters +#------------------------------------------------------------------------------- +while test ${#} -ne 0; do + if test x${1} = x--help; then + PRINTHELP=1 + elif test x${1} = x--print-only; then + PRINTONLY=1 + elif test x${1} = x--version; then + if test ${#} -lt 2; then + echo "--version parameter needs an argument" 1>&2 + exit 1 + fi + USER_VERSION=${2} + shift + else + SOURCEPATH=${1} + fi + shift +done + +if test x$PRINTHELP != x; then + printHelp ${0} + exit 0 +fi + +if test x$SOURCEPATH != x; then + SOURCEPATH=${SOURCEPATH}/ + if test ! -d $SOURCEPATH; then + echo "The given source path does not exist: ${SOURCEPATH}" 1>&2 + exit 1 + fi +fi + +VERSION="unknown" + +#------------------------------------------------------------------------------- +# We're not inside a git repo +#------------------------------------------------------------------------------- +if test ! -d ${SOURCEPATH}.git; then + #----------------------------------------------------------------------------- + # We cannot figure out what version we are + #---------------------------------------------------------------------------- + echo "[I] No git repository info found. Trying to interpret VERSION_INFO" 1>&2 + if test ! -r ${SOURCEPATH}VERSION_INFO; then + echo "[!] VERSION_INFO file absent. Unable to determine the version. Using \"unknown\"" 1>&2 + elif test x"`grep Format ${SOURCEPATH}VERSION_INFO`" != x; then + echo "[!] VERSION_INFO file invalid. Unable to determine the version. Using \"unknown\"" 1>&2 + + #----------------------------------------------------------------------------- + # The version file exists and seems to be valid so we know the version + #---------------------------------------------------------------------------- + else + REFNAMES="`grep RefNames ${SOURCEPATH}VERSION_INFO`" + VERSION="`getVersionFromRefs "$REFNAMES"`" + if test x$VERSION == xunknown; then + SHORTHASH="`grep ShortHash ${SOURCEPATH}VERSION_INFO`" + SHORTHASH=${SHORTHASH/ShortHash:/} + SHORTHASH=${SHORTHASH// /} + DATE="`grep Date ${SOURCEPATH}VERSION_INFO`" + DATE=${DATE/Date:/} + VERSION="`getVersionFromLog $DATE $SHORTHASH`" + fi + fi + +#------------------------------------------------------------------------------- +# Check if the version has been specified by the user +#------------------------------------------------------------------------------- +elif test x$USER_VERSION != x; then + VERSION=$USER_VERSION + +#------------------------------------------------------------------------------- +# We're in a git repo so we can try to determine the version using that +#------------------------------------------------------------------------------- +else + echo "[I] Determining version from git" 1>&2 + EX="`which git`" + if test x"${EX}" == x -o ! -x "${EX}"; then + echo "[!] Unable to find git in the path: setting the version tag to unknown" 1>&2 + else + #--------------------------------------------------------------------------- + # Sanity check + #--------------------------------------------------------------------------- + CURRENTDIR=$PWD + if [ x${SOURCEPATH} != x ]; then + cd ${SOURCEPATH} + fi + git log -1 >/dev/null 2>&1 + if test $? -ne 0; then + echo "[!] Error while generating src/XrdVersion.hh, the git repository may be corrupted" 1>&2 + echo "[!] Setting the version tag to unknown" 1>&2 + else + #------------------------------------------------------------------------- + # Can we match the exact tag? + #------------------------------------------------------------------------- + git describe --tags --abbrev=0 --exact-match >/dev/null 2>&1 + if test ${?} -eq 0; then + VERSION="`git describe --tags --abbrev=0 --exact-match`" + else + LOGINFO="`git log -1 --format='%ai %h'`" + if test ${?} -eq 0; then + VERSION="`getVersionFromLog $LOGINFO`" + fi + fi + fi + cd $CURRENTDIR + fi +fi + +#------------------------------------------------------------------------------- +# Make sure the version string is not longer than 25 characters +#------------------------------------------------------------------------------- +if [ ${#VERSION} -gt 25 ] && [ x$USER_VERSION == x ] ; then + VERSION="${VERSION:0:19}...${VERSION: -3}" +fi + +#------------------------------------------------------------------------------- +# Print the version info and exit if necassary +#------------------------------------------------------------------------------- +if test x$PRINTONLY != x; then + echo $VERSION + exit 0 +fi + +#------------------------------------------------------------------------------- +# Create XrdVersion.hh +#------------------------------------------------------------------------------- +NUMVERSION=`getNumericVersion $VERSION` + +if test ! -r ${SOURCEPATH}src/XrdVersion.hh.in; then + echo "[!] Unable to find src/XrdVersion.hh.in" 1>&2 + exit 1 +fi + +sed -e "s/#define XrdVERSION \"unknown\"/#define XrdVERSION \"$VERSION\"/" ${SOURCEPATH}src/XrdVersion.hh.in | \ +sed -e "s/#define XrdVNUMBER 1000000/#define XrdVNUMBER $NUMVERSION/" \ +> src/XrdVersion.hh.new + +if test $? -ne 0; then + echo "[!] Error while generating src/XrdVersion.hh from the input template" 1>&2 + exit 1 +fi + +if test ! -e src/XrdVersion.hh; then + mv src/XrdVersion.hh.new src/XrdVersion.hh +elif test x"`diff src/XrdVersion.hh.new src/XrdVersion.hh`" != x; then + mv src/XrdVersion.hh.new src/XrdVersion.hh +else + rm src/XrdVersion.hh.new +fi +echo "[I] src/XrdVersion.hh successfully generated" 1>&2 diff --git a/src/XrdCeph/packaging/debian/compat b/src/XrdCeph/packaging/debian/compat new file mode 100644 index 00000000000..f599e28b8ab --- /dev/null +++ b/src/XrdCeph/packaging/debian/compat @@ -0,0 +1 @@ +10 diff --git a/src/XrdCeph/packaging/debian/control b/src/XrdCeph/packaging/debian/control new file mode 100644 index 00000000000..86b8341286f --- /dev/null +++ b/src/XrdCeph/packaging/debian/control @@ -0,0 +1,48 @@ +Source: xrootd +Maintainer: Jozsef Makai +Section: misc +Priority: optional +Standards-Version: 3.9.3 +Build-Depends: debhelper (>= 9), cmake (>=3.3.0), zlib1g-dev, libfuse-dev, python-dev, libssl-dev, libxml2-dev, ncurses-dev, libkrb5-dev, libreadline-dev, libsystemd-dev, selinux-policy-dev, systemd +Homepage: https://github.com/xrootd/xrootd +Vcs-Git: https://github.com/xrootd/xrootd.git +Vcs-Browser: https://github.com/xrootd/xrootd + +Package: xrootd-libs +Architecture: any +Description: This package contains libraries used by the xrootd servers and clients. + +Package: xrootd-devel +Architecture: any +Depends: ${shlibs:Depends}, xrootd-libs (=${binary:Version}) +Description: This package contains header files and development libraries for xrootd development. + +Package: xrootd-client-libs +Architecture: any +Depends: ${shlibs:Depends}, xrootd-libs (=${binary:Version}) +Description: This package contains libraries used by xrootd clients. + +Package: xrootd-client-devel +Architecture: any +Depends: ${shlibs:Depends}, xrootd-devel (=${binary:Version}), xrootd-client-libs (=${binary:Version}) +Description: This package contains header files and development libraries for xrootd client development. + +Package: xrootd-client +Architecture: any +Depends: ${shlibs:Depends}, libxml2, xrootd-libs (=${binary:Version}), xrootd-client-libs (=${binary:Version}) +Description: This package contains the command line tools used to communicate with xrootd servers. + +Package: xrootd-private-devel +Architecture: any +Depends: ${shlibs:Depends}, xrootd-libs (=${binary:Version}) +Description: This package contains some private xrootd headers. The use of these headers is strongly discouraged. Backward compatibility between versions is not guaranteed for these headers. + +Package: xrootd-server-libs +Architecture: any +Depends: ${shlibs:Depends}, xrootd-libs (=${binary:Version}), xrootd-client-libs (=${binary:Version}) +Description: This package contains libraries used by xrootd servers. + +Package: xrootd-server-devel +Architecture: any +Depends: ${shlibs:Depends}, xrootd-devel (=${binary:Version}), xrootd-client-devel (=${binary:Version}), xrootd-server-libs (=${binary:Version}) +Description: This package contains header files and development libraries for xrootd server development. diff --git a/src/XrdCeph/packaging/debian/copyright b/src/XrdCeph/packaging/debian/copyright new file mode 100644 index 00000000000..8fd5621be2c --- /dev/null +++ b/src/XrdCeph/packaging/debian/copyright @@ -0,0 +1,18 @@ +"Copyright (c) 2005-2012, Board of Trustees of the Leland Stanford, Jr. University.\n" +"Produced under contract DE-AC02-76-SF00515 with the US Department of Energy. \n" +"All rights reserved. The copyright holder's institutional names may not be used to\n" +"endorse or promote products derived from this software without specific prior \n" +"written permission.\n\n" +"This file is part of the XRootD software suite. \n\n" +"XRootD is free software: you can redistribute it and/or modify it under the terms \n" +"of the GNU Lesser General Public License as published by the Free Software \n" +"Foundation, either version 3 of the License, or (at your option) any later version.\n\n" +"XRootD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;\n" +"without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR \n" +"PURPOSE. See the GNU Lesser General Public License for more details. \nn" +"You should have received a copy of the GNU Lesser General Public License along \n" +"with XRootD in a file called COPYING.LESSER (LGPL license) and file COPYING (GPL \n" +"license). If not, see .\n\n" +"Prior to September 2nd, 2012 the XRootD software suite was licensed under a\n" +"modified BSD license (see file COPYING.BSD). This applies to all code that\n" +"was in the XRootD git repository prior to that date.\n" diff --git a/src/XrdCeph/packaging/debian/rules b/src/XrdCeph/packaging/debian/rules new file mode 100755 index 00000000000..a89c9970c54 --- /dev/null +++ b/src/XrdCeph/packaging/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f + +%: + dh $@ --builddirectory=build --destdir=deb_packages + +override_dh_auto_configure: + dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_LIBDIR=lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +override_dh_install: + install -D -m 644 packaging/common/client.conf deb_packages/etc/xrootd/client.conf + install -D -m 644 packaging/common/client-plugin.conf.example deb_packages/etc/xrootd/client.plugins.d/client-plugin.conf.example + dh_install --sourcedir=deb_packages diff --git a/src/XrdCeph/packaging/debian/source/format b/src/XrdCeph/packaging/debian/source/format new file mode 100644 index 00000000000..163aaf8d82b --- /dev/null +++ b/src/XrdCeph/packaging/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/src/XrdCeph/packaging/debian/xrootd-client-devel.install b/src/XrdCeph/packaging/debian/xrootd-client-devel.install new file mode 100644 index 00000000000..321cbc0430c --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-client-devel.install @@ -0,0 +1,9 @@ +usr/bin/xrdgsitest +usr/lib/*/libXrdCl.so +usr/lib/*/libXrdClient.so +usr/lib/*/libXrdFfs.so +usr/lib/*/libXrdPosix.so +usr/share/man/man1/xrdgsitest.1* +usr/include/xrootd/XrdCl +usr/include/xrootd/XrdClient +usr/include/xrootd/XrdPosix diff --git a/src/XrdCeph/packaging/debian/xrootd-client-libs.install b/src/XrdCeph/packaging/debian/xrootd-client-libs.install new file mode 100644 index 00000000000..a8a45bfa66c --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-client-libs.install @@ -0,0 +1,8 @@ +usr/lib/*/libXrdCl.so.2* +usr/lib/*/libXrdClient.so.2* +usr/lib/*/libXrdFfs.so.2* +usr/lib/*/libXrdPosix.so.2* +usr/lib/*/libXrdPosixPreload.so.1* +usr/lib/*/libXrdPosixPreload.so +etc/xrootd/client.plugins.d/client-plugin.conf.example +etc/xrootd/client.conf diff --git a/src/XrdCeph/packaging/debian/xrootd-client-libs.postinst b/src/XrdCeph/packaging/debian/xrootd-client-libs.postinst new file mode 100644 index 00000000000..2983b531b1f --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-client-libs.postinst @@ -0,0 +1,3 @@ +#!/bin/bash + +ldconfig diff --git a/src/XrdCeph/packaging/debian/xrootd-client-libs.postrm b/src/XrdCeph/packaging/debian/xrootd-client-libs.postrm new file mode 100644 index 00000000000..2983b531b1f --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-client-libs.postrm @@ -0,0 +1,3 @@ +#!/bin/bash + +ldconfig diff --git a/src/XrdCeph/packaging/debian/xrootd-client.install b/src/XrdCeph/packaging/debian/xrootd-client.install new file mode 100644 index 00000000000..d4ca23ae269 --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-client.install @@ -0,0 +1,18 @@ +usr/bin/xprep +usr/bin/xrd +usr/bin/xrdadler32 +usr/bin/xrdcopy +usr/bin/xrdcp +usr/bin/xrdcp-old +usr/bin/xrdfs +usr/bin/xrdgsiproxy +usr/bin/xrdstagetool +usr/share/man/man1/xprep.1* +usr/share/man/man1/xrd.1* +usr/share/man/man1/xrdadler32.1* +usr/share/man/man1/xrdcopy.1* +usr/share/man/man1/xrdcp.1* +usr/share/man/man1/xrdcp-old.1* +usr/share/man/man1/xrdfs.1* +usr/share/man/man1/xrdgsiproxy.1* +usr/share/man/man1/xrdstagetool.1* diff --git a/src/XrdCeph/packaging/debian/xrootd-devel.install b/src/XrdCeph/packaging/debian/xrootd-devel.install new file mode 100644 index 00000000000..8ce0c9c9a9e --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-devel.install @@ -0,0 +1,15 @@ +usr/bin/xrootd-config +usr/include/xrootd/XProtocol +usr/include/xrootd/Xrd +usr/include/xrootd/XrdCks +usr/include/xrootd/XrdNet +usr/include/xrootd/XrdOuc +usr/include/xrootd/XrdSec +usr/include/xrootd/XrdSys +usr/include/xrootd/XrdVersion.hh +usr/include/xrootd/XrdXml/XrdXmlReader.hh +usr/lib/*/libXrdAppUtils.so +usr/lib/*/libXrdCrypto.so +usr/lib/*/libXrdCryptoLite.so +usr/lib/*/libXrdUtils.so +usr/lib/*/libXrdXml.so diff --git a/src/XrdCeph/packaging/debian/xrootd-libs.install b/src/XrdCeph/packaging/debian/xrootd-libs.install new file mode 100644 index 00000000000..8faf68a3046 --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-libs.install @@ -0,0 +1,9 @@ +usr/lib/*/libXrdAppUtils.so.1* +usr/lib/*/libXrdClProxyPlugin-4.so +usr/lib/*/libXrdCks*-4.so +usr/lib/*/libXrdCrypto.so.1* +usr/lib/*/libXrdCryptoLite.so.1* +usr/lib/*/libXrdCryptossl-4.so +usr/lib/*/libXrdSec*-4.so +usr/lib/*/libXrdUtils.so.* +usr/lib/*/libXrdXml.so.* diff --git a/src/XrdCeph/packaging/debian/xrootd-libs.postinst b/src/XrdCeph/packaging/debian/xrootd-libs.postinst new file mode 100644 index 00000000000..2983b531b1f --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-libs.postinst @@ -0,0 +1,3 @@ +#!/bin/bash + +ldconfig diff --git a/src/XrdCeph/packaging/debian/xrootd-libs.postrm b/src/XrdCeph/packaging/debian/xrootd-libs.postrm new file mode 100644 index 00000000000..2983b531b1f --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-libs.postrm @@ -0,0 +1,3 @@ +#!/bin/bash + +ldconfig diff --git a/src/XrdCeph/packaging/debian/xrootd-private-devel.install b/src/XrdCeph/packaging/debian/xrootd-private-devel.install new file mode 100644 index 00000000000..38c034f2bb2 --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-private-devel.install @@ -0,0 +1,3 @@ +usr/include/xrootd/private +usr/lib/*/libXrdSsiLib.so +usr/lib/*/libXrdSsiShMap.so diff --git a/src/XrdCeph/packaging/debian/xrootd-server-devel.install b/src/XrdCeph/packaging/debian/xrootd-server-devel.install new file mode 100644 index 00000000000..d1dcf33b6c5 --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-server-devel.install @@ -0,0 +1,8 @@ +usr/include/xrootd/XrdAcc +usr/include/xrootd/XrdCms +usr/include/xrootd/XrdFileCache +usr/include/xrootd/XrdOss +usr/include/xrootd/XrdSfs +usr/include/xrootd/XrdXrootd +usr/include/xrootd/XrdHttp +usr/lib/*/libXrdServer.so diff --git a/src/XrdCeph/packaging/debian/xrootd-server-libs.install b/src/XrdCeph/packaging/debian/xrootd-server-libs.install new file mode 100644 index 00000000000..de9c8be9e28 --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-server-libs.install @@ -0,0 +1,14 @@ +usr/lib/*/libXrdBwm-4.so +usr/lib/*/libXrdPss-4.so +usr/lib/*/libXrdXrootd-4.so +usr/lib/*/libXrdFileCache-4.so +usr/lib/*/libXrdBlacklistDecision-4.so +usr/lib/*/libXrdHttp-4.so +usr/lib/*/libXrdN2No2p-4.so +usr/lib/*/libXrdOssSIgpfsT-4.so +usr/lib/*/libXrdServer.so.* +usr/lib/*/libXrdSsi-4.so +usr/lib/*/libXrdSsiLib.so.* +usr/lib/*/libXrdSsiLog-4.so +usr/lib/*/libXrdSsiShMap.so.* +usr/lib/*/libXrdThrottle-4.so diff --git a/src/XrdCeph/packaging/debian/xrootd-server-libs.postinst b/src/XrdCeph/packaging/debian/xrootd-server-libs.postinst new file mode 100644 index 00000000000..2983b531b1f --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-server-libs.postinst @@ -0,0 +1,3 @@ +#!/bin/bash + +ldconfig diff --git a/src/XrdCeph/packaging/debian/xrootd-server-libs.postrm b/src/XrdCeph/packaging/debian/xrootd-server-libs.postrm new file mode 100644 index 00000000000..2983b531b1f --- /dev/null +++ b/src/XrdCeph/packaging/debian/xrootd-server-libs.postrm @@ -0,0 +1,3 @@ +#!/bin/bash + +ldconfig diff --git a/src/XrdCeph/packaging/debian_scripts/publish_debian_cern.sh b/src/XrdCeph/packaging/debian_scripts/publish_debian_cern.sh new file mode 100755 index 00000000000..204914cec25 --- /dev/null +++ b/src/XrdCeph/packaging/debian_scripts/publish_debian_cern.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +#------------------------------------------------------------------------------- +# Publish debian artifacts on CERN Gitlab CI +# Author: Jozsef Makai (11.08.2017) +#------------------------------------------------------------------------------- + +set -e + +comp=$1 +prefix=/eos/project/s/storage-ci/www/debian/xrootd + +for dist in artful xenial; do + echo "Publishing for $dist"; + path=$prefix/pool/$dist/$comp/x/xrootd/; + mkdir -p $path; + if [[ "$comp" == "master" ]]; then find ${path} -type f -name '*deb' -delete; fi + cp $dist/*deb $path; + mkdir -p $prefix/dists/$dist/$comp/binary-amd64/; + (cd $prefix && apt-ftparchive --arch amd64 packages pool/$dist/$comp/ > dists/$dist/$comp/binary-amd64/Packages); + gzip -c $prefix/dists/$dist/$comp/binary-amd64/Packages > $prefix/dists/$dist/$comp/binary-amd64/Packages.gz; + components=$(find $prefix/dists/$dist/ -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | tr '\n' ' ') + if [ -e $prefix/dists/$dist/Release ]; then + rm $prefix/dists/$dist/Release + fi + if [ -e $prefix/dists/$dist/InRelease ]; then + rm $prefix/dists/$dist/InRelease + fi + if [ -e $prefix/dists/$dist/Release.gpg ]; then + rm $prefix/dists/$dist/Release.gpg + fi + apt-ftparchive -o APT::FTPArchive::Release::Origin=CERN -o APT::FTPArchive::Release::Label=XrootD -o APT::FTPArchive::Release::Codename=artful -o APT::FTPArchive::Release::Architectures=amd64 -o APT::FTPArchive::Release::Components="$components" release $prefix/dists/$dist/ > $prefix/dists/$dist/Release; + gpg --homedir /home/stci/ --clearsign -o $prefix/dists/$dist/InRelease $prefix/dists/$dist/Release; + gpg --homedir /home/stci/ -abs -o $prefix/dists/$dist/Release.gpg $prefix/dists/$dist/Release; +done diff --git a/src/XrdCeph/packaging/makesrpm.sh b/src/XrdCeph/packaging/makesrpm.sh new file mode 100755 index 00000000000..b74b90fd471 --- /dev/null +++ b/src/XrdCeph/packaging/makesrpm.sh @@ -0,0 +1,256 @@ +#!/bin/bash +#------------------------------------------------------------------------------- +# Create a source RPM package +# Author: Lukasz Janyst (10.03.2011) +#------------------------------------------------------------------------------- + +RCEXP='^[0-9]+\.[0-9]+\.[0-9]+\-rc.*$' +CERNEXP='^[0-9]+\.[0-9]+\.[0-9]+\-[0-9]+\.CERN.*$' + +#------------------------------------------------------------------------------- +# Find a program +#------------------------------------------------------------------------------- +function findProg() +{ + for prog in $@; do + if test -x "`which $prog 2>/dev/null`"; then + echo $prog + break + fi + done +} + +#------------------------------------------------------------------------------- +# Print help +#------------------------------------------------------------------------------- +function printHelp() +{ + echo "Usage:" 1>&2 + echo "${0} [--help] [--source PATH] [--output PATH]" 1>&2 + echo " --help prints this message" 1>&2 + echo " --source PATH specify the root of the source tree" 1>&2 + echo " defaults to ../" 1>&2 + echo " --output PATH the directory where the source rpm" 1>&2 + echo " should be stored, defaulting to ." 1>&2 + echo " --version VERSION the version provided by user" 1>&2 + echo " --define 'MACRO EXPR'" 1>&2 +} + +#------------------------------------------------------------------------------- +# Parse the commandline, if only we could use getopt... :( +#------------------------------------------------------------------------------- +SOURCEPATH="../" +OUTPUTPATH="." +PRINTHELP=0 + +while test ${#} -ne 0; do + if test x${1} = x--help; then + PRINTHELP=1 + elif test x${1} = x--source; then + if test ${#} -lt 2; then + echo "--source parameter needs an argument" 1>&2 + exit 1 + fi + SOURCEPATH=${2} + shift + elif test x${1} = x--output; then + if test ${#} -lt 2; then + echo "--output parameter needs an argument" 1>&2 + exit 1 + fi + OUTPUTPATH=${2} + shift + elif test x${1} = x--version; then + if test ${#} -lt 2; then + echo "--version parameter needs an argument" 1>&2 + exit 1 + fi + USER_VERSION="--version ${2}" + shift + elif test x${1} = x--define; then + if test ${#} -lt 2; then + echo "--define parameter needs an argument" 1>&2 + exit 1 + fi + USER_DEFINE="$USER_DEFINE --define \""${2}"\"" + shift + fi + shift +done + +if test $PRINTHELP -eq 1; then + printHelp + exit 0 +fi + +echo "[i] Working on: $SOURCEPATH" +echo "[i] Storing the output to: $OUTPUTPATH" + +#------------------------------------------------------------------------------- +# Check if the source and the output dirs +#------------------------------------------------------------------------------- +if test ! -d $SOURCEPATH -o ! -r $SOURCEPATH; then + echo "[!] Source path does not exist or is not readable" 1>&2 + exit 2 +fi + +if test ! -d $OUTPUTPATH -o ! -w $OUTPUTPATH; then + echo "[!] Output path does not exist or is not writeable" 1>&2 + exit 2 +fi + +#------------------------------------------------------------------------------- +# Check if we have all the necassary components +#------------------------------------------------------------------------------- +if test x`findProg rpmbuild` = x; then + echo "[!] Unable to find rpmbuild, aborting..." 1>&2 + exit 1 +fi + +if test x`findProg git` = x; then + echo "[!] Unable to find git, aborting..." 1>&2 + exit 1 +fi + +#------------------------------------------------------------------------------- +# Check if the source is a git repository +#------------------------------------------------------------------------------- +if test ! -d $SOURCEPATH/.git; then + echo "[!] I can only work with a git repository" 1>&2 + exit 2 +fi + +#------------------------------------------------------------------------------- +# Check the version number +#------------------------------------------------------------------------------- +if test ! -x $SOURCEPATH/genversion.sh; then + echo "[!] Unable to find the genversion script" 1>&2 + exit 3 +fi + +VERSION=`$SOURCEPATH/genversion.sh --print-only $USER_VERSION $SOURCEPATH 2>/dev/null` +if test $? -ne 0; then + echo "[!] Unable to figure out the version number" 1>&2 + exit 4 +fi + +echo "[i] Working with version: $VERSION" + +if test x${VERSION:0:1} = x"v"; then + VERSION=${VERSION:1} +fi + +#------------------------------------------------------------------------------- +# Deal with release candidates +#------------------------------------------------------------------------------- +RELEASE=1 +if test x`echo $VERSION | egrep $RCEXP` != x; then + RELEASE=0.`echo $VERSION | sed 's/.*-rc/rc/'` + VERSION=`echo $VERSION | sed 's/-rc.*//'` +fi + +#------------------------------------------------------------------------------- +# Deal with CERN releases +#------------------------------------------------------------------------------- +if test x`echo $VERSION | egrep $CERNEXP` != x; then + RELEASE=`echo $VERSION | sed 's/.*-//'` + VERSION=`echo $VERSION | sed 's/-.*\.CERN//'` +fi + +#------------------------------------------------------------------------------- +# In case of user version check if the release number has been provided +#------------------------------------------------------------------------------- +if test x"$USER_VERSION" != x; then + TMP=`echo $VERSION | sed 's#.*-##g'` + if test $TMP != $VERSION; then + RELEASE=$TMP + VERSION=`echo $VERSION | sed 's#-[^-]*$##'` + fi +fi + +VERSION=`echo $VERSION | sed 's/-/./g'` +echo "[i] RPM compliant version: $VERSION-$RELEASE" + +#------------------------------------------------------------------------------- +# Create a tempdir and copy the files there +#------------------------------------------------------------------------------- +# exit on any error +set -e + +TEMPDIR=`mktemp -d /tmp/xrootd-ceph.srpm.XXXXXXXXXX` +RPMSOURCES=$TEMPDIR/rpmbuild/SOURCES +mkdir -p $RPMSOURCES +mkdir -p $TEMPDIR/rpmbuild/SRPMS + +echo "[i] Working in: $TEMPDIR" 1>&2 + +if test -d rhel -a -r rhel; then + for i in rhel/*; do + cp $i $RPMSOURCES + done +fi + +if test -d common -a -r common; then + for i in common/*; do + cp $i $RPMSOURCES + done +fi + +#------------------------------------------------------------------------------- +# Generate the spec file +#------------------------------------------------------------------------------- +if test ! -r rhel/xrootd-ceph.spec.in; then + echo "[!] The specfile template does not exist!" 1>&2 + exit 7 +fi +cat rhel/xrootd-ceph.spec.in | sed "s/__VERSION__/$VERSION/" | \ + sed "s/__RELEASE__/$RELEASE/" > $TEMPDIR/xrootd-ceph.spec + +#------------------------------------------------------------------------------- +# Make a tarball of the latest commit on the branch +#------------------------------------------------------------------------------- +# no more exiting on error +set +e + +CWD=$PWD +cd $SOURCEPATH +COMMIT=`git log --pretty=format:"%H" -1` + +if test $? -ne 0; then + echo "[!] Unable to figure out the git commit hash" 1>&2 + exit 5 +fi + +git archive --prefix=xrootd-ceph/ --format=tar $COMMIT | gzip -9fn > \ + $RPMSOURCES/xrootd-ceph.tar.gz + +if test $? -ne 0; then + echo "[!] Unable to create the source tarball" 1>&2 + exit 6 +fi + +cd $CWD + +#------------------------------------------------------------------------------- +# Build the source RPM +#------------------------------------------------------------------------------- +echo "[i] Creating the source RPM..." + +# Dirty, dirty hack! +echo "%_sourcedir $RPMSOURCES" >> $TEMPDIR/rpmmacros +eval "rpmbuild --define \"_topdir $TEMPDIR/rpmbuild\" \ + --define \"%_sourcedir $RPMSOURCES\" \ + --define \"%_srcrpmdir %{_topdir}/SRPMS\" \ + --define \"_source_filedigest_algorithm md5\" \ + --define \"_binary_filedigest_algorithm md5\" \ + ${USER_DEFINE} \ + -bs $TEMPDIR/xrootd-ceph.spec > $TEMPDIR/log" +if test $? -ne 0; then + echo "[!] RPM creation failed" 1>&2 + exit 8 +fi + +cp $TEMPDIR/rpmbuild/SRPMS/xrootd-ceph*.src.rpm $OUTPUTPATH +rm -rf $TEMPDIR + +echo "[i] Done." diff --git a/src/XrdCeph/packaging/rhel/xrootd-ceph.spec.in b/src/XrdCeph/packaging/rhel/xrootd-ceph.spec.in new file mode 100644 index 00000000000..03b1caccebd --- /dev/null +++ b/src/XrdCeph/packaging/rhel/xrootd-ceph.spec.in @@ -0,0 +1,167 @@ +#------------------------------------------------------------------------------- +# Helper macros +#------------------------------------------------------------------------------- +%if %{?rhel:1}%{!?rhel:0} + %if %{rhel} >= 7 + %define use_systemd 1 + %else + %define use_systemd 0 + %endif +%else + %if %{?fedora}%{!?fedora:0} >= 19 + %define use_systemd 1 + %else + %define use_systemd 0 + %endif +%endif + +%if %{?fedora}%{!?fedora:0} >= 22 + %define use_libc_semaphore 1 +%else + %define use_libc_semaphore 0 +%endif + +%if %{?_with_ceph11:1}%{!?_with_ceph11:0} + %define _with_ceph 1 +%endif + +%if %{?rhel:1}%{!?rhel:0} + %if %{rhel} > 7 + %define use_cmake3 0 + %else + %define use_cmake3 1 + %endif +%else + %define use_cmake3 0 +%endif + +#------------------------------------------------------------------------------- +# Package definitions +#------------------------------------------------------------------------------- +Name: xrootd-ceph +Epoch: 1 +Version: __VERSION__ +Release: __RELEASE__%{?dist}%{?_with_clang:.clang} +Summary: CEPH plug-in for XRootD +Group: System Environment/Daemons +License: LGPLv3+ +URL: http://xrootd.org/ + +# git clone http://xrootd.org/repo/xrootd.git xrootd +# cd xrootd +# git-archive master | gzip -9 > ~/rpmbuild/SOURCES/xrootd.tgz +Source0: xrootd-ceph.tar.gz + +BuildRoot: %{_tmppath}/%{name}-root + +%if %{use_cmake3} +BuildRequires: cmake3 +%else +BuildRequires: cmake +%endif + +%if %{?_with_tests:1}%{!?_with_tests:0} +BuildRequires: cppunit-devel +%endif + +BuildRequires: librados-devel = 2:14.2.15 +BuildRequires: libradosstriper-devel = 2:14.2.15 + +%if %{?_with_clang:1}%{!?_with_clang:0} +BuildRequires: clang +%endif + +BuildRequires: xrootd-server-devel%{?_isa} = %{epoch}:%{version}-%{release} +BuildRequires: xrootd-private-devel%{?_isa} = %{epoch}:%{version}-%{release} +BuildRequires: xrootd-libs%{?_isa} = %{epoch}:%{version}-%{release} +BuildRequires: xrootd-server-libs%{?_isa} = %{epoch}:%{version}-%{release} +BuildRequires: xrootd-client-libs%{?_isa} = %{epoch}:%{version}-%{release} + +Requires: xrootd-server-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: xrootd-client-libs%{?_isa} = %{epoch}:%{version}-%{release} +Requires: xrootd-libs%{?_isa} = %{epoch}:%{version}-%{release} + +%description +The xrootd-ceph is an OSS layer plug-in for the XRootD server for interfacing +with the Ceph storage platform. + +#------------------------------------------------------------------------------- +# Build instructions +#------------------------------------------------------------------------------- +%prep +%setup -c -n xrootd-ceph + +%build +cd xrootd-ceph + +%if %{?_with_clang:1}%{!?_with_clang:0} +export CC=clang +export CXX=clang++ +%endif + +mkdir build +pushd build + +%if %{use_cmake3} +cmake3 \ +%else +cmake \ +%endif + -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo \ +%if %{?_with_tests:1}%{!?_with_tests:0} + -DENABLE_TESTS=TRUE \ +%else + -DENABLE_TESTS=FALSE \ +%endif + ../ + +make -i VERBOSE=1 %{?_smp_mflags} +popd + +#------------------------------------------------------------------------------- +# Installation +#------------------------------------------------------------------------------- +%install +rm -rf $RPM_BUILD_ROOT + +#------------------------------------------------------------------------------- +# Install 4.x.y +#------------------------------------------------------------------------------- +pushd xrootd-ceph +pushd build +make install DESTDIR=$RPM_BUILD_ROOT +popd + +# ceph posix unversioned so +rm -f $RPM_BUILD_ROOT%{_libdir}/libXrdCephPosix.so + + +%clean +rm -rf $RPM_BUILD_ROOT + +#------------------------------------------------------------------------------- +# Files +#------------------------------------------------------------------------------- +%files +%defattr(-,root,root,-) +%{_libdir}/libXrdCeph-5.so +%{_libdir}/libXrdCephXattr-5.so +%{_libdir}/libXrdCephPosix.so* + +%if %{?_with_tests:1}%{!?_with_tests:0} +%files tests +%defattr(-,root,root,-) +%{_libdir}/libXrdCephTests*.so +%endif + +#------------------------------------------------------------------------------- +# Changelog +#------------------------------------------------------------------------------- +%changelog +* Wed Dec 16 2020 George Patargias +- updated version for librados-devel and libradosstriper-devel to 14.2.15 following the recent upgrade on external Echo gateways +- fixed version in xrootd-ceph shared libraries +* Mon Mar 02 2020 Michal Simon +- fixed RPM dependencies +* Thu Mar 08 2018 Michal Simon +- initial release diff --git a/src/XrdCeph/src/CMakeLists.txt b/src/XrdCeph/src/CMakeLists.txt new file mode 100644 index 00000000000..b044ee25fec --- /dev/null +++ b/src/XrdCeph/src/CMakeLists.txt @@ -0,0 +1,10 @@ + +#------------------------------------------------------------------------------- +# Include the subcomponents +#------------------------------------------------------------------------------- +include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) +if( XRDCEPH_SUBMODULE ) + add_compile_definitions( XRDCEPH_SUBMODULE ) +endif() +include( XrdCeph ) + diff --git a/src/XrdCeph/src/XrdCeph.cmake b/src/XrdCeph/src/XrdCeph.cmake new file mode 100644 index 00000000000..1a68a7f8296 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph.cmake @@ -0,0 +1,87 @@ +include_directories( ${XROOTD_INCLUDE_DIR} ) +include_directories( ${RADOS_INCLUDE_DIR} ) +include_directories( ${CMAKE_SOURCE_DIR}/src ) + + +#------------------------------------------------------------------------------- +# XrdCephPosix library version +#------------------------------------------------------------------------------- +set( XRD_CEPH_POSIX_VERSION 0.0.1 ) +set( XRD_CEPH_POSIX_SOVERSION 0 ) + +#------------------------------------------------------------------------------- +# The XrdCephPosix library +#------------------------------------------------------------------------------- +add_library( + XrdCephPosix + SHARED + XrdCeph/XrdCephPosix.cc XrdCeph/XrdCephPosix.hh ) + +# needed during the transition between ceph giant and ceph hammer +# for object listing API +set_property(SOURCE XrdCeph/XrdCephPosix.cc + PROPERTY COMPILE_FLAGS " -Wno-deprecated-declarations") + +target_link_libraries( + XrdCephPosix + ${XROOTD_LIBRARIES} + ${RADOS_LIBS} ) + +set_target_properties( + XrdCephPosix + PROPERTIES + VERSION ${XRD_CEPH_POSIX_VERSION} + SOVERSION ${XRD_CEPH_POSIX_SOVERSION} + INTERFACE_LINK_LIBRARIES "" + LINK_INTERFACE_LIBRARIES "" ) + +#------------------------------------------------------------------------------- +# The XrdCeph module +#------------------------------------------------------------------------------- +set( LIB_XRD_CEPH XrdCeph-${PLUGIN_VERSION} ) + +add_library( + ${LIB_XRD_CEPH} + MODULE + XrdCeph/XrdCephOss.cc XrdCeph/XrdCephOss.hh + XrdCeph/XrdCephOssFile.cc XrdCeph/XrdCephOssFile.hh + XrdCeph/XrdCephOssDir.cc XrdCeph/XrdCephOssDir.hh ) + +target_link_libraries( + ${LIB_XRD_CEPH} + ${XROOTD_LIBRARIES} + XrdCephPosix ) + +set_target_properties( + ${LIB_XRD_CEPH} + PROPERTIES + INTERFACE_LINK_LIBRARIES "" + LINK_INTERFACE_LIBRARIES "" ) + +#------------------------------------------------------------------------------- +# The XrdCephXattr module +#------------------------------------------------------------------------------- +set( LIB_XRD_CEPH_XATTR XrdCephXattr-${PLUGIN_VERSION} ) + +add_library( + ${LIB_XRD_CEPH_XATTR} + MODULE + XrdCeph/XrdCephXAttr.cc XrdCeph/XrdCephXAttr.hh ) + +target_link_libraries( + ${LIB_XRD_CEPH_XATTR} + ${XROOTD_LIBRARIES} + XrdCephPosix ) + +set_target_properties( + ${LIB_XRD_CEPH_XATTR} + PROPERTIES + INTERFACE_LINK_LIBRARIES "" + LINK_INTERFACE_LIBRARIES "" ) + +#------------------------------------------------------------------------------- +# Install +#------------------------------------------------------------------------------- +install( + TARGETS ${LIB_XRD_CEPH} ${LIB_XRD_CEPH_XATTR} XrdCephPosix + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/src/XrdCeph/src/XrdCeph/XrdCephOss.cc b/src/XrdCeph/src/XrdCeph/XrdCephOss.cc new file mode 100644 index 00000000000..5a9ada4f51b --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephOss.cc @@ -0,0 +1,259 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#include +#include +#include + +#include "XrdCeph/XrdCephPosix.hh" +#include "XrdOuc/XrdOucEnv.hh" +#include "XrdSys/XrdSysError.hh" +#include "XrdOuc/XrdOucTrace.hh" +#include "XrdOuc/XrdOucStream.hh" +#include "XrdOuc/XrdOucName2Name.hh" +#ifdef XRDCEPH_SUBMODULE +#include "XrdOuc/XrdOucN2NLoader.hh" +#else +#include "private/XrdOuc/XrdOucN2NLoader.hh" +#endif +#include "XrdVersion.hh" +#include "XrdCeph/XrdCephOss.hh" +#include "XrdCeph/XrdCephOssDir.hh" +#include "XrdCeph/XrdCephOssFile.hh" + +XrdVERSIONINFO(XrdOssGetStorageSystem, XrdCephOss); + +XrdSysError XrdCephEroute(0); +XrdOucTrace XrdCephTrace(&XrdCephEroute); + +// log wrapping function to be used by ceph_posix interface +char g_logstring[1024]; +static void logwrapper(char *format, va_list argp) { + vsnprintf(g_logstring, 1024, format, argp); + XrdCephEroute.Say(g_logstring); +} + +/// pointer to library providing Name2Name interface. 0 be default +/// populated in case of ceph.namelib entry in the config file +/// used in XrdCephPosix +extern XrdOucName2Name *g_namelib; + +extern "C" +{ + XrdOss* + XrdOssGetStorageSystem(XrdOss* native_oss, + XrdSysLogger* lp, + const char* config_fn, + const char* parms) + { + // Do the herald thing + XrdCephEroute.SetPrefix("ceph_"); + XrdCephEroute.logger(lp); + XrdCephEroute.Say("++++++ CERN/IT-DSS XrdCeph"); + // set parameters + try { + ceph_posix_set_defaults(parms); + } catch (std::exception &e) { + XrdCephEroute.Say("CephOss loading failed with exception. Check the syntax of parameters : ", parms); + return 0; + } + // deal with logging + ceph_posix_set_logfunc(logwrapper); + return new XrdCephOss(config_fn, XrdCephEroute); + } +} + +XrdCephOss::XrdCephOss(const char *configfn, XrdSysError &Eroute) { + Configure(configfn, Eroute); +} + +XrdCephOss::~XrdCephOss() { + ceph_posix_disconnect_all(); +} + +// declared and used in XrdCephPosix.cc +extern unsigned int g_maxCephPoolIdx; +int XrdCephOss::Configure(const char *configfn, XrdSysError &Eroute) { + int NoGo = 0; + XrdOucEnv myEnv; + XrdOucStream Config(&Eroute, getenv("XRDINSTANCE"), &myEnv, "=====> "); + // If there is no config file, nothing to be done + if (configfn && *configfn) { + // Try to open the configuration file. + int cfgFD; + if ((cfgFD = open(configfn, O_RDONLY, 0)) < 0) { + Eroute.Emsg("Config", errno, "open config file", configfn); + return 1; + } + Config.Attach(cfgFD); + // Now start reading records until eof. + char *var; + while((var = Config.GetMyFirstWord())) { + if (!strncmp(var, "ceph.nbconnections", 18)) { + var = Config.GetWord(); + if (var) { + unsigned long value = strtoul(var, 0, 10); + if (value > 0 and value <= 100) { + g_maxCephPoolIdx = value; + } else { + Eroute.Emsg("Config", "Invalid value for ceph.nbconnections in config file (must be between 1 and 100)", configfn, var); + return 1; + } + } else { + Eroute.Emsg("Config", "Missing value for ceph.nbconnections in config file", configfn); + return 1; + } + } + if (!strncmp(var, "ceph.namelib", 12)) { + var = Config.GetWord(); + if (var) { + // Warn in case parameters were givne + char parms[1040]; + if (!Config.GetRest(parms, sizeof(parms)) || parms[0]) { + Eroute.Emsg("Config", "namelib parameters will be ignored"); + } + // Load name lib + XrdOucN2NLoader n2nLoader(&Eroute,configfn,NULL,NULL,NULL); + g_namelib = n2nLoader.Load(var, XrdVERSIONINFOVAR(XrdOssGetStorageSystem), NULL); + if (!g_namelib) { + Eroute.Emsg("Config", "Unable to load library given in ceph.namelib : %s", var); + } + } else { + Eroute.Emsg("Config", "Missing value for ceph.namelib in config file", configfn); + return 1; + } + } + } + + // Now check if any errors occurred during file i/o + int retc = Config.LastError(); + if (retc) { + NoGo = Eroute.Emsg("Config", -retc, "read config file", + configfn); + } + Config.Close(); + } + return NoGo; +} + +int XrdCephOss::Chmod(const char *path, mode_t mode, XrdOucEnv *envP) { + return -ENOTSUP; +} + +int XrdCephOss::Create(const char *tident, const char *path, mode_t access_mode, + XrdOucEnv &env, int Opts) { + return -ENOTSUP; +} + +int XrdCephOss::Init(XrdSysLogger *logger, const char* configFn) { return 0; } + +//SCS - lie to posix-assuming clients about directories [fixes brittleness in GFAL2] +int XrdCephOss::Mkdir(const char *path, mode_t mode, int mkpath, XrdOucEnv *envP) { + return 0; +} + +//SCS - lie to posix-assuming clients about directories [fixes brittleness in GFAL2] +int XrdCephOss::Remdir(const char *path, int Opts, XrdOucEnv *eP) { + return 0; +} + +int XrdCephOss::Rename(const char *from, + const char *to, + XrdOucEnv *eP1, + XrdOucEnv *eP2) { + return -ENOTSUP; +} + +int XrdCephOss::Stat(const char* path, + struct stat* buff, + int opts, + XrdOucEnv* env) { + try { + if (!strcmp(path, "/")) { + // special case of a stat made by the locate interface + // we intend to then list all files + memset(buff, 0, sizeof(*buff)); + buff->st_mode = S_IFDIR | 0700; + return 0; + } else { + return ceph_posix_stat(env, path, buff); + } + } catch (std::exception &e) { + XrdCephEroute.Say("stat : invalid syntax in file parameters"); + return -EINVAL; + } +} + +int XrdCephOss::StatFS(const char *path, char *buff, int &blen, XrdOucEnv *eP) { + XrdOssVSInfo sP; + int rc = StatVS(&sP, 0, 0); + if (rc) { + return rc; + } + int percentUsedSpace = (sP.Usage*100)/sP.Total; + blen = snprintf(buff, blen, "%d %lld %d %d %lld %d", + 1, sP.Free, percentUsedSpace, 0, 0LL, 0); + return XrdOssOK; +} + +int XrdCephOss::StatVS(XrdOssVSInfo *sP, const char *sname, int updt) { + int rc = ceph_posix_statfs(&(sP->Total), &(sP->Free)); + if (rc) { + return rc; + } + sP->Large = sP->Total; + sP->LFree = sP->Free; + sP->Usage = sP->Total-sP->Free; + sP->Extents = 1; + return XrdOssOK; +} + +int XrdCephOss::Truncate (const char* path, + unsigned long long size, + XrdOucEnv* env) { + try { + return ceph_posix_truncate(env, path, size); + } catch (std::exception &e) { + XrdCephEroute.Say("truncate : invalid syntax in file parameters"); + return -EINVAL; + } +} + +int XrdCephOss::Unlink(const char *path, int Opts, XrdOucEnv *env) { + try { + return ceph_posix_unlink(env, path); + } catch (std::exception &e) { + XrdCephEroute.Say("unlink : invalid syntax in file parameters"); + return -EINVAL; + } +} + +XrdOssDF* XrdCephOss::newDir(const char *tident) { + return new XrdCephOssDir(this); +} + +XrdOssDF* XrdCephOss::newFile(const char *tident) { + return new XrdCephOssFile(this); +} + diff --git a/src/XrdCeph/src/XrdCeph/XrdCephOss.hh b/src/XrdCeph/src/XrdCeph/XrdCephOss.hh new file mode 100644 index 00000000000..838030dc3db --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephOss.hh @@ -0,0 +1,76 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#ifndef __CEPH_OSS_HH__ +#define __CEPH_OSS_HH__ + +#include +#include + +//------------------------------------------------------------------------------ +//! This class implements XrdOss interface for usage with a CEPH storage. +//! It should be loaded via the ofs.osslib directive. +//! +//! This plugin is able to use any pool of ceph with any userId. +//! There are several ways to provide the pool and userId to be used for a given +//! operation. Here is the ordered list of possibilities. +//! First one defined wins : +//! - the path can be prepended with userId and pool. Syntax is : +//! [[userId@]pool:] +//! - the XrdOucEnv parameter, when existing, can have 'cephUserId' and/or +//! 'cephPool' entries +//! - the ofs.osslib directive can provide an argument with format : +//! [userID@]pool +//! - default are 'admin' and 'default' for userId and pool respectively +//! +//! Note that the definition of a default via the ofs.osslib directive may +//! clash with one used in a ofs.xattrlib directive. In case both directives +//! have a default and they are different, the behavior is not defined. +//! In case one of the two only has a default, it will be applied for both plugins. +//------------------------------------------------------------------------------ + +class XrdCephOss : public XrdOss { +public: + XrdCephOss(const char *, XrdSysError &); + virtual ~XrdCephOss(); + + int Configure(const char *, XrdSysError &); + + virtual int Chmod(const char *, mode_t mode, XrdOucEnv *eP=0); + virtual int Create(const char *, const char *, mode_t, XrdOucEnv &, int opts=0); + virtual int Init(XrdSysLogger *, const char*); + virtual int Mkdir(const char *, mode_t mode, int mkpath=0, XrdOucEnv *eP=0); + virtual int Remdir(const char *, int Opts=0, XrdOucEnv *eP=0); + virtual int Rename(const char *, const char *, XrdOucEnv *eP1=0, XrdOucEnv *eP2=0); + virtual int Stat(const char *, struct stat *, int opts=0, XrdOucEnv *eP=0); + virtual int StatFS(const char *path, char *buff, int &blen, XrdOucEnv *eP=0); + virtual int StatVS(XrdOssVSInfo *sP, const char *sname=0, int updt=0); + virtual int Truncate(const char *, unsigned long long, XrdOucEnv *eP=0); + virtual int Unlink(const char *path, int Opts=0, XrdOucEnv *eP=0); + virtual XrdOssDF *newDir(const char *tident); + virtual XrdOssDF *newFile(const char *tident); + +}; + +#endif /* __CEPH_OSS_HH__ */ diff --git a/src/XrdCeph/src/XrdCeph/XrdCephOssDir.cc b/src/XrdCeph/src/XrdCeph/XrdCephOssDir.cc new file mode 100644 index 00000000000..6743edc5e47 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephOssDir.cc @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#include "XrdCeph/XrdCephPosix.hh" +#include "XrdCeph/XrdCephOssDir.hh" +#include "XrdSys/XrdSysError.hh" +#include "XrdOuc/XrdOucTrace.hh" + +extern XrdSysError XrdCephEroute; + +XrdCephOssDir::XrdCephOssDir(XrdCephOss *cephOss) : m_dirp(0), m_cephOss(cephOss) {} + +int XrdCephOssDir::Opendir(const char *path, XrdOucEnv &env) { + try { + m_dirp = ceph_posix_opendir(&env, path); + if (0 == m_dirp) { + return -errno; + } + return XrdOssOK; + } catch (std::exception &e) { + XrdCephEroute.Say("opendir : invalid syntax in file parameters"); + return -EINVAL; + } +} + +int XrdCephOssDir::Close(long long *retsz) { + ceph_posix_closedir(m_dirp); + return XrdOssOK; +} + +int XrdCephOssDir::Readdir(char *buff, int blen) { + return ceph_posix_readdir(m_dirp, buff, blen); +} diff --git a/src/XrdCeph/src/XrdCeph/XrdCephOssDir.hh b/src/XrdCeph/src/XrdCeph/XrdCephOssDir.hh new file mode 100644 index 00000000000..ba94296d3d3 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephOssDir.hh @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#ifndef __XRD_CEPH_OSS_DIR_HH__ +#define __XRD_CEPH_OSS_DIR_HH__ + +#include "XrdOss/XrdOss.hh" +#include "XrdCeph/XrdCephOss.hh" + +//------------------------------------------------------------------------------ +//! This class implements XrdOssDF interface for usage with a CEPH storage. +//! It has a very restricted usage as the only valid path for opendir is '/'. +//! The reason is that ceph is an object store where you can only list all +//! objects, and that has no notion of hierarchy +//! +//! This plugin is able to use any pool of ceph with any userId. +//! There are several ways to provide the pool and userId to be used for a given +//! operation. Here is the ordered list of possibilities. +//! First one defined wins : +//! - the path can be prepended with userId and pool. Syntax is : +//! [[userId@]pool:] +//! - the XrdOucEnv parameter, when existing, can have 'cephUserId' and/or +//! 'cephPool' entries +//! - the ofs.osslib directive can provide an argument with format : +//! [userID@]pool +//! - default are 'admin' and 'default' for userId and pool respectively +//! +//! Note that the definition of a default via the ofs.osslib directive may +//! clash with one used in a ofs.xattrlib directive. In case both directives +//! have a default and they are different, the behavior is not defined. +//! In case one of the two only has a default, it will be applied for both plugins. +//------------------------------------------------------------------------------ + +class XrdCephOssDir : public XrdOssDF { + +public: + + XrdCephOssDir(XrdCephOss *cephoss); + virtual ~XrdCephOssDir() {}; + virtual int Opendir(const char *, XrdOucEnv &); + virtual int Readdir(char *buff, int blen); + virtual int Close(long long *retsz=0); + +private: + + DIR *m_dirp; + XrdCephOss *m_cephOss; + +}; + +#endif /* __XRD_CEPH_OSS_DIR_HH__ */ diff --git a/src/XrdCeph/src/XrdCeph/XrdCephOssFile.cc b/src/XrdCeph/src/XrdCeph/XrdCephOssFile.cc new file mode 100644 index 00000000000..3a0a63f47c7 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephOssFile.cc @@ -0,0 +1,101 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#include +#include + +#include "XrdCeph/XrdCephPosix.hh" +#include "XrdOuc/XrdOucEnv.hh" +#include "XrdSys/XrdSysError.hh" +#include "XrdOuc/XrdOucTrace.hh" +#include "XrdSfs/XrdSfsAio.hh" + +#include "XrdCeph/XrdCephOssFile.hh" +#include "XrdCeph/XrdCephOss.hh" + +extern XrdSysError XrdCephEroute; + +XrdCephOssFile::XrdCephOssFile(XrdCephOss *cephOss) : m_fd(-1), m_cephOss(cephOss) {} + +int XrdCephOssFile::Open(const char *path, int flags, mode_t mode, XrdOucEnv &env) { + try { + int rc = ceph_posix_open(&env, path, flags, mode); + if (rc < 0) return rc; + m_fd = rc; + return XrdOssOK; + } catch (std::exception &e) { + XrdCephEroute.Say("open : invalid syntax in file parameters"); + return -EINVAL; + } +} + +int XrdCephOssFile::Close(long long *retsz) { + return ceph_posix_close(m_fd); +} + +ssize_t XrdCephOssFile::Read(off_t offset, size_t blen) { + return XrdOssOK; +} + +ssize_t XrdCephOssFile::Read(void *buff, off_t offset, size_t blen) { + return ceph_posix_pread(m_fd, buff, blen, offset); +} + +static void aioReadCallback(XrdSfsAio *aiop, size_t rc) { + aiop->Result = rc; + aiop->doneRead(); +} + +int XrdCephOssFile::Read(XrdSfsAio *aiop) { + return ceph_aio_read(m_fd, aiop, aioReadCallback); +} + +ssize_t XrdCephOssFile::ReadRaw(void *buff, off_t offset, size_t blen) { + return Read(buff, offset, blen); +} + +int XrdCephOssFile::Fstat(struct stat *buff) { + return ceph_posix_fstat(m_fd, buff); +} + +ssize_t XrdCephOssFile::Write(const void *buff, off_t offset, size_t blen) { + return ceph_posix_pwrite(m_fd, buff, blen, offset); +} + +static void aioWriteCallback(XrdSfsAio *aiop, size_t rc) { + aiop->Result = rc; + aiop->doneWrite(); +} + +int XrdCephOssFile::Write(XrdSfsAio *aiop) { + return ceph_aio_write(m_fd, aiop, aioWriteCallback); +} + +int XrdCephOssFile::Fsync() { + return ceph_posix_fsync(m_fd); +} + +int XrdCephOssFile::Ftruncate(unsigned long long len) { + return ceph_posix_ftruncate(m_fd, len); +} diff --git a/src/XrdCeph/src/XrdCeph/XrdCephOssFile.hh b/src/XrdCeph/src/XrdCeph/XrdCephOssFile.hh new file mode 100644 index 00000000000..6b0425ea951 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephOssFile.hh @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#ifndef __XRD_CEPH_OSS_FILE_HH__ +#define __XRD_CEPH_OSS_FILE_HH__ + +#include "XrdOss/XrdOss.hh" +#include "XrdCeph/XrdCephOss.hh" + +//------------------------------------------------------------------------------ +//! This class implements XrdOssDF interface for usage with a CEPH storage. +//! +//! This plugin is able to use any pool of ceph with any userId. +//! There are several ways to provide the pool and userId to be used for a given +//! operation. Here is the ordered list of possibilities. +//! First one defined wins : +//! - the path can be prepended with userId and pool. Syntax is : +//! [[userId@]pool:] +//! - the XrdOucEnv parameter, when existing, can have 'cephUserId' and/or +//! 'cephPool' entries +//! - the ofs.osslib directive can provide an argument with format : +//! [userID@]pool +//! - default are 'admin' and 'default' for userId and pool respectively +//! +//! Note that the definition of a default via the ofs.osslib directive may +//! clash with one used in a ofs.xattrlib directive. In case both directives +//! have a default and they are different, the behavior is not defined. +//! In case one of the two only has a default, it will be applied for both plugins. +//------------------------------------------------------------------------------ + +class XrdCephOssFile : public XrdOssDF { + +public: + + XrdCephOssFile(XrdCephOss *cephoss); + virtual ~XrdCephOssFile() {}; + virtual int Open(const char *path, int flags, mode_t mode, XrdOucEnv &env); + virtual int Close(long long *retsz=0); + virtual ssize_t Read(off_t offset, size_t blen); + virtual ssize_t Read(void *buff, off_t offset, size_t blen); + virtual int Read(XrdSfsAio *aiop); + virtual ssize_t ReadRaw(void *, off_t, size_t); + virtual int Fstat(struct stat *buff); + virtual ssize_t Write(const void *buff, off_t offset, size_t blen); + virtual int Write(XrdSfsAio *aiop); + virtual int Fsync(void); + virtual int Ftruncate(unsigned long long); + +private: + + int m_fd; + XrdCephOss *m_cephOss; + +}; + +#endif /* __XRD_CEPH_OSS_FILE_HH__ */ diff --git a/src/XrdCeph/src/XrdCeph/XrdCephPosix.cc b/src/XrdCeph/src/XrdCeph/XrdCephPosix.cc new file mode 100644 index 00000000000..2e31e528774 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephPosix.cc @@ -0,0 +1,1323 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +/* + * This interface provides wrapper methods for using ceph through a POSIX API. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "XrdSfs/XrdSfsAio.hh" +#include "XrdSys/XrdSysPthread.hh" +#include "XrdOuc/XrdOucName2Name.hh" +#include "XrdSys/XrdSysPlatform.hh" + +#include "XrdCeph/XrdCephPosix.hh" + +/// small structs to store file metadata +struct CephFile { + std::string name; + std::string pool; + std::string userId; + unsigned int nbStripes; + unsigned long long stripeUnit; + unsigned long long objectSize; +}; + +struct CephFileRef : CephFile { + int flags; + mode_t mode; + uint64_t offset; + // This mutex protects against parallel updates of the stats. + XrdSysMutex statsMutex; + uint64_t maxOffsetWritten; + uint64_t bytesAsyncWritePending; + uint64_t bytesWritten; + unsigned rdcount; + unsigned wrcount; + unsigned asyncRdStartCount; + unsigned asyncRdCompletionCount; + unsigned asyncWrStartCount; + unsigned asyncWrCompletionCount; + ::timeval lastAsyncSubmission; + double longestAsyncWriteTime; + double longestCallbackInvocation; +}; + +/// small struct for directory listing +struct DirIterator { + librados::NObjectIterator m_iterator; + librados::IoCtx *m_ioctx; +}; + +/// small struct for aio API callbacks +struct AioArgs { + AioArgs(XrdSfsAio* a, AioCB *b, size_t n, int _fd, ceph::bufferlist *_bl=0) : + aiop(a), callback(b), nbBytes(n), fd(_fd), bl(_bl) { ::gettimeofday(&startTime, nullptr); } + XrdSfsAio* aiop; + AioCB *callback; + size_t nbBytes; + int fd; + ::timeval startTime; + ceph::bufferlist *bl; +}; + +/// global variables holding stripers/ioCtxs/cluster objects +/// Note that we have a pool of them to circumvent the limitation +/// of having a single objecter/messenger per IoCtx +typedef std::map StriperDict; +std::vector g_radosStripers; +typedef std::map IOCtxDict; +std::vector g_ioCtx; +std::vector g_cluster; +/// mutex protecting the striper and ioctx maps +XrdSysMutex g_striper_mutex; +/// index of current Striper/IoCtx to be used +unsigned int g_cephPoolIdx = 0; +/// size of the Striper/IoCtx pool, defaults to 1 +/// may be overwritten in the configuration file +/// (See XrdCephOss::configure) +unsigned int g_maxCephPoolIdx = 1; +/// pointer to library providing Name2Name interface. 0 be default +/// populated in case of ceph.namelib entry in the config file in XrdCephOss +XrdOucName2Name *g_namelib = 0; + +/// global variable holding a list of files currently opened for write +std::multiset g_filesOpenForWrite; +/// global variable holding a map of file descriptor to file reference +std::map g_fds; +/// global variable remembering the next available file descriptor +unsigned int g_nextCephFd = 0; +/// mutex protecting the map of file descriptors and the openForWrite multiset +XrdSysMutex g_fd_mutex; +/// mutex protecting initialization of ceph clusters +XrdSysMutex g_init_mutex; + +/// Accessor to next ceph pool index +/// Note that this is not thread safe, but we do not care +/// as we only want a rough load balancing +unsigned int getCephPoolIdxAndIncrease() { + if (g_radosStripers.size() == 0) { + // make sure we do not have a race condition here + XrdSysMutexHelper lock(g_init_mutex); + // double check now that we have the lock + if (g_radosStripers.size() == 0) { + // initialization phase : allocate corresponding places in the vectors + for (unsigned int i = 0; i < g_maxCephPoolIdx; i++) { + g_radosStripers.push_back(StriperDict()); + g_ioCtx.push_back(IOCtxDict()); + g_cluster.push_back(0); + } + } + } + unsigned int res = g_cephPoolIdx; + unsigned nextValue = g_cephPoolIdx+1; + if (nextValue >= g_maxCephPoolIdx) { + nextValue = 0; + } + g_cephPoolIdx = nextValue; + return res; +} + +/// check whether a file is open for write +bool isOpenForWrite(std::string& name) { + XrdSysMutexHelper lock(g_fd_mutex); + return g_filesOpenForWrite.find(name) != g_filesOpenForWrite.end(); +} + +/// look for a FileRef from its file descriptor +CephFileRef* getFileRef(int fd) { + XrdSysMutexHelper lock(g_fd_mutex); + std::map::iterator it = g_fds.find(fd); + if (it != g_fds.end()) { + // We will release the lock upon exiting this function. + // The structure here is not protected from deletion, but we trust xrootd to + // ensure close (which does the deletion) will not be called before all previous + // calls are complete (including the async ones). + return &(it->second); + } else { + return 0; + } +} + +/// deletes a FileRef from the global table of file descriptors +void deleteFileRef(int fd, const CephFileRef &fr) { + XrdSysMutexHelper lock(g_fd_mutex); + if (fr.flags & (O_WRONLY|O_RDWR)) { + g_filesOpenForWrite.erase(g_filesOpenForWrite.find(fr.name)); + } + std::map::iterator it = g_fds.find(fd); + if (it != g_fds.end()) { + g_fds.erase(it); + } +} + +/** + * inserts a new FileRef into the global table of file descriptors + * and return the associated file descriptor + */ +int insertFileRef(CephFileRef &fr) { + XrdSysMutexHelper lock(g_fd_mutex); + g_fds[g_nextCephFd] = fr; + g_nextCephFd++; + if (fr.flags & (O_WRONLY|O_RDWR)) { + g_filesOpenForWrite.insert(fr.name); + } + return g_nextCephFd-1; +} + +/// global variable containing defaults for CephFiles +CephFile g_defaultParams = { "", + "default", // default pool + "admin", // default user + 1, // default nbStripes + 4 * 1024 * 1024, // default stripeUnit : 4 MB + 4 * 1024 * 1024}; // default objectSize : 4 MB + +std::string g_defaultUserId = "admin"; +std::string g_defaultPool = "default"; + +/// global variable for the log function +static void (*g_logfunc) (char *, va_list argp) = 0; + +static void logwrapper(char* format, ...) { + if (0 == g_logfunc) return; + va_list arg; + va_start(arg, format); + (*g_logfunc)(format, arg); + va_end(arg); +} + +/// simple integer parsing, to be replaced by std::stoll when C++11 can be used +static unsigned long long int stoull(const std::string &s) { + char* end; + errno = 0; + unsigned long long int res = strtoull(s.c_str(), &end, 10); + if (0 != *end) { + throw std::invalid_argument(s); + } + if (ERANGE == errno) { + throw std::out_of_range(s); + } + return res; +} + +/// simple integer parsing, to be replaced by std::stoi when C++11 can be used +static unsigned int stoui(const std::string &s) { + char* end; + errno = 0; + unsigned long int res = strtoul(s.c_str(), &end, 10); + if (0 != *end) { + throw std::invalid_argument(s); + } + if (ERANGE == errno || res > std::numeric_limits::max()) { + throw std::out_of_range(s); + } + return (unsigned int)res; +} + +/// fills the userId of a ceph file struct from a string and an environment +/// returns position of first character after the userId +static int fillCephUserId(const std::string ¶ms, XrdOucEnv *env, CephFile &file) { + // default + file.userId = g_defaultParams.userId; + // parsing + size_t atPos = params.find('@'); + if (std::string::npos != atPos) { + file.userId = params.substr(0, atPos); + return atPos+1; + } else { + if (0 != env) { + char* cuser = env->Get("cephUserId"); + if (0 != cuser) { + file.userId = cuser; + } + } + return 0; + } +} + +/// fills the pool of a ceph file struct from a string and an environment +/// returns position of first character after the pool +static int fillCephPool(const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) { + // default + file.pool = g_defaultParams.pool; + // parsing + size_t comPos = params.find(',', offset); + if (std::string::npos == comPos) { + if (params.size() == offset) { + if (NULL != env) { + char* cpool = env->Get("cephPool"); + if (0 != cpool) { + file.pool = cpool; + } + } + } else { + file.pool = params.substr(offset); + } + return params.size(); + } else { + file.pool = params.substr(offset, comPos-offset); + return comPos+1; + } +} + +/// fills the nbStriped of a ceph file struct from a string and an environment +/// returns position of first character after the nbStripes +// this may raise std::invalid_argument and std::out_of_range +static int fillCephNbStripes(const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) { + // default + file.nbStripes = g_defaultParams.nbStripes; + // parsing + size_t comPos = params.find(',', offset); + if (std::string::npos == comPos) { + if (params.size() == offset) { + if (NULL != env) { + char* cNbStripes = env->Get("cephNbStripes"); + if (0 != cNbStripes) { + file.nbStripes = stoui(cNbStripes); + } + } + } else { + file.nbStripes = stoui(params.substr(offset)); + } + return params.size(); + } else { + file.nbStripes = stoui(params.substr(offset, comPos-offset)); + return comPos+1; + } +} + +/// fills the stripeUnit of a ceph file struct from a string and an environment +/// returns position of first character after the stripeUnit +// this may raise std::invalid_argument and std::out_of_range +static int fillCephStripeUnit(const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) { + // default + file.stripeUnit = g_defaultParams.stripeUnit; + // parsing + size_t comPos = params.find(',', offset); + if (std::string::npos == comPos) { + if (params.size() == offset) { + if (NULL != env) { + char* cStripeUnit = env->Get("cephStripeUnit"); + if (0 != cStripeUnit) { + file.stripeUnit = ::stoull(cStripeUnit); + } + } + } else { + file.stripeUnit = ::stoull(params.substr(offset)); + } + return params.size(); + } else { + file.stripeUnit = ::stoull(params.substr(offset, comPos-offset)); + return comPos+1; + } +} + +/// fills the objectSize of a ceph file struct from a string and an environment +/// returns position of first character after the objectSize +// this may raise std::invalid_argument and std::out_of_range +static void fillCephObjectSize(const std::string ¶ms, unsigned int offset, XrdOucEnv *env, CephFile &file) { + // default + file.objectSize = g_defaultParams.objectSize; + // parsing + if (params.size() == offset) { + if (NULL != env) { + char* cObjectSize = env->Get("cephObjectSize"); + if (0 != cObjectSize) { + file.objectSize = ::stoull(cObjectSize); + } + } + } else { + file.objectSize = ::stoull(params.substr(offset)); + } +} + +/// fill the parameters of a ceph file struct (all but name) from a string and an environment +/// see fillCephFile for the detailed syntax +void fillCephFileParams(const std::string ¶ms, XrdOucEnv *env, CephFile &file) { + // parse the params one by one + unsigned int afterUser = fillCephUserId(params, env, file); + unsigned int afterPool = fillCephPool(params, afterUser, env, file); + unsigned int afterNbStripes = fillCephNbStripes(params, afterPool, env, file); + unsigned int afterStripeUnit = fillCephStripeUnit(params, afterNbStripes, env, file); + fillCephObjectSize(params, afterStripeUnit, env, file); +} + +/// sets the default userId, pool and file layout +/// syntax is [user@]pool[,nbStripes[,stripeUnit[,objectSize]]] +/// may throw std::invalid_argument or std::out_of_range in case of error +void ceph_posix_set_defaults(const char* value) { + if (value) { + CephFile newdefault; + fillCephFileParams(value, NULL, newdefault); + g_defaultParams = newdefault; + } +} + +/// converts a logical filename to physical one if needed +void translateFileName(std::string &physName, std::string logName){ + if (0 != g_namelib) { + char physCName[MAXPATHLEN+1]; + int retc = g_namelib->lfn2pfn(logName.c_str(), physCName, sizeof(physCName)); + if (retc) { + logwrapper((char*)"ceph_namelib : failed to translate %s using namelib plugin, using it as is", logName.c_str()); + physName = logName; + } else { + physName = physCName; + } + } else { + physName = logName; + } +} + +/// fill a ceph file struct from a path and an environment +void fillCephFile(const char *path, XrdOucEnv *env, CephFile &file) { + // Syntax of the given path is : + // [[userId@]pool[,nbStripes[,stripeUnit[,objectSize]]]:] + // for the missing parts, if env is not null the entries + // cephUserId, cephPool, cephNbStripes, cephStripeUnit, and cephObjectSize + // of env will be used. + // If env is null or no entry is found for what is missing, defaults are + // applied. These defaults are initially set to 'admin', 'default', 1, 4MB and 4MB + // but can be changed via a call to ceph_posix_set_defaults + std::string spath = path; + size_t colonPos = spath.find(':'); + if (std::string::npos == colonPos) { + // deal with name translation + translateFileName(file.name, spath); + fillCephFileParams("", env, file); + } else { + translateFileName(file.name, spath.substr(colonPos+1)); + fillCephFileParams(spath.substr(0, colonPos), env, file); + } +} + +static CephFile getCephFile(const char *path, XrdOucEnv *env) { + CephFile file; + fillCephFile(path, env, file); + return file; +} + +static CephFileRef getCephFileRef(const char *path, XrdOucEnv *env, int flags, + mode_t mode, unsigned long long offset) { + CephFileRef fr; + fillCephFile(path, env, fr); + fr.flags = flags; + fr.mode = mode; + fr.offset = 0; + fr.maxOffsetWritten = 0; + fr.bytesAsyncWritePending = 0; + fr.bytesWritten = 0; + fr.rdcount = 0; + fr.wrcount = 0; + fr.asyncRdStartCount = 0; + fr.asyncRdCompletionCount = 0; + fr.asyncWrStartCount = 0; + fr.asyncWrCompletionCount = 0; + fr.lastAsyncSubmission.tv_sec = 0; + fr.lastAsyncSubmission.tv_usec = 0; + fr.longestAsyncWriteTime = 0.0l; + fr.longestCallbackInvocation = 0.0l; + return fr; +} + +inline librados::Rados* checkAndCreateCluster(unsigned int cephPoolIdx, + std::string userId = g_defaultParams.userId) { + if (0 == g_cluster[cephPoolIdx]) { + // create connection to cluster + librados::Rados *cluster = new librados::Rados; + if (0 == cluster) { + return 0; + } + int rc = cluster->init(userId.c_str()); + if (rc) { + logwrapper((char*)"checkAndCreateCluster : cluster init failed"); + delete cluster; + return 0; + } + rc = cluster->conf_read_file(NULL); + if (rc) { + logwrapper((char*)"checkAndCreateCluster : cluster read config failed, rc = %d", rc); + cluster->shutdown(); + delete cluster; + return 0; + } + cluster->conf_parse_env(NULL); + rc = cluster->connect(); + if (rc) { + logwrapper((char*)"checkAndCreateCluster : cluster connect failed, rc = %d", rc); + cluster->shutdown(); + delete cluster; + return 0; + } + g_cluster[cephPoolIdx] = cluster; + } + return g_cluster[cephPoolIdx]; +} + +int checkAndCreateStriper(unsigned int cephPoolIdx, std::string &userAtPool, const CephFile& file) { + StriperDict &sDict = g_radosStripers[cephPoolIdx]; + StriperDict::iterator it = sDict.find(userAtPool); + if (it == sDict.end()) { + // we need to create a new radosStriper + // Get a cluster + librados::Rados* cluster = checkAndCreateCluster(cephPoolIdx, file.userId); + if (0 == cluster) { + logwrapper((char*)"checkAndCreateStriper : checkAndCreateCluster failed"); + return 0; + } + // create IoCtx for our pool + librados::IoCtx *ioctx = new librados::IoCtx; + if (0 == ioctx) { + logwrapper((char*)"checkAndCreateStriper : IoCtx instantiation failed"); + cluster->shutdown(); + delete cluster; + g_cluster[cephPoolIdx] = 0; + return 0; + } + int rc = g_cluster[cephPoolIdx]->ioctx_create(file.pool.c_str(), *ioctx); + if (rc != 0) { + logwrapper((char*)"checkAndCreateStriper : ioctx_create failed, rc = %d", rc); + cluster->shutdown(); + delete cluster; + g_cluster[cephPoolIdx] = 0; + delete ioctx; + return 0; + } + // create RadosStriper connection + libradosstriper::RadosStriper *striper = new libradosstriper::RadosStriper; + if (0 == striper) { + logwrapper((char*)"checkAndCreateStriper : RadosStriper instantiation failed"); + delete ioctx; + cluster->shutdown(); + delete cluster; + g_cluster[cephPoolIdx] = 0; + return 0; + } + rc = libradosstriper::RadosStriper::striper_create(*ioctx, striper); + if (rc != 0) { + logwrapper((char*)"checkAndCreateStriper : striper_create failed, rc = %d", rc); + delete striper; + delete ioctx; + cluster->shutdown(); + delete cluster; + g_cluster[cephPoolIdx] = 0; + return 0; + } + // setup layout + rc = striper->set_object_layout_stripe_count(file.nbStripes); + if (rc != 0) { + logwrapper((char*)"checkAndCreateStriper : invalid nbStripes %d", file.nbStripes); + delete striper; + delete ioctx; + cluster->shutdown(); + delete cluster; + g_cluster[cephPoolIdx] = 0; + return 0; + } + rc = striper->set_object_layout_stripe_unit(file.stripeUnit); + if (rc != 0) { + logwrapper((char*)"checkAndCreateStriper : invalid stripeUnit %d (must be non 0, multiple of 64K)", file.stripeUnit); + delete striper; + delete ioctx; + cluster->shutdown(); + delete cluster; + g_cluster[cephPoolIdx] = 0; + return 0; + } + rc = striper->set_object_layout_object_size(file.objectSize); + if (rc != 0) { + logwrapper((char*)"checkAndCreateStriper : invalid objectSize %d (must be non 0, multiple of stripe_unit)", file.objectSize); + delete striper; + delete ioctx; + cluster->shutdown(); + delete cluster; + g_cluster[cephPoolIdx] = 0; + return 0; + } + IOCtxDict & ioDict = g_ioCtx[cephPoolIdx]; + ioDict.insert(std::pair(userAtPool, ioctx)); + sDict.insert(std::pair + (userAtPool, striper)).first; + } + return 1; +} + +static libradosstriper::RadosStriper* getRadosStriper(const CephFile& file) { + XrdSysMutexHelper lock(g_striper_mutex); + std::stringstream ss; + ss << file.userId << '@' << file.pool << ',' << file.nbStripes << ',' + << file.stripeUnit << ',' << file.objectSize; + std::string userAtPool = ss.str(); + unsigned int cephPoolIdx = getCephPoolIdxAndIncrease(); + if (checkAndCreateStriper(cephPoolIdx, userAtPool, file) == 0) { + logwrapper((char*)"getRadosStriper : checkAndCreateStriper failed"); + return 0; + } + return g_radosStripers[cephPoolIdx][userAtPool]; +} + +static librados::IoCtx* getIoCtx(const CephFile& file) { + XrdSysMutexHelper lock(g_striper_mutex); + std::stringstream ss; + ss << file.userId << '@' << file.pool << ',' << file.nbStripes << ',' + << file.stripeUnit << ',' << file.objectSize; + std::string userAtPool = ss.str(); + unsigned int cephPoolIdx = getCephPoolIdxAndIncrease(); + if (checkAndCreateStriper(cephPoolIdx, userAtPool, file) == 0) { + return 0; + } + return g_ioCtx[cephPoolIdx][userAtPool]; +} + +void ceph_posix_disconnect_all() { + XrdSysMutexHelper lock(g_striper_mutex); + for (unsigned int i= 0; i < g_maxCephPoolIdx; i++) { + for (StriperDict::iterator it2 = g_radosStripers[i].begin(); + it2 != g_radosStripers[i].end(); + it2++) { + delete it2->second; + } + for (IOCtxDict::iterator it2 = g_ioCtx[i].begin(); + it2 != g_ioCtx[i].end(); + it2++) { + delete it2->second; + } + delete g_cluster[i]; + } + g_radosStripers.clear(); + g_ioCtx.clear(); + g_cluster.clear(); +} + +void ceph_posix_set_logfunc(void (*logfunc) (char *, va_list argp)) { + g_logfunc = logfunc; +}; + +static int ceph_posix_internal_truncate(const CephFile &file, unsigned long long size); + +/** + * * brief ceph_posix_open function opens a file for read or write + * * details This function either: + * * Opens a file for reading. If the file doesn't exist, this is an error. + * * Opens a file for writing. If the file already exists, check whether overwrite has been requested. If overwrite + * * hasn't been requested for an existing file, this is an error. + * * param env XrdOucEnv* Unused + * * param pathname const char* Specify the file to open. + * * param flags int Indicates whether reading or writing, and whether to overwrite an existing file. + * * param mode mode_t Unused + * * return int This is a file descriptor (non-negative) if the operation is successful, + * * or an error code (negative value) if the operation fails + * */ + +int ceph_posix_open(XrdOucEnv* env, const char *pathname, int flags, mode_t mode){ + + CephFileRef fr = getCephFileRef(pathname, env, flags, mode, 0); + + struct stat buf; + libradosstriper::RadosStriper *striper = getRadosStriper(fr); //Get a handle to the RADOS striper API + + if (NULL == striper) { + logwrapper((char*)"Cannot create striper"); + return -EINVAL; + } + + int rc = striper->stat(fr.name, (uint64_t*)&(buf.st_size), &(buf.st_atime)); //Get details about a file + + + bool fileExists = (rc != -ENOENT); //Make clear what condition we are testing + + if ((flags&O_ACCMODE) == O_RDONLY) { // Access mode is READ + + if (fileExists) { + int fd = insertFileRef(fr); + logwrapper((char*)"File descriptor %d associated to file %s opened in read mode", fd, pathname); + return fd; + } else { + return -ENOENT; + } + + } else { // Access mode is WRITE + if (fileExists) { + if (flags & O_TRUNC) { + int rc = ceph_posix_unlink(env, pathname); + if (rc < 0 && rc != -ENOENT) { + return rc; + } + } else { + return -EEXIST; + } + } + // At this point, we know either the target file didn't exist, or the ceph_posix_unlink above removed it + int fd = insertFileRef(fr); + logwrapper((char*)"File descriptor %d associated to file %s opened in write mode", fd, pathname); + return fd; + + } + +} + +int ceph_posix_close(int fd) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + ::timeval now; + ::gettimeofday(&now, nullptr); + XrdSysMutexHelper lock(fr->statsMutex); + double lastAsyncAge = 0.0; + // Only compute an age if the starting point was set. + if (fr->lastAsyncSubmission.tv_sec && fr->lastAsyncSubmission.tv_usec) { + lastAsyncAge = 1.0 * (now.tv_sec - fr->lastAsyncSubmission.tv_sec) + + 0.000001 * (now.tv_usec - fr->lastAsyncSubmission.tv_usec); + } + logwrapper((char*)"ceph_close: closed fd %d for file %s, read ops count %d, write ops count %d, " + "async write ops %d/%d, async pending write bytes %ld, " + "async read ops %d/%d, bytes written/max offset %ld/%ld, " + "longest async write %f, longest callback invocation %f, last async op age %f", + fd, fr->name.c_str(), fr->rdcount, fr->wrcount, + fr->asyncWrCompletionCount, fr->asyncWrStartCount, fr->bytesAsyncWritePending, + fr->asyncRdCompletionCount, fr->asyncRdStartCount, fr->bytesWritten, fr->maxOffsetWritten, + fr->longestAsyncWriteTime, fr->longestCallbackInvocation, (lastAsyncAge)); + deleteFileRef(fd, *fr); + return 0; + } else { + return -EBADF; + } +} + +static off64_t lseek_compute_offset(CephFileRef &fr, off64_t offset, int whence) { + switch (whence) { + case SEEK_SET: + fr.offset = offset; + break; + case SEEK_CUR: + fr.offset += offset; + break; + default: + return -EINVAL; + } + return fr.offset; +} + +off_t ceph_posix_lseek(int fd, off_t offset, int whence) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_lseek: for fd %d, offset=%lld, whence=%d", fd, offset, whence); + return (off_t)lseek_compute_offset(*fr, offset, whence); + } else { + return -EBADF; + } +} + +off64_t ceph_posix_lseek64(int fd, off64_t offset, int whence) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_lseek64: for fd %d, offset=%lld, whence=%d", fd, offset, whence); + return lseek_compute_offset(*fr, offset, whence); + } else { + return -EBADF; + } +} + +ssize_t ceph_posix_write(int fd, const void *buf, size_t count) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_write: for fd %d, count=%d", fd, count); + if ((fr->flags & (O_WRONLY|O_RDWR)) == 0) { + return -EBADF; + } + libradosstriper::RadosStriper *striper = getRadosStriper(*fr); + if (0 == striper) { + return -EINVAL; + } + ceph::bufferlist bl; + bl.append((const char*)buf, count); + int rc = striper->write(fr->name, bl, count, fr->offset); + if (rc) return rc; + fr->offset += count; + XrdSysMutexHelper lock(fr->statsMutex); + fr->wrcount++; + fr->bytesWritten+=count; + if (fr->offset) fr->maxOffsetWritten = std::max(fr->offset - 1, fr->maxOffsetWritten); + return count; + } else { + return -EBADF; + } +} + +ssize_t ceph_posix_pwrite(int fd, const void *buf, size_t count, off64_t offset) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + // TODO implement proper logging level for this plugin - this should be only debug + //logwrapper((char*)"ceph_write: for fd %d, count=%d", fd, count); + if ((fr->flags & (O_WRONLY|O_RDWR)) == 0) { + return -EBADF; + } + libradosstriper::RadosStriper *striper = getRadosStriper(*fr); + if (0 == striper) { + return -EINVAL; + } + ceph::bufferlist bl; + bl.append((const char*)buf, count); + int rc = striper->write(fr->name, bl, count, offset); + if (rc) return rc; + XrdSysMutexHelper lock(fr->statsMutex); + fr->wrcount++; + fr->bytesWritten+=count; + if (offset + count) fr->maxOffsetWritten = std::max(uint64_t(offset + count - 1), fr->maxOffsetWritten); + return count; + } else { + return -EBADF; + } +} + +static void ceph_aio_write_complete(rados_completion_t c, void *arg) { + AioArgs *awa = reinterpret_cast(arg); + size_t rc = rados_aio_get_return_value(c); + // Compute statistics before reportng to xrootd, so that a close cannot happen + // in the meantime. + CephFileRef* fr = getFileRef(awa->fd); + if (fr) { + XrdSysMutexHelper lock(fr->statsMutex); + fr->asyncWrCompletionCount++; + fr->bytesAsyncWritePending -= awa->nbBytes; + fr->bytesWritten += awa->nbBytes; + if (awa->aiop->sfsAio.aio_nbytes) + fr->maxOffsetWritten = std::max(fr->maxOffsetWritten, uint64_t(awa->aiop->sfsAio.aio_offset + awa->aiop->sfsAio.aio_nbytes - 1)); + ::timeval now; + ::gettimeofday(&now, nullptr); + double writeTime = 0.000001 * (now.tv_usec - awa->startTime.tv_usec) + 1.0 * (now.tv_sec - awa->startTime.tv_sec); + fr->longestAsyncWriteTime = std::max(fr->longestAsyncWriteTime, writeTime); + } + ::timeval before, after; + if (fr) ::gettimeofday(&before, nullptr); + awa->callback(awa->aiop, rc == 0 ? awa->nbBytes : rc); + if (fr) { + ::gettimeofday(&after, nullptr); + double callbackInvocationTime = 0.000001 * (after.tv_usec - before.tv_usec) + 1.0 * (after.tv_sec - before.tv_sec); + XrdSysMutexHelper lock(fr->statsMutex); + fr->longestCallbackInvocation = std::max(fr->longestCallbackInvocation, callbackInvocationTime); + } + delete(awa); +} + +ssize_t ceph_aio_write(int fd, XrdSfsAio *aiop, AioCB *cb) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + // get the parameters from the Xroot aio object + size_t count = aiop->sfsAio.aio_nbytes; + const char *buf = (const char*)aiop->sfsAio.aio_buf; + size_t offset = aiop->sfsAio.aio_offset; + // TODO implement proper logging level for this plugin - this should be only debug + //logwrapper((char*)"ceph_aio_write: for fd %d, count=%d", fd, count); + if ((fr->flags & (O_WRONLY|O_RDWR)) == 0) { + return -EBADF; + } + // get the striper object + libradosstriper::RadosStriper *striper = getRadosStriper(*fr); + if (0 == striper) { + return -EINVAL; + } + // prepare a bufferlist around the given buffer + ceph::bufferlist bl; + bl.append(buf, count); + // get the poolIdx to use + int cephPoolIdx = getCephPoolIdxAndIncrease(); + // Get the cluster to use + librados::Rados* cluster = checkAndCreateCluster(cephPoolIdx); + if (0 == cluster) { + return -EINVAL; + } + // prepare a ceph AioCompletion object and do async call + AioArgs *args = new AioArgs(aiop, cb, count, fd); + librados::AioCompletion *completion = + cluster->aio_create_completion(args, ceph_aio_write_complete, NULL); + // do the write + int rc = striper->aio_write(fr->name, completion, bl, count, offset); + completion->release(); + XrdSysMutexHelper lock(fr->statsMutex); + fr->asyncWrStartCount++; + ::gettimeofday(&fr->lastAsyncSubmission, nullptr); + fr->bytesAsyncWritePending+=count; + return rc; + } else { + return -EBADF; + } +} + +ssize_t ceph_posix_read(int fd, void *buf, size_t count) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + // TODO implement proper logging level for this plugin - this should be only debug + //logwrapper((char*)"ceph_read: for fd %d, count=%d", fd, count); + if ((fr->flags & O_WRONLY) != 0) { + return -EBADF; + } + libradosstriper::RadosStriper *striper = getRadosStriper(*fr); + if (0 == striper) { + return -EINVAL; + } + ceph::bufferlist bl; + int rc = striper->read(fr->name, &bl, count, fr->offset); + if (rc < 0) return rc; + bl.begin().copy(rc, (char*)buf); + XrdSysMutexHelper lock(fr->statsMutex); + fr->offset += rc; + fr->rdcount++; + return rc; + } else { + return -EBADF; + } +} + +ssize_t ceph_posix_pread(int fd, void *buf, size_t count, off64_t offset) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + // TODO implement proper logging level for this plugin - this should be only debug + //logwrapper((char*)"ceph_read: for fd %d, count=%d", fd, count); + if ((fr->flags & O_WRONLY) != 0) { + return -EBADF; + } + libradosstriper::RadosStriper *striper = getRadosStriper(*fr); + if (0 == striper) { + return -EINVAL; + } + ceph::bufferlist bl; + int rc = striper->read(fr->name, &bl, count, offset); + if (rc < 0) return rc; + bl.begin().copy(rc, (char*)buf); + XrdSysMutexHelper lock(fr->statsMutex); + fr->rdcount++; + return rc; + } else { + return -EBADF; + } +} + +static void ceph_aio_read_complete(rados_completion_t c, void *arg) { + AioArgs *awa = reinterpret_cast(arg); + size_t rc = rados_aio_get_return_value(c); + if (awa->bl) { + if (rc > 0) { + awa->bl->begin().copy(rc, (char*)awa->aiop->sfsAio.aio_buf); + } + delete awa->bl; + awa->bl = 0; + } + // Compute statistics before reportng to xrootd, so that a close cannot happen + // in the meantime. + CephFileRef* fr = getFileRef(awa->fd); + if (fr) { + XrdSysMutexHelper lock(fr->statsMutex); + fr->asyncRdCompletionCount++; + } + awa->callback(awa->aiop, rc ); + delete(awa); +} + +ssize_t ceph_aio_read(int fd, XrdSfsAio *aiop, AioCB *cb) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + // get the parameters from the Xroot aio object + size_t count = aiop->sfsAio.aio_nbytes; + size_t offset = aiop->sfsAio.aio_offset; + // TODO implement proper logging level for this plugin - this should be only debug + //logwrapper((char*)"ceph_aio_read: for fd %d, count=%d", fd, count); + if ((fr->flags & O_WRONLY) != 0) { + return -EBADF; + } + // get the striper object + libradosstriper::RadosStriper *striper = getRadosStriper(*fr); + if (0 == striper) { + return -EINVAL; + } + // prepare a bufferlist to receive data + ceph::bufferlist *bl = new ceph::bufferlist(); + // get the poolIdx to use + int cephPoolIdx = getCephPoolIdxAndIncrease(); + // Get the cluster to use + librados::Rados* cluster = checkAndCreateCluster(cephPoolIdx); + if (0 == cluster) { + return -EINVAL; + } + // prepare a ceph AioCompletion object and do async call + AioArgs *args = new AioArgs(aiop, cb, count, fd, bl); + librados::AioCompletion *completion = + cluster->aio_create_completion(args, ceph_aio_read_complete, NULL); + // do the read + int rc = striper->aio_read(fr->name, completion, bl, count, offset); + completion->release(); + XrdSysMutexHelper lock(fr->statsMutex); + fr->asyncRdStartCount++; + return rc; + } else { + return -EBADF; + } +} + +int ceph_posix_fstat(int fd, struct stat *buf) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_stat: fd %d", fd); + // minimal stat : only size and times are filled + // atime, mtime and ctime are set all to the same value + // mode is set arbitrarily to 0666 | S_IFREG + libradosstriper::RadosStriper *striper = getRadosStriper(*fr); + if (0 == striper) { + logwrapper((char*)"ceph_stat: getRadosStriper failed"); + return -EINVAL; + } + memset(buf, 0, sizeof(*buf)); + int rc = striper->stat(fr->name, (uint64_t*)&(buf->st_size), &(buf->st_atime)); + if (rc != 0) { + return -rc; + } + buf->st_mtime = buf->st_atime; + buf->st_ctime = buf->st_atime; + buf->st_mode = 0666 | S_IFREG; + return 0; + } else { + return -EBADF; + } +} + +int ceph_posix_stat(XrdOucEnv* env, const char *pathname, struct stat *buf) { + logwrapper((char*)"ceph_stat: %s", pathname); + // minimal stat : only size and times are filled + // atime, mtime and ctime are set all to the same value + // mode is set arbitrarily to 0666 | S_IFREG + CephFile file = getCephFile(pathname, env); + libradosstriper::RadosStriper *striper = getRadosStriper(file); + if (0 == striper) { + return -EINVAL; + } + memset(buf, 0, sizeof(*buf)); + int rc = striper->stat(file.name, (uint64_t*)&(buf->st_size), &(buf->st_atime)); + if (rc != 0) { + // for non existing file. Check that we did not open it for write recently + // in that case, we return 0 size and current time + if (-ENOENT == rc && isOpenForWrite(file.name)) { + buf->st_size = 0; + buf->st_atime = time(NULL); + } else { + return -rc; + } + } + buf->st_mtime = buf->st_atime; + buf->st_ctime = buf->st_atime; + buf->st_mode = 0666 | S_IFREG; + return 0; +} + +int ceph_posix_fsync(int fd) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + // no locking of fr as it is not used. + logwrapper((char*)"ceph_sync: fd %d", fd); + return 0; + } else { + return -EBADF; + } +} + +int ceph_posix_fcntl(int fd, int cmd, ... /* arg */ ) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_fcntl: fd %d cmd=%d", fd, cmd); + // minimal implementation + switch (cmd) { + case F_GETFL: + return fr->mode; + default: + return -EINVAL; + } + } else { + return -EBADF; + } +} + +static ssize_t ceph_posix_internal_getxattr(const CephFile &file, const char* name, + void* value, size_t size) { + libradosstriper::RadosStriper *striper = getRadosStriper(file); + if (0 == striper) { + return -EINVAL; + } + ceph::bufferlist bl; + int rc = striper->getxattr(file.name, name, bl); + if (rc < 0) return rc; + size_t returned_size = (size_t)rcsetxattr(file.name, name, bl); + if (rc) { + return -rc; + } + return 0; +} + +ssize_t ceph_posix_setxattr(XrdOucEnv* env, const char* path, + const char* name, const void* value, + size_t size, int flags) { + logwrapper((char*)"ceph_setxattr: path %s name=%s value=%s", path, name, value); + return ceph_posix_internal_setxattr(getCephFile(path, env), name, value, size, flags); +} + +int ceph_posix_fsetxattr(int fd, + const char* name, const void* value, + size_t size, int flags) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_fsetxattr: fd %d name=%s value=%s", fd, name, value); + return ceph_posix_internal_setxattr(*fr, name, value, size, flags); + } else { + return -EBADF; + } +} + +static int ceph_posix_internal_removexattr(const CephFile &file, const char* name) { + libradosstriper::RadosStriper *striper = getRadosStriper(file); + if (0 == striper) { + return -EINVAL; + } + int rc = striper->rmxattr(file.name, name); + if (rc) { + return -rc; + } + return 0; +} + +int ceph_posix_removexattr(XrdOucEnv* env, const char* path, + const char* name) { + logwrapper((char*)"ceph_removexattr: path %s name=%s", path, name); + return ceph_posix_internal_removexattr(getCephFile(path, env), name); +} + +int ceph_posix_fremovexattr(int fd, const char* name) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_fremovexattr: fd %d name=%s", fd, name); + return ceph_posix_internal_removexattr(*fr, name); + } else { + return -EBADF; + } +} + +static int ceph_posix_internal_listxattrs(const CephFile &file, XrdSysXAttr::AList **aPL, int getSz) { + libradosstriper::RadosStriper *striper = getRadosStriper(file); + if (0 == striper) { + return -EINVAL; + } + // call ceph + std::map attrset; + int rc = striper->getxattrs(file.name, attrset); + if (rc) { + return -rc; + } + // build result + *aPL = 0; + int maxSize = 0; + for (std::map::const_iterator it = attrset.begin(); + it != attrset.end(); + it++) { + XrdSysXAttr::AList* newItem = (XrdSysXAttr::AList*)malloc(sizeof(XrdSysXAttr::AList)+it->first.size()); + newItem->Next = *aPL; + newItem->Vlen = it->second.length(); + if (newItem->Vlen > maxSize) { + maxSize = newItem->Vlen; + } + newItem->Nlen = it->first.size(); + strncpy(newItem->Name, it->first.c_str(), newItem->Vlen+1); + *aPL = newItem; + } + if (getSz) { + return 0; + } else { + return maxSize; + } +} + +int ceph_posix_listxattrs(XrdOucEnv* env, const char* path, XrdSysXAttr::AList **aPL, int getSz) { + logwrapper((char*)"ceph_listxattrs: path %s", path); + return ceph_posix_internal_listxattrs(getCephFile(path, env), aPL, getSz); +} + +int ceph_posix_flistxattrs(int fd, XrdSysXAttr::AList **aPL, int getSz) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_flistxattrs: fd %d", fd); + return ceph_posix_internal_listxattrs(*fr, aPL, getSz); + } else { + return -EBADF; + } +} + +void ceph_posix_freexattrlist(XrdSysXAttr::AList *aPL) { + while (aPL) { + free(aPL->Name); + XrdSysXAttr::AList *cur = aPL; + aPL = aPL->Next; + free(cur); + } +} + +int ceph_posix_statfs(long long *totalSpace, long long *freeSpace) { + logwrapper((char*)"ceph_posix_statfs"); + // get the poolIdx to use + int cephPoolIdx = getCephPoolIdxAndIncrease(); + // Get the cluster to use + librados::Rados* cluster = checkAndCreateCluster(cephPoolIdx); + if (0 == cluster) { + return -EINVAL; + } + // call ceph stat + librados::cluster_stat_t result; + int rc = cluster->cluster_stat(result); + if (0 == rc) { + *totalSpace = result.kb * 1024; + *freeSpace = result.kb_avail * 1024; + } + return rc; +} + +static int ceph_posix_internal_truncate(const CephFile &file, unsigned long long size) { + libradosstriper::RadosStriper *striper = getRadosStriper(file); + if (0 == striper) { + return -EINVAL; + } + return striper->trunc(file.name, size); +} + +int ceph_posix_ftruncate(int fd, unsigned long long size) { + CephFileRef* fr = getFileRef(fd); + if (fr) { + logwrapper((char*)"ceph_posix_ftruncate: fd %d, size %d", fd, size); + return ceph_posix_internal_truncate(*fr, size); + } else { + return -EBADF; + } +} + +int ceph_posix_truncate(XrdOucEnv* env, const char *pathname, unsigned long long size) { + logwrapper((char*)"ceph_posix_truncate : %s", pathname); + // minimal stat : only size and times are filled + CephFile file = getCephFile(pathname, env); + return ceph_posix_internal_truncate(file, size); +} + +int ceph_posix_unlink(XrdOucEnv* env, const char *pathname) { + logwrapper((char*)"ceph_posix_unlink : %s", pathname); + // minimal stat : only size and times are filled + CephFile file = getCephFile(pathname, env); + libradosstriper::RadosStriper *striper = getRadosStriper(file); + if (0 == striper) { + return -EINVAL; + } + return striper->remove(file.name); +} + +DIR* ceph_posix_opendir(XrdOucEnv* env, const char *pathname) { + logwrapper((char*)"ceph_posix_opendir : %s", pathname); + // only accept root dir, as there is no concept of dirs in object stores + CephFile file = getCephFile(pathname, env); + if (file.name.size() != 1 || file.name[0] != '/') { + errno = -ENOENT; + return 0; + } + librados::IoCtx *ioctx = getIoCtx(file); + if (0 == ioctx) { + errno = EINVAL; + return 0; + } + DirIterator* res = new DirIterator(); + res->m_iterator = ioctx->nobjects_begin(); + res->m_ioctx = ioctx; + return (DIR*)res; +} + +int ceph_posix_readdir(DIR *dirp, char *buff, int blen) { + librados::NObjectIterator &iterator = ((DirIterator*)dirp)->m_iterator; + librados::IoCtx *ioctx = ((DirIterator*)dirp)->m_ioctx; + while (iterator->get_oid().compare(iterator->get_oid().size()-17, 17, ".0000000000000000") && + iterator != ioctx->nobjects_end()) { + iterator++; + } + if (iterator == ioctx->nobjects_end()) { + buff[0] = 0; + } else { + int l = iterator->get_oid().size()-17; + if (l < blen) blen = l; + strncpy(buff, iterator->get_oid().c_str(), blen-1); + buff[blen-1] = 0; + iterator++; + } + return 0; +} + +int ceph_posix_closedir(DIR *dirp) { + delete ((DirIterator*)dirp); + return 0; +} diff --git a/src/XrdCeph/src/XrdCeph/XrdCephPosix.hh b/src/XrdCeph/src/XrdCeph/XrdCephPosix.hh new file mode 100644 index 00000000000..77f9fbc23da --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephPosix.hh @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +/* + * This interface provides wrapper methods for using ceph through a POSIX API. + */ + +#ifndef _XRD_CEPH_POSIX_H +#define _XRD_CEPH_POSIX_H + +#include +#include +#include +#include +#include + +class XrdSfsAio; +typedef void(AioCB)(XrdSfsAio*, size_t); + +void ceph_posix_set_defaults(const char* value); +void ceph_posix_disconnect_all(); +void ceph_posix_set_logfunc(void (*logfunc) (char *, va_list argp)); +int ceph_posix_open(XrdOucEnv* env, const char *pathname, int flags, mode_t mode); +int ceph_posix_close(int fd); +off_t ceph_posix_lseek(int fd, off_t offset, int whence); +off64_t ceph_posix_lseek64(int fd, off64_t offset, int whence); +ssize_t ceph_posix_write(int fd, const void *buf, size_t count); +ssize_t ceph_posix_pwrite(int fd, const void *buf, size_t count, off64_t offset); +ssize_t ceph_aio_write(int fd, XrdSfsAio *aiop, AioCB *cb); +ssize_t ceph_posix_read(int fd, void *buf, size_t count); +ssize_t ceph_posix_pread(int fd, void *buf, size_t count, off64_t offset); +ssize_t ceph_aio_read(int fd, XrdSfsAio *aiop, AioCB *cb); +int ceph_posix_fstat(int fd, struct stat *buf); +int ceph_posix_stat(XrdOucEnv* env, const char *pathname, struct stat *buf); +int ceph_posix_fsync(int fd); +int ceph_posix_fcntl(int fd, int cmd, ... /* arg */ ); +ssize_t ceph_posix_getxattr(XrdOucEnv* env, const char* path, const char* name, + void* value, size_t size); +ssize_t ceph_posix_fgetxattr(int fd, const char* name, void* value, size_t size); +ssize_t ceph_posix_setxattr(XrdOucEnv* env, const char* path, const char* name, + const void* value, size_t size, int flags); +int ceph_posix_fsetxattr(int fd, const char* name, const void* value, size_t size, int flags); +int ceph_posix_removexattr(XrdOucEnv* env, const char* path, const char* name); +int ceph_posix_fremovexattr(int fd, const char* name); +int ceph_posix_listxattrs(XrdOucEnv* env, const char* path, XrdSysXAttr::AList **aPL, int getSz); +int ceph_posix_flistxattrs(int fd, XrdSysXAttr::AList **aPL, int getSz); +void ceph_posix_freexattrlist(XrdSysXAttr::AList *aPL); +int ceph_posix_statfs(long long *totalSpace, long long *freeSpace); +int ceph_posix_truncate(XrdOucEnv* env, const char *pathname, unsigned long long size); +int ceph_posix_ftruncate(int fd, unsigned long long size); +int ceph_posix_unlink(XrdOucEnv* env, const char *pathname); +DIR* ceph_posix_opendir(XrdOucEnv* env, const char *pathname); +int ceph_posix_readdir(DIR* dirp, char *buff, int blen); +int ceph_posix_closedir(DIR *dirp); + +#endif // __XRD_CEPH_POSIX__ diff --git a/src/XrdCeph/src/XrdCeph/XrdCephXAttr.cc b/src/XrdCeph/src/XrdCeph/XrdCephXAttr.cc new file mode 100644 index 00000000000..4c2f60a0f96 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephXAttr.cc @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#include "XrdVersion.hh" +#include "XrdCeph/XrdCephPosix.hh" +#include "XrdSys/XrdSysError.hh" +#include "XrdOuc/XrdOucTrace.hh" +#include "XrdCeph/XrdCephXAttr.hh" + +XrdSysError XrdCephXattrEroute(0); +XrdOucTrace XrdCephXattrTrace(&XrdCephXattrEroute); + +extern "C" +{ + XrdSysXAttr* + XrdSysGetXAttrObject(XrdSysError *errP, + const char *config_fn, + const char *parms) + { + // Do the herald thing + XrdCephXattrEroute.SetPrefix("cephxattr_"); + XrdCephXattrEroute.logger(errP->logger()); + XrdCephXattrEroute.Say("++++++ CERN/IT-DSS XrdCephXattr"); + // set parameters + try { + ceph_posix_set_defaults(parms); + } catch (std::exception &e) { + XrdCephXattrEroute.Say("CephXattr loading failed with exception. Check the syntax of parameters : ", parms); + return 0; + } + return new XrdCephXAttr(); + } +} + +XrdCephXAttr::XrdCephXAttr() {} + +XrdCephXAttr::~XrdCephXAttr() {} + +int XrdCephXAttr::Del(const char *Aname, const char *Path, int fd) { + try { + return ceph_posix_removexattr(0, Path, Aname); + } catch (std::exception &e) { + XrdCephXattrEroute.Say("Del : invalid syntax in file parameters", Path); + return -EINVAL; + } +} + +void XrdCephXAttr::Free(AList *aPL) { + ceph_posix_freexattrlist(aPL); +} + +int XrdCephXAttr::Get(const char *Aname, void *Aval, int Avsz, + const char *Path, int fd) { + if (fd >= 0) { + return ceph_posix_fgetxattr(fd, Aname, Aval, Avsz); + } else { + try { + return ceph_posix_getxattr(0, Path, Aname, Aval, Avsz); + } catch (std::exception &e) { + XrdCephXattrEroute.Say("Get : invalid syntax in file parameters", Path); + return -EINVAL; + } + } +} + +int XrdCephXAttr::List(AList **aPL, const char *Path, int fd, int getSz) { + if (fd > 0) { + return ceph_posix_flistxattrs(fd, aPL, getSz); + } else { + try { + return ceph_posix_listxattrs(0, Path, aPL, getSz); + } catch (std::exception &e) { + XrdCephXattrEroute.Say("List : invalid syntax in file parameters", Path); + return -EINVAL; + } + } +} + +int XrdCephXAttr::Set(const char *Aname, const void *Aval, int Avsz, + const char *Path, int fd, int isNew) { + if (fd >= 0) { + return ceph_posix_fsetxattr(fd, Aname, Aval, Avsz, 0); + } else { + try { + return ceph_posix_setxattr(0, Path, Aname, Aval, Avsz, 0); + } catch (std::exception &e) { + XrdCephXattrEroute.Say("Set : invalid syntax in file parameters", Path); + return -EINVAL; + } + } +} + +XrdVERSIONINFO(XrdSysGetXAttrObject, XrdCephXAttr); diff --git a/src/XrdCeph/src/XrdCeph/XrdCephXAttr.hh b/src/XrdCeph/src/XrdCeph/XrdCephXAttr.hh new file mode 100644 index 00000000000..ed6f4d39f21 --- /dev/null +++ b/src/XrdCeph/src/XrdCeph/XrdCephXAttr.hh @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2014-2015 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// This file is part of the XRootD software suite. +// +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +// +// In applying this licence, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +//------------------------------------------------------------------------------ + +#ifndef __XRD_CEPH_XATTR_HH__ +#define __XRD_CEPH_XATTR_HH__ + +#include + +//------------------------------------------------------------------------------ +//! This class implements XrdSysXAttr interface for usage with a CEPH storage. +//! It should be loaded via the ofs.xattrlib directive. +//! +//! This plugin is able to use any pool of ceph with any userId. +//! There are several ways to provide the pool and userId to be used for a given +//! operation. Here is the ordered list of possibilities. +//! First one defined wins : +//! - the path can be prepended with userId and pool. Syntax is : +//! [[userId@]pool:] +//! - the XrdOucEnv parameter, when existing, can have 'cephUserId' and/or +//! 'cephPool' entries +//! - the ofs.xattrlib directive can provide an argument with format : +//! [userID@]pool +//! - default are 'admin' and 'default' for userId and pool respectively +//! +//! Note that the definition of a default via the ofs.xattrlib directive may +//! clash with one used in a ofs.osslib directive. In case both directives +//! have a default and they are different, the behavior is not defined. +//! In case one of the two only has a default, it will be applied for both plugins. +//------------------------------------------------------------------------------ + +class XrdCephXAttr : public XrdSysXAttr { + +public: + + //------------------------------------------------------------------------------ + //! Constructor + //------------------------------------------------------------------------------ + XrdCephXAttr(); + + //------------------------------------------------------------------------------ + //! Destructor + //------------------------------------------------------------------------------ + virtual ~XrdCephXAttr(); + + //------------------------------------------------------------------------------ + //! Remove an extended attribute. + //! + //! @param Aname -> The attribute name. + //! @param Path -> Path of the file whose attribute is to be removed. + //! @param fd If >=0 is the file descriptor of the opened subject file. + //! + //! @return =0 Attribute was successfully removed or did not exist. + //! @return <0 Attribute was not removed, the return value is -errno that + //! describes the reason for the failure. + //------------------------------------------------------------------------------ + virtual int Del(const char *Aname, const char *Path, int fd=-1); + + //------------------------------------------------------------------------------ + //! Release storage occupied by the Alist structure returned by List(). + //! + //! @param aPL -> The first element of the AList structure. + //------------------------------------------------------------------------------ + + virtual void Free(AList *aPL); + + //------------------------------------------------------------------------------ + //! Get an attribute value and its size. + //! + //! @param Aname -> The attribute name. + //! @param Aval -> Buffer to receive the attribute value. + //! @param Avsz Length of the buffer in bytes. Only up to this number of + //! bytes should be returned. However, should Avsz be zero + //! the the size of the attribute value should be returned + //! and the Aval argument should be ignored. + //! @param Path -> Path of the file whose attribute is to be fetched. + //! @param fd -> If >=0 is the file descriptor of the opened subject file. + //! + //! @return >0 The number of bytes placed in Aval. However, if avsz is zero + //! then the value is the actual size of the attribute value. + //! @return =0 The attribute does not exist. + //! @return <0 The attribute value could not be returned. The returned + //! value is -errno describing the reason. + //------------------------------------------------------------------------------ + + virtual int Get(const char *Aname, void *Aval, int Avsz, + const char *Path, int fd=-1); + + //------------------------------------------------------------------------------ + //! Get all of the attributes associated with a file. + //! + //! @param aPL -> the pointer to hold the first element of AList. The + //! storage occupied by the returned AList must be released + //! by calling Free(). + //! @param Path -> Path of the file whose attributes are t be returned. + //! @param fd -> If >=0 is the file descriptor of the opened subject file. + //! @param getSz When != 0 then the size of the maximum attribute value + //! should be returned. Otherwise, upon success 0 is returned. + //! + //! @return >0 Attributes were returned and aPL points to the first + //! attribute value. The returned value is the largest size + //! of an attribute value encountered (getSz != 0). + //! @return =0 Attributes were returned and aPL points to the first + //! attribute value (getSz == 0). + //! @return <0 The attribute values could not be returned. The returned + //! value is -errno describing the reason. + //------------------------------------------------------------------------------ + virtual int List(AList **aPL, const char *Path, int fd=-1, int getSz=0); + + //------------------------------------------------------------------------------ + //! Set an attribute. + //! + //! @param Aname -> The attribute name. + //! @param Aval -> Buffer holding the attribute value. + //! @param Avsz Length of the buffer in bytes. This is the length of the + //! attribute value which may contain binary data. + //! @param Path -> Path of the file whose attribute is to be set. + //! @param fd -> If >=0 is the file descriptor of the opened subject file. + //! @param isNew When !0 then the attribute must not exist (i.e. new). + //! Otherwise, if it does exist, the value is replaced. In + //! either case, if it does not exist it should be created. + //! + //! @return =0 The attribute was successfully set. + //! @return <0 The attribute values could not be set. The returned + //! value is -errno describing the reason. + //------------------------------------------------------------------------------ + virtual int Set(const char *Aname, const void *Aval, int Avsz, + const char *Path, int fd=-1, int isNew=0); + +}; + +#endif /* __XRD_CEPH_XATTR_HH__ */ diff --git a/src/XrdCeph/src/XrdVersion.hh.in b/src/XrdCeph/src/XrdVersion.hh.in new file mode 100644 index 00000000000..8ccbfa4c07b --- /dev/null +++ b/src/XrdCeph/src/XrdVersion.hh.in @@ -0,0 +1,106 @@ +/******************************************************************************/ +/* */ +/* X r d V e r s i o n . h h . i n */ +/* */ +/* (c) 2012 by the Board of Trustees of the Leland Stanford, Jr., University */ +/* */ +/* This file is part of the XRootD software suite. */ +/* */ +/* XRootD is free software: you can redistribute it and/or modify it under */ +/* the terms of the GNU Lesser General Public License as published by the */ +/* Free Software Foundation, either version 3 of the License, or (at your */ +/* option) any later version. */ +/* */ +/* XRootD 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 Lesser General Public */ +/* License for more details. */ +/* */ +/* You should have received a copy of the GNU Lesser General Public License */ +/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ +/* COPYING (GPL license). If not, see . */ +/* */ +/* The copyright holder's institutional names and contributor's names may not */ +/* be used to endorse or promote products derived from this software without */ +/* specific prior written permission of the institution or contributor. */ +/******************************************************************************/ + +// this file is automatically updated by the genversion.sh script +// if you touch anything make sure that it still works + +#ifndef __XRD_VERSION_H__ +#define __XRD_VERSION_H__ + +#define XrdVERSION "unknown" + +// Numeric representation of the version tag +// The format for the released code is: xyyzz, where: x is the major version, +// y is the minor version and zz is the bugfix revision number +// For the non-released code the value is 1000000 +#define XrdVNUMUNK 1000000 +#define XrdVNUMBER 1000000 + +#if XrdDEBUG +#define XrdVSTRING XrdVERSION "_dbg" +#else +#define XrdVSTRING XrdVERSION +#endif + +// The following defines the shared library version number of any plug-in. +// Generally, all plug-ins have a uniform version number releative to a +// specific compilation. This version is appended to the so-name and for +// dylibs becomes part of he actual filename (MacOS format). +// +#ifndef XRDPLUGIN_SOVERSION +#define XRDPLUGIN_SOVERSION "4" +#endif + +#define XrdDEFAULTPORT 1094; + +// The following macros extract version digits from a numeric version number +#define XrdMajorVNUM(x) x/10000 +#define XrdMinorVNUM(x) x/100%100 +#define XrdPatchVNUM(x) x%100 + +// The following structure defines the standard way to record a version. You can +// determine component version numbers within an object file by simply executing +// "strings | grep '@V:'". +// +struct XrdVersionInfo {int vNum; const char vOpt; const char vPfx[3];\ + const char vStr[40];}; + +// Macro to define the suffix to use when generating the extern version symbol. +// This is used by SysPlugin. We cannot use it here as cpp does not expand the +// macro when catenating tokens togther and we want to avoid yet another macro. +// +#define XrdVERSIONINFOSFX "_" + +// The following macro defines a local copy of version information. Parameters: +// x -> The variable name of the version information structure +// y -> An unquoted 1- to 15-character component name (e.g. cmsd, seckrb5) +// vn -> The integer version number to be used +// vs -> The string version number to be used +// +#define XrdVERSIONINFODEF(x,y,vn,vs) \ + XrdVersionInfo x = \ + {vn, (sizeof(#y)-1) & 0x0f,{'@','V',':'}, #y " " vs} + +// The following macro defines an externally referencable structure that records +// the version used to compile code. It is used by the plugin loader. Parms: +// x -> The variable name of the version information structure +// y -> An unquoted 1- to 15-character component name (e.g. cmsd, seckrb5, etc). +// +#define XrdVERSIONINFO(x,y) \ + extern "C" {XrdVERSIONINFODEF(x##_,y,XrdVNUMBER,XrdVERSION);} + +// The following macro is an easy way to declare externally defined version +// information. This macro must be used at file level. +// +#define XrdVERSIONINFOREF(x) extern "C" XrdVersionInfo x##_ + +// The following macro can be used to reference externally defined version +// information. As the composition of the symbolic name may change you should +// use this macro to refer to the version information declaration. +// +#define XrdVERSIONINFOVAR(x) x##_ +#endif diff --git a/src/XrdCeph/tests/CMakeLists.txt b/src/XrdCeph/tests/CMakeLists.txt new file mode 100644 index 00000000000..7216d36fd8e --- /dev/null +++ b/src/XrdCeph/tests/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory( XrdCephTests ) diff --git a/src/XrdCeph/tests/XrdCephTests/CMakeLists.txt b/src/XrdCeph/tests/XrdCephTests/CMakeLists.txt new file mode 100644 index 00000000000..35d3c465b0a --- /dev/null +++ b/src/XrdCeph/tests/XrdCephTests/CMakeLists.txt @@ -0,0 +1,26 @@ +include_directories( ${CPPUNIT_INCLUDE_DIRS} ) +include_directories( ${XROOTD_INCLUDE_DIR} ) +include_directories( ${RADOS_INCLUDE_DIR} ) +include_directories( ${CMAKE_SOURCE_DIR}/src ) + +message( "XROOTD_INCLUDE_DIR : ${XROOTD_INCLUDE_DIR}" ) + +add_library( + XrdCephTests MODULE + CephParsingTest.cc +) + +target_link_libraries( + XrdCephTests + pthread + ${CPPUNIT_LIBRARIES} + ${ZLIB_LIBRARY} + XrdCephPosix ) + +#------------------------------------------------------------------------------- +# Install +#------------------------------------------------------------------------------- +install( + TARGETS XrdCephTests + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) diff --git a/src/XrdCeph/tests/XrdCephTests/CephParsingTest.cc b/src/XrdCeph/tests/XrdCephTests/CephParsingTest.cc new file mode 100644 index 00000000000..194bd5e40c8 --- /dev/null +++ b/src/XrdCeph/tests/XrdCephTests/CephParsingTest.cc @@ -0,0 +1,149 @@ +//------------------------------------------------------------------------------ +// Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN) +// Author: Sebastien Ponce +//------------------------------------------------------------------------------ +// XRootD is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// XRootD 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 Lesser General Public License +// along with XRootD. If not, see . +//------------------------------------------------------------------------------ + +#include +#include +#include + +#define MB 1024*1024 +struct CephFile { + std::string name; + std::string pool; + std::string userId; + unsigned int nbStripes; + unsigned long long stripeUnit; + unsigned long long objectSize; +}; +void fillCephFileParams(const std::string ¶ms, XrdOucEnv *env, CephFile &file); +void fillCephFile(const char *path, XrdOucEnv *env, CephFile &file); + +//------------------------------------------------------------------------------ +// Declaration +//------------------------------------------------------------------------------ +class CephParsingTest: public CppUnit::TestCase +{ + public: + CPPUNIT_TEST_SUITE( CephParsingTest ); + CPPUNIT_TEST( ParamTest ); + CPPUNIT_TEST( FileTest ); + CPPUNIT_TEST_SUITE_END(); + void ParamTest(); + void FileTest(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION( CephParsingTest ); + +//------------------------------------------------------------------------------ +// Helper functions +//------------------------------------------------------------------------------ +static CephFile parseParam(std::string param, XrdOucEnv *env= NULL) { + CephFile cf; + fillCephFileParams(param, env, cf); + return cf; +} + +static CephFile parseFile(std::string param, XrdOucEnv *env= NULL) { + CephFile cf; + fillCephFile(param.c_str(), env, cf); + return cf; +} + +void checkResult(CephFile a, CephFile b) { + std::cout << a.name << " " << a.pool << " " << a.userId + << " " << a.nbStripes << " " << a.stripeUnit << " " << a.objectSize + << " / " << b.name << " " << b.pool << " " << b.userId + << " " << b.nbStripes << " " << b.stripeUnit << " " << b.objectSize + << std::endl; + CPPUNIT_ASSERT(a.name == b.name); + CPPUNIT_ASSERT(a.pool == b.pool); + CPPUNIT_ASSERT(a.userId == b.userId); + CPPUNIT_ASSERT(a.nbStripes == b.nbStripes); + CPPUNIT_ASSERT(a.stripeUnit == b.stripeUnit); + CPPUNIT_ASSERT(a.objectSize == b.objectSize); +} + +//------------------------------------------------------------------------------ +// Param test +//------------------------------------------------------------------------------ +void CephParsingTest::ParamTest() { + std::map inputs; + inputs[""] = (CephFile){"", "default", "admin", 1, 4*MB, 4*MB}; + inputs["pool"] = (CephFile){"", "pool", "admin", 1, 4*MB, 4*MB}; + inputs["@"] = (CephFile){"", "default", "", 1, 4*MB, 4*MB}; + inputs["@pool"] = (CephFile){"", "pool", "", 1, 4*MB, 4*MB}; + inputs["user@"] = (CephFile){"", "default", "user", 1, 4*MB, 4*MB}; + inputs["user@pool"] = (CephFile){"", "pool", "user", 1, 4*MB, 4*MB}; + inputs["pool,1"] = (CephFile){"", "pool", "admin", 1, 4*MB, 4*MB}; + inputs["user@pool,1"] = (CephFile){"", "pool", "user", 1, 4*MB, 4*MB}; + inputs["pool,5"] = (CephFile){"", "pool", "admin", 5, 4*MB, 4*MB}; + inputs["user@pool,5"] = (CephFile){"", "pool", "user", 5, 4*MB, 4*MB}; + inputs["pool,5,200"] = (CephFile){"", "pool", "admin", 5, 200, 4*MB}; + inputs["user@pool,5,200"] = (CephFile){"", "pool", "user", 5, 200, 4*MB}; + inputs["pool,5,200,800"] = (CephFile){"", "pool", "admin", 5, 200, 800}; + inputs["user@pool,5,200,800"] = (CephFile){"", "pool", "user", 5, 200, 800}; + for (std::map::const_iterator it = inputs.begin(); + it != inputs.end(); + it++) { + std::cout << it->first << std::endl; + checkResult(parseParam(it->first), it->second); + } +} + +//------------------------------------------------------------------------------ +// File test +//------------------------------------------------------------------------------ +void CephParsingTest::FileTest() { + std::map inputs; + std::vector filenames; + filenames.push_back(""); + filenames.push_back("foo"); + filenames.push_back("/foo/bar"); + filenames.push_back("foo@bar"); + filenames.push_back("foo@bar,1"); + filenames.push_back("foo@bar,1,2"); + filenames.push_back("foo@bar,1,2,3"); + filenames.push_back("foo:bar"); + filenames.push_back(":foo"); + for (std::vector::const_iterator it = filenames.begin(); + it != filenames.end(); + it++) { + if (std::string::npos == it->find(':')) { + inputs[*it] = (CephFile){*it, "default", "admin", 1, 4*MB, 4*MB}; + } + inputs[":" + *it] = (CephFile){*it, "default", "admin", 1, 4*MB, 4*MB}; + inputs["pool:" + *it] = (CephFile){*it, "pool", "admin", 1, 4*MB, 4*MB}; + inputs["@:" + *it] = (CephFile){*it, "default", "", 1, 4*MB, 4*MB}; + inputs["@pool:" + *it] = (CephFile){*it, "pool", "", 1, 4*MB, 4*MB}; + inputs["user@:" + *it] = (CephFile){*it, "default", "user", 1, 4*MB, 4*MB}; + inputs["user@pool:" + *it] = (CephFile){*it, "pool", "user", 1, 4*MB, 4*MB}; + inputs["pool,1:" + *it] = (CephFile){*it, "pool", "admin", 1, 4*MB, 4*MB}; + inputs["user@pool,1:" + *it] = (CephFile){*it, "pool", "user", 1, 4*MB, 4*MB}; + inputs["pool,5:" + *it] = (CephFile){*it, "pool", "admin", 5, 4*MB, 4*MB}; + inputs["user@pool,5:" + *it] = (CephFile){*it, "pool", "user", 5, 4*MB, 4*MB}; + inputs["pool,5,200:" + *it] = (CephFile){*it, "pool", "admin", 5, 200, 4*MB}; + inputs["user@pool,5,200:" + *it] = (CephFile){*it, "pool", "user", 5, 200, 4*MB}; + inputs["pool,5,200,800:" + *it] = (CephFile){*it, "pool", "admin", 5, 200, 800}; + inputs["user@pool,5,200,800:" + *it] = (CephFile){*it, "pool", "user", 5, 200, 800}; + } + for (std::map::const_iterator it = inputs.begin(); + it != inputs.end(); + it++) { + std::cout << it->first << std::endl; + checkResult(parseFile(it->first), it->second); + } +}