summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* wip: assorted fixes for FreeBSD 9.1wip-portNoah Watkins2013-09-1721-5/+53
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* wip: unsorted / combined patchesNoah Watkins2013-09-1712-8/+56
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* rados_sync: use pthread features for thread-localNoah Watkins2013-09-171-5/+17
| | | | | | | OSX doesn't seem to like __thread way of setting thread local data. But the same thing can be accomplished with pthread_get/setspecific. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* kvstore: use a standard errno valueNoah Watkins2013-09-172-8/+8
| | | | | | | | | | | | Some of the high numbered errno.h values are only available on Linux. I couldn't find any users in the tree that would be effected by this change, and it wasn't clear if the value would collide with other errors or be leaked out to a client. Are there any users of this library? Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* networking: assorted networking fixesNoah Watkins2013-09-172-4/+14
| | | | | | Unsure about how to properly do networking portable. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* Pipe: do not use MSG_MORE on OSXNoah Watkins2013-09-171-0/+4
| | | | | | | | | | | MSG_MORE is not available on OSX, and unlike MSG_NOSIGNAL, there doesn't appear to be an equivalent. It is not clear if MSG_MORE effects correctness or is just an optimization. If the MSG_MORE semantics are required for correctness, we may be able to use TCP_CORK to do this on OSX. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* test: add header for struct statfsNoah Watkins2013-09-171-0/+2
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* ceph.in: use env to find python interpreterNoah Watkins2013-09-171-1/+1
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* Pipe: define OSX equivalent of MSG_NOSIGNALNoah Watkins2013-09-171-0/+4
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* rgw: avoid linuxism sighandler_t in favor of sig_tNoah Watkins2013-09-171-1/+3
| | | | | | | Note that according to Linux manpage, signal(2) for custom handler functions isn't portable, and sigaction should be used instead. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* rgw: add compat file for name service macrosNoah Watkins2013-09-172-0/+7
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* inttypes: detect and define missing integer typesNoah Watkins2013-09-1713-7/+61
| | | | | | | | | | | Working around missing integer types is pretty easy. For example, the __u32 family are Linux-specific types, and using these in Ceph internally is fine because we can typedef them, but the biggest problem is that they are also used in installed headers. Again, they could be typedefed in the installed headers, but it isn't clear that we can't just use standard ints in installed headers. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* build: use flat namespace when linking on OSXNoah Watkins2013-09-172-1/+10
| | | | | | | | This a compatibility feature to avoid using OSX two-level namespacing. Ideally we can get rid of this, but it'll take some deeper understanding of the problem. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* byteorder.h: add macros for DarwinNoah Watkins2013-09-171-1/+3
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* FileJournal: zero-fill in-lieu of posix_fallocateNoah Watkins2013-09-172-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>
* hashing: add missing hash functionsNoah Watkins2013-09-172-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-09-171-0/+1
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* fuse: define IOCTL flags for non-Linux systemNoah Watkins2013-09-171-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-09-172-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: use pkg-config to check for libfuseNoah Watkins2013-09-173-18/+14
| | | | | | | Provides better portability. Currently works on all the gitbuilder platforms, as well as OSX with fuse4x installed. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* spinlock: add generic spinlock implementationNoah Watkins2013-09-178-33/+116
| | | | | | | | | | | | | | | | | | | 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-09-171-36/+26
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* xattr: test for xattr routine variantsNoah Watkins2013-09-172-38/+82
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* pipe: use feature tests for pipe2 and O_CLOEXECNoah Watkins2013-09-172-14/+22
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* doc: add osx build documentationNoah Watkins2013-09-171-0/+14
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* mon: check for platform specific headersNoah Watkins2013-09-172-0/+11
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* context: handle platform without sem_timedwaitNoah Watkins2013-09-172-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-09-172-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-09-171-2/+3
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* blkdev: support blkdev size query on osxNoah Watkins2013-09-172-15/+46
| | | | | | Support OSX, add checks for platform specific headers. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* doc: add dev doc to collect porting notesNoah Watkins2013-09-171-0/+19
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* code_env: use feature test for PR_GET_NAME supportNoah Watkins2013-09-172-8/+10
| | | | | | | Function `get_process_name` has platform specific dependencies. Check for Linux prctl function and correct command flag. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* autoconf: search for uuid_parse in system libsNoah Watkins2013-09-172-2/+3
| | | | | | | | | 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-09-175-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-09-174-23/+181
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* assert: choose function-var name on non-gnuNoah Watkins2013-09-174-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-09-173-1/+46
| | | | Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* autogen.sh: use glibtoolize when availableNoah Watkins2013-09-171-1/+11
| | | | | | libtoolize is called glibtoolize on osx. Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* osd: compute full ratio from kb_availAlexandre Oliva2013-09-171-1/+6
| | | | | | | | | | On btrfs, kb_used + kb_avail can be much smaller than total kb, and what really matters to avoid filling up the disk is how much space is available, not how much we've used. Thus, compute the ratio we use to determine full or nearfull from kb_avail rather than from kb_used. Signed-off-by: Alexandre Oliva <oliva@gnu.org> Signed-off-by: Sage Weil <sage@inktank.com>
* Merge pull request #601 from pipul/feature/develop_130917Josh Durgin2013-09-161-1/+1
|\ | | | | Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
| * fix some commentsfangdong2013-09-171-1/+1
| | | | | | | | Signed-off-by: fangdong <yp.fangdong@gmail.com>
* | doc: Updated usage.John Wilkins2013-09-161-8/+4
| | | | | | | | Signed-off-by: John Wilkins <john.wilkins@inktank.com>
* | doc: Removed --fs-type option and text.John Wilkins2013-09-161-4/+0
| | | | | | | | | | | | fixes: #6326 Signed-off-by: John Wilkins <john.wilkins@inktank.com>
* | doc: Updated the usage scenario and made a few syntax edits.John Wilkins2013-09-161-14/+17
| | | | | | | | | | | | fixes: #6308 Signed-off-by: John Wilkins <john.wilkins@inktank.com>
* | Merge pull request #600 from dachary/fix-erasure-warningGregory Farnum2013-09-161-1/+1
|\ \ | | | | | | | | | ErasureCode: fix uninitialized variable warning Reviewed-by: Greg Farnum <greg@inktank.com>
| * | ErasureCode: fix uninitialized variable warningLoic Dachary2013-09-161-1/+1
| |/ | | | | | | Signed-off-by: Loic Dachary <loic@dachary.org>
* | Merge pull request #597 from ceph/remove-hadoop-shimGregory Farnum2013-09-1629-6141/+2
|\ \ | |/ |/| | | | | This branch built fine on the gitbuilders and the list of removed files looks good to me. Reviewed-by: Greg Farnum <greg@inktank.com>
| * hadoop: remove hadoop shimNoah Watkins2013-09-1329-6141/+2
| | | | | | | | | | | | | | | | | | The in-tree Hadoop shim was a combination of libcephfs wrapper, and the bits to support Hadoop. This has been replaced by src/java that implements generic libcephfs wrappers, and externally, the hadoop shim (see docs). Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
* | Merge pull request #538 from dachary/wip-5879athanatos2013-09-1320-0/+6737
|\ \ | |/ |/| | | | | jerasure-1.2A plugin Reviewed-by: Samuel Just <sam.just@inktank.com>
| * ErasureCodeJerasure: pluginLoic Dachary2013-09-104-0/+147
| | | | | | | | | | | | | | | | | | | | | | Create the class matching the string found in the erasure-code-technique parameter, using the same strings are the original {encoder,decoder}.c examples from Jerasure-1.2A. Registers the plugin in ErasureCodePluginRegistry. https://github.com/dachary/ceph/tree/wip-5879 refs #5879 Signed-off-by: Loic Dachary <loic@dachary.org>