]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/FileStore: fail with ENOTSUP if using sparse files on DARWIN
authorDennis Schafroth <dennis@schafroth.dk>
Tue, 30 Jun 2015 18:10:19 +0000 (20:10 +0200)
committerKefu Chai <kchai@redhat.com>
Mon, 31 Aug 2015 07:35:56 +0000 (15:35 +0800)
For now, fail with Not supported (ENOTSUP) if configured using sparse files on DARWIN.

Signed-off-by: Dennis Schafroth <dennis@schafroth.com>
src/os/GenericFileStoreBackend.cc

index 508f533ab2f6e4698a827c9b83480e258c14b167..9d74df769e07f8060364fd9f3e71c4bac6ab5742 100644 (file)
@@ -281,11 +281,15 @@ int GenericFileStoreBackend::do_fiemap(int fd, off_t start, size_t len, struct f
   fiemap->fm_length = len + start % CEPH_PAGE_SIZE;
   fiemap->fm_flags = FIEMAP_FLAG_SYNC; /* flush extents to disk if needed */
 
+#if defined(DARWIN)
+  ret = -ENOTSUP;
+  goto done_err;
+#else
   if (ioctl(fd, FS_IOC_FIEMAP, fiemap) < 0) {
     ret = -errno;
     goto done_err;
   }
-
+#endif
   size = sizeof(struct fiemap_extent) * (fiemap->fm_mapped_extents);
 
   _realloc_fiemap = (struct fiemap *)realloc(fiemap, sizeof(struct fiemap) + size);
@@ -301,12 +305,16 @@ int GenericFileStoreBackend::do_fiemap(int fd, off_t start, size_t len, struct f
   fiemap->fm_extent_count = fiemap->fm_mapped_extents;
   fiemap->fm_mapped_extents = 0;
 
+#if defined(DARWIN)
+  ret = -ENOTSUP;
+  goto done_err;
+#else
   if (ioctl(fd, FS_IOC_FIEMAP, fiemap) < 0) {
     ret = -errno;
     goto done_err;
   }
   *pfiemap = fiemap;
-
+#endif
   return 0;
 
 done_err: