summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* FileJournal: zero-fill in-lieu of posix_fallocatewip-osx-upstreamNoah Watkins2013-07-212-10/+29
| | | | | | | | | | Zero-fill journal if posix_fallocate fails or if it is not supported. For very large journals zero fill can take a long time. An optimization is to write a zero byte to the end of each block, or use platform specific features for file allocation. Reference solutions for various platforms can be found in Mozilla, SQLite, and PostgreSQL. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* FileJournal: fix posix_fallocate error handlingNoah Watkins2013-07-211-4/+3
| | | | | | | | | From the man page for posix_fallocate: posix_fallocate() returns zero on success, or an error number on failure. Note that errno is not set. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* hashing: add missing hash functionsNoah Watkins2013-07-212-2/+2
| | | | | | | | OSX doesn't define hash<int64_t>, hash<uint64_t>, and isn't able to cast pthread_t to a type with a hash. This fixes the problem by defining replacements. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* rbd_fuse: include <limits.h> for PATH_MAXNoah Watkins2013-07-201-0/+1
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* fuse: define IOCTL flags for non-Linux systemNoah Watkins2013-07-201-0/+10
| | | | | | | | | | | | The Ceph client re-uses the _IOR, _IOW Linux macros for computing IOCTL flags, but these macros are not available on non-Linux systems. This patch defines IOCTL numbers in this case. The IOCTL numbers used do not have to be identical to the kernel client. They only have to be consistent for a particular client build. Ideally we can move away from reusing this Linux-specific macro in the client. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* fuse: support get/set xattr on OSXNoah Watkins2013-07-202-9/+88
| | | | | | | | | | | | On OSX, the fuse get/set xattr interfaces takes a positional argument that specifies an offset within the xattr. According to the OSX docs only the 'resource fork' extended attribute will make use of this feature and that all other attributes should set this to zero. Ceph doesn't currently support xattr offsets (at the API level at least). Therefore Ceph will return ENOTSUP if a non-zero positional argument is used. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* fuse: better fuse check and compiler error fixesNoah Watkins2013-07-203-17/+17
| | | | | | | | | Use pkg-config to look for libfuse (which also catches fuse4x on OSX). This also fixes the HAVE_FUSE_GETGROUPS feature test, which hadn't been updating LIBS prior to the test. This enabled code with an error in fuse_ll.cc that had compiler errors. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* spinlock: add generic spinlock implementationNoah Watkins2013-07-208-32/+115
| | | | | | | | | | | | | | | | | | | Adds a ceph_spinlock_t implementation that will use pthread_spinlock_t if available, and otherwise reverts to pthread_mutex_t. Note that this spinlock is not intended to be used in process-shared memory. Switches implementation in: ceph_context SimpleMessenger atomic_t Only ceph_context initialized its spinlock with PTHREAD_PROCESS_SHARED. However, there does not appear to be any instance in which CephContext is allocated in shared memory, and thus can use the default private memory space behavior. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* xattr: format code, remove unused intializationNoah Watkins2013-07-201-36/+26
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* xattr: test for xattr routine variantsNoah Watkins2013-07-202-38/+82
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* pipe: use feature tests for pipe2 and O_CLOEXECNoah Watkins2013-07-202-14/+22
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* doc: add osx build documentationNoah Watkins2013-07-201-0/+14
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* mon: check for platform specific headersNoah Watkins2013-07-202-0/+11
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* context: handle platform without sem_timedwaitNoah Watkins2013-07-202-0/+7
| | | | | | | | | On OSX sem_timedwait is not available. This patch simply turns off the heartbeat interval feature. Building a replacement should be possible, but is needs some careful thought because pthread mutex/conds aren't thread safe, and sem_post is called from SIGHUP. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* wbthrottle: use posix_fadvise if availableNoah Watkins2013-07-202-0/+5
| | | | | | | | Only adding information about data usage. This won't effect correctness; finding analagous techniques on other platforms woudld be useful for performance. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* utime: use to_timespec for conversionNoah Watkins2013-07-201-2/+3
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* blkdev: support blkdev size query on osxNoah Watkins2013-07-202-15/+47
| | | | | | Support OSX, add checks for platform specific headers. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* code_env: do not use prctl on non-linuxNoah Watkins2013-07-202-6/+18
| | | | | | | get_process_name is platform specific. Check for Linux prctl function and headers, and add reference to the relevant OSX function. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* log: remove unused lockNoah Watkins2013-07-202-5/+0
| | | | | | m_lock is initialized and destroyed, but never used. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* autoconf: search for -mt version of boost_program_optionsNoah Watkins2013-07-202-8/+13
| | | | | | | | The -mt version of the boost libraries shows up in OSX. Other boost libraries were searching for the same alternative. Adds lib to LIBS to avoid explicit -l in Makefile.am. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* autoconf: search for uuid_parse in system libsNoah Watkins2013-07-202-2/+2
| | | | | | | | | AC_SEARCH_LIBS will first try to resolve uuid_parse in the system libraries (OSX), and then will try other libraries (e.g. libuuid). The $LIBS variable will be updated with the result, so we don't need an explicit -luuid in src/Makefile.am. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* pipe: avoid conflict with Pipe.cc on case-insensitive fsNoah Watkins2013-07-205-5/+5
| | | | | | | | pipe.c and Pipe.cc produce the same intermediate file names on case-insensitive file systems (like HFS). This renames pipe.c/pipe.h in order to avoid the conflict. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* client: use struct stat member tests for timeNoah Watkins2013-07-204-22/+180
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* assert: choose function-var name on non-gnuNoah Watkins2013-07-204-8/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Selects __PRETTY_FUNCTION__ or __func__. Linux assumes GNU, and chooses __PRETTY_FUNCTION__ if gcc/g++ versions are favorable. This also includes a fix in ax_c_var_func.m4: AC_TRY_COMPILE will wrap the test in main{}, and then GCC will complain about nested functions. Just use the original main{} body. diff --git a/m4/ax_c_var_func.m4 b/m4/ax_c_var_func.m4 index 0ad7d2b..8b57563 100644 --- a/m4/ax_c_var_func.m4 +++ b/m4/ax_c_var_func.m4 @@ -57,9 +57,9 @@ AC_DEFUN([AX_C_VAR_FUNC], [AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK(whether $CC recognizes __func__, ac_cv_c_var_func, AC_TRY_COMPILE(, -[int main() { +[ char *s = __func__; -}], +], AC_DEFINE(HAVE_FUNC,, [Define if the C complier supports __func__]) ac_cv_c_var_func=yes, ac_cv_c_var_func=no) ) Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* assert: use feature test for static_castNoah Watkins2013-07-203-1/+46
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* autogen.sh: use glibtoolize when availableNoah Watkins2013-07-201-1/+11
| | | | | | libtoolize is called glibtoolize on osx. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* Use mon_host instead of mon_addr in ceph_confJordi Llonch2013-07-151-1/+1
| | | | Signed-off-by: Jordi Llonch <llonchj@gmail.com>
* hypertable recent version prototyping includes bool verify in length and ↵Jordi Llonch2013-07-152-4/+5
| | | | | | read functions Signed-off-by: Jordi Llonch <llonchj@gmail.com>
* Merge remote-tracking branch 'gh/next'Sage Weil2013-07-122-4/+5
|\
| * ceph.in: output even a blank status line in compat modeDan Mick2013-07-111-3/+4
| | | | | | | | | | | | Fixes: #5594 Signed-off-by: Dan Mick <dan.mick@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
| * Get device-by-path by looking for it instead of assuming 3rd entry.Sandon Van Ness2013-07-101-1/+7
| | | | | | | | | | | | | | | | | | | | On some systems (virtual machines so far) the device-by-path entry from udevadm is not always in the same spot so instead actually look for the right output instead of blindy assuming that its a specific field in the output. Signed-off-by: Sandon Van Ness <sandon@inktank.com> Reviewed-by: Gary Lowell <gary.lowell@inktank.com>
| * Merge branch 'wip-5492-gl' into nextGary Lowell2013-07-101-1/+1
| |\ | | | | | | | | | | | | | | | Re-instate fix for #5492 with corrections. Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
| | * Makefile.am: fix ceph_sbindirGary Lowell2013-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reinstates the fix for the ceph_sbindir from commit 352f362567bf270d0896fb7573df4ae5139a56fb, with corrections from Danny's review commits pull request #389. Fixes: #5492 Reported-by: Denis Kaganovich <mahatma@eu.by> Reviewed-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de> Signed-off-by: Sage Weil <sage@inktank.com> Signed-off-by: Gary Lowell <gary.lowell@inktank.com>
* | | Merge pull request #426 from dalgaaf/wip-da-SCA-cppcheck-5Sage Weil2013-07-127-21/+20
|\ \ \ | | | | | | | | | | | | | | | | Fix some typical SCA issues from cppcheck Reviewed-by: Sage Weil <sage@inktank.com>
| * | | test_rgw_admin_meta.cc: prefer prefix ++operator for non-trivial iteratorDanny Al-Gaaf2013-07-121-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * | | cls/rgw/cls_rgw.cc: use empty() instead of checking for size() == 0Danny Al-Gaaf2013-07-121-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * | | test_rgw_admin_log.cc: prefer prefix ++operator for non-trivial iteratorDanny Al-Gaaf2013-07-121-6/+6
| | | | | | | | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * | | test_rgw_admin_opstate.cc: prefer prefix ++operator for non-trivial iteratorDanny Al-Gaaf2013-07-121-4/+4
| | | | | | | | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * | | test_rgw_admin_meta.cc: prefer prefix ++operator for non-trivial iteratorDanny Al-Gaaf2013-07-121-5/+5
| | | | | | | | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * | | rgw/rgw_rest_opstate.cc: prefer prefix ++operator for non-trivial iteratorDanny Al-Gaaf2013-07-121-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * | | rgw/rgw_rados.cc: use empty() instead of checking for size() > 0Danny Al-Gaaf2013-07-121-2/+1
| | | | | | | | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * | | cmdparse.cc: catch exception by referenceDanny Al-Gaaf2013-07-121-1/+1
|/ / / | | | | | | | | | Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
* | | ceph-rest-api: Missing packaging (binary in .spec, manpage in both)Dan Mick2013-07-113-0/+4
| | | | | | | | | | | | Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | rgw: handle bucket removal by system user on master regionBabu Shanmugam2013-07-112-2/+3
| | | | | | | | | | | | | | | | | | | | | intra region bucket creation, deletion and copy object to and from remote regions validated Signed-off-by: Babu Shanmugam <anbu@enovance.com> Reviewed-by:Yehuda Sadeh <yehuda@inktank.com>
* | | ceph-rest-api: connect to cluster with configured client nameDan Mick2013-07-101-1/+1
| | | | | | | | | | | | | | | | | | Spotted by Noah Watkins Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | ceph-rest-api manpageDan Mick2013-07-103-1/+220
| | | | | | | | | | | | Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | cephtool/test.sh: sync status no longer supportedDan Mick2013-07-101-1/+0
| | | | | | | | | | | | | | | | | | | | | da0aff28ab478bcc3136715f92bc1af8d4b403c1 removed 'ceph sync status'; test script needs to stop trying it Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | cephtool/test.sh cleanupDan Mick2013-07-101-3/+3
| | | | | | | | | | | | | | | | | | | | | 1) don't pass subshell to expect_false 2) osd pause/unpause don't take arguments (apply to all OSDs) Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | ceph-rest-api testsDan Mick2013-07-101-0/+415
| | | | | | | | | | | | | | | | | | | | | | | | Patterned after cephtool/test.sh, with some deeper validation of output format and contents (because structured output is easier to validate). Signed-off-by: Dan Mick <dan.mick@inktank.com>
* | | Add 'ceph-rest-api'Dan Mick2013-07-105-3/+461
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ceph-rest-api is a Python WSGI module for accessing the Ceph cluster. It supports most of the commands supported by the ceph CLI, appropriately translated to HTTP GET/PUT requests. It is not a truly RESTful interface. Not supported at this moment: "tell", "pg <pgid>", and "daemon" commands. Configuration options are specified in ceph.conf, specified with -c/--conf or obtained from $CEPH_CONF, /etc/ceph/ceph.conf, ~/.ceph/ceph.conf, or ./ceph.conf. -n/--name specifies the client name, used for the cluster authentication key and for the ceph.conf section name (default is client.restapi). restapi keyring = <keyring file> restapi public addr = listenIP:port (default 0.0.0.0:5000) restapi base url = <base path> (default /api/v0.1) restapi log level = (error, warning, info, debug) restapi log file = (default /var/log/ceph/<clientname>.log) Primitive human-level command discovery is supported; GET from BASEURL (say, http://localhost:5000/api/v0.1) will show an HTML table of all commands and arguments, method supported, and help strings. Signed-off-by: Dan Mick <dan.mick@inktank.com>