]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
darwin changes
authorIan Holsman <lists@holsman.net>
Tue, 5 Aug 2008 02:53:45 +0000 (19:53 -0700)
committerSage Weil <sage@newdream.net>
Tue, 5 Aug 2008 02:54:25 +0000 (19:54 -0700)
src/client/Client.cc
src/client/SyntheticClient.cc
src/common/Clock.cc
src/ebofs/Allocator.cc
src/ebofs/BlockDevice.cc
src/include/buffer.h
src/mds/LogEvent.cc
src/mds/journal.cc
src/os/FileJournal.cc
src/os/FileStore.cc

index d4d64014daa3071c6db19e5370e76697cebf0eb8..08a050e09f585c641df88c84abcecabf2e689173 100644 (file)
@@ -28,6 +28,7 @@
 #include <iostream>
 using namespace std;
 
+#include "config.h"
 
 // ceph stuff
 #include "Client.h"
index 0d654700ee25473cbeeb19798bf37fa02c3de345..9afd3cbee8fb58f42e171bd3d8d4a5e3de71d177 100644 (file)
@@ -17,6 +17,7 @@
 using namespace std;
 
 
+#include "config.h"
 #include "SyntheticClient.h"
 #include "osdc/Objecter.h"
 #include "osdc/Filer.h"
index 8b07f6d9eb15f9622496cf49570e7b964169d52e..a41fdc1c6859d6915a80aec0c48d37d9d6727aef 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 
+#include "config.h"
 #include "Clock.h"
 
 // public
index 7e4afea95dccfccdbfb1a4e7034cb78a711e7a5e..641cb916ed8453fe80039327599cc0c201c5af32 100644 (file)
@@ -14,6 +14,7 @@
 
 
 
+#include "config.h"
 #include "Allocator.h"
 #include "Ebofs.h"
 
index aee22b22853109c349a2598bab7ec50e109033c9..7e6f250a03e5478f5cedc2fc559fb650a5174a10 100644 (file)
@@ -12,9 +12,9 @@
  * 
  */
 
+#include "config.h"
 #include "BlockDevice.h"
 
-#include "config.h"
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -34,6 +34,9 @@
 #ifndef __CYGWIN__
 #ifndef DARWIN
 #include <linux/fs.h>
+#else
+/* lseek works on 64-bit offsets on OS/X */
+#define lseek64 lseek
 #endif
 #endif
 
index f8dba1b872f9708843064b1123fbea6abc7dcb0d..591037ce8e4df5367cb9d6ee18decffe8b7459dc 100644 (file)
 
 #define _XOPEN_SOURCE 600
 #include <stdlib.h>
+#ifdef DARWIN
+
+#ifndef MAP_ANON
+#define MAP_ANON 0x1000
+#endif
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 0x100000
+void   *valloc(size_t);
+#endif
+
+
+
+#else
+
 #include <malloc.h>
+#endif
 #include <stdint.h>
 #include <assert.h>
 #include <string.h>
index 24920369d771a56d50962caef52e5ddf1c70305c..d1ccb467c1397a595ac627f147d484d8af1f4be6 100644 (file)
@@ -12,6 +12,7 @@
  * 
  */
 
+#include "config.h"
 #include "LogEvent.h"
 
 #include "MDS.h"
index 06e7432f6dab50ba30edd15f60f142e691786c29..1d257cdf0fee34b263443864c5a24a0813560c02 100644 (file)
@@ -12,6 +12,7 @@
  * 
  */
 
+#include "config.h"
 #include "events/EString.h"
 #include "events/ESubtreeMap.h"
 #include "events/ESession.h"
index 225e57b555141546e85ec58c36d81013c3ca7a12..b6cfd1d03382bbc27f39f43a111f725e9ee8691b 100644 (file)
@@ -12,6 +12,7 @@
  * 
  */
 
+#include "config.h"
 #include "FileJournal.h"
 
 #include <stdio.h>
@@ -20,7 +21,6 @@
 #include <fcntl.h>
 
 
-#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 "
index dfca55362a0c52d259b559eabac0d798eebbaf7a..5241479e9d4fcceee1328d862f58832689bd4214 100644 (file)
@@ -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);