]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
filestore: include <linux/falloc.h> 20415/head
authorwumingqiao <wumingqiao@inspur.com>
Tue, 13 Feb 2018 07:50:18 +0000 (15:50 +0800)
committerwumingqiao <wumingqiao@inspur.com>
Thu, 22 Feb 2018 02:29:39 +0000 (10:29 +0800)
see https://github.com/ceph/ceph/pull/7768
because we neither define FALLOC_FL_KEEP_SIZE nor include linux/falloc.h,this pull actually disable punching hole.

Signed-off-by: wumingqiao <wumingqiao@inspur.com>
src/os/filestore/FileStore.cc
src/os/filestore/FileStore.h
src/os/fs/FS.cc

index 6a0fd8603c6387a8f6bf55b2db43c40201f9d895..8d6fc3eae65ce6e9b3f7e966eef9acc7f22fd0fe 100644 (file)
@@ -28,6 +28,7 @@
 
 #if defined(__linux__)
 #include <linux/fs.h>
+#include <linux/falloc.h>
 #endif
 
 #include <iostream>
index 9aeaefa7f3c5a9994cbd70ca4b5ce65e60124241..85300caf12fc6e384292be4d6ddbba02310f1d59 100644 (file)
 
 #include "include/uuid.h"
 
-
-// from include/linux/falloc.h:
-#ifndef FALLOC_FL_PUNCH_HOLE
-# define FALLOC_FL_PUNCH_HOLE 0x2
-#endif
-
 #if defined(__linux__)
 # ifndef BTRFS_SUPER_MAGIC
 #define BTRFS_SUPER_MAGIC 0x9123683EL
index e73586c0411e4c4f2a264f02d0ab7eac8f00bb6c..9cfa103b939abb58643ee898b482b82ab8bf3abe 100644 (file)
@@ -17,9 +17,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-// from include/linux/falloc.h:
-#ifndef FALLOC_FL_PUNCH_HOLE
-# define FALLOC_FL_PUNCH_HOLE 0x2
+#ifdef __linux__
+#include <linux/falloc.h>
 #endif
 
 #include "FS.h"