From: Ian Holsman Date: Tue, 5 Aug 2008 02:53:45 +0000 (-0700) Subject: darwin changes X-Git-Tag: v0.4~318^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e5e4ce07aafbe77e237c460efcbf38996dc9224d;p=ceph.git darwin changes --- diff --git a/src/client/Client.cc b/src/client/Client.cc index d4d64014daa3..08a050e09f58 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -28,6 +28,7 @@ #include using namespace std; +#include "config.h" // ceph stuff #include "Client.h" diff --git a/src/client/SyntheticClient.cc b/src/client/SyntheticClient.cc index 0d654700ee25..9afd3cbee8fb 100644 --- a/src/client/SyntheticClient.cc +++ b/src/client/SyntheticClient.cc @@ -17,6 +17,7 @@ using namespace std; +#include "config.h" #include "SyntheticClient.h" #include "osdc/Objecter.h" #include "osdc/Filer.h" diff --git a/src/common/Clock.cc b/src/common/Clock.cc index 8b07f6d9eb15..a41fdc1c6859 100644 --- a/src/common/Clock.cc +++ b/src/common/Clock.cc @@ -13,6 +13,7 @@ */ +#include "config.h" #include "Clock.h" // public diff --git a/src/ebofs/Allocator.cc b/src/ebofs/Allocator.cc index 7e4afea95dcc..641cb916ed84 100644 --- a/src/ebofs/Allocator.cc +++ b/src/ebofs/Allocator.cc @@ -14,6 +14,7 @@ +#include "config.h" #include "Allocator.h" #include "Ebofs.h" diff --git a/src/ebofs/BlockDevice.cc b/src/ebofs/BlockDevice.cc index aee22b228531..7e6f250a03e5 100644 --- a/src/ebofs/BlockDevice.cc +++ b/src/ebofs/BlockDevice.cc @@ -12,9 +12,9 @@ * */ +#include "config.h" #include "BlockDevice.h" -#include "config.h" #include #include @@ -34,6 +34,9 @@ #ifndef __CYGWIN__ #ifndef DARWIN #include +#else +/* lseek works on 64-bit offsets on OS/X */ +#define lseek64 lseek #endif #endif diff --git a/src/include/buffer.h b/src/include/buffer.h index f8dba1b872f9..591037ce8e4d 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -17,7 +17,22 @@ #define _XOPEN_SOURCE 600 #include +#ifdef DARWIN + +#ifndef MAP_ANON +#define MAP_ANON 0x1000 +#endif +#ifndef O_DIRECTORY +#define O_DIRECTORY 0x100000 +void *valloc(size_t); +#endif + + + +#else + #include +#endif #include #include #include diff --git a/src/mds/LogEvent.cc b/src/mds/LogEvent.cc index 24920369d771..d1ccb467c139 100644 --- a/src/mds/LogEvent.cc +++ b/src/mds/LogEvent.cc @@ -12,6 +12,7 @@ * */ +#include "config.h" #include "LogEvent.h" #include "MDS.h" diff --git a/src/mds/journal.cc b/src/mds/journal.cc index 06e7432f6dab..1d257cdf0fee 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -12,6 +12,7 @@ * */ +#include "config.h" #include "events/EString.h" #include "events/ESubtreeMap.h" #include "events/ESession.h" diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 225e57b55514..b6cfd1d03382 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -12,6 +12,7 @@ * */ +#include "config.h" #include "FileJournal.h" #include @@ -20,7 +21,6 @@ #include -#include "config.h" #define dout(x) if (x <= g_conf.debug_journal) *_dout << dbeginl << g_clock.now() << " journal " #define derr(x) if (x <= g_conf.debug_journal) *_derr << dbeginl << g_clock.now() << " journal " diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index dfca55362a0c..5241479e9d4f 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -445,6 +445,9 @@ int FileStore::umount() int FileStore::transaction_start(int len) { +#ifdef DARWIN + return 0; +#else if (!btrfs || !btrfs_trans_start_end || !g_conf.filestore_btrfs_trans) return 0; @@ -478,10 +481,14 @@ int FileStore::transaction_start(int len) ::mknod(fn, 0644, 0); return fd; +#endif /* DARWIN */ } void FileStore::transaction_end(int fd) { +#ifdef DARWIN + return; +#else if (!btrfs || !btrfs_trans_start_end || !g_conf.filestore_btrfs_trans) return; @@ -500,10 +507,15 @@ void FileStore::transaction_end(int fd) _handle_signal(sig_pending); } sig_lock.Unlock(); +#endif /* DARWIN */ } unsigned FileStore::apply_transaction(Transaction &t, Context *onsafe) { +#ifdef DARWIN + return ObjectStore::apply_transaction(t, onsafe); +#else + // no btrfs transaction support? // or, use trans start/end ioctls? if (!btrfs || btrfs_trans_start_end) @@ -896,6 +908,7 @@ unsigned FileStore::apply_transaction(Transaction &t, Context *onsafe) delete onsafe; return r; +#endif /* DARWIN */ } @@ -1050,9 +1063,13 @@ int FileStore::clone(coll_t cid, pobject_t oldoid, pobject_t newoid) if (n < 0) return -errno; int r = 0; +#ifndef DARWIN if (btrfs) r = ::ioctl(n, BTRFS_IOC_CLONE, o); else { +#else + { +#endif /* DARWIN */ struct stat st; ::fstat(o, &st);