From: Jianpeng Ma Date: Mon, 29 Sep 2014 03:00:25 +0000 (+0800) Subject: os/FileStore: using FIEMAP_FLAGS_SYNC instead of fsync() before call X-Git-Tag: v0.88~78^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f029ff4d4a8630e93a260ae963e56c3481f6a44;p=ceph.git os/FileStore: using FIEMAP_FLAGS_SYNC instead of fsync() before call fiemap. When call fiemap, it need sync the file. Now it used fsync() to achieve this. But for fiemap, there is a flag FIEMAP_FLAGS_SYNC which do the same thing like fsync(). Signed-off-by: Jianpeng Ma --- diff --git a/src/os/GenericFileStoreBackend.cc b/src/os/GenericFileStoreBackend.cc index 56deeb21193d..5cf7f54d7d59 100644 --- a/src/os/GenericFileStoreBackend.cc +++ b/src/os/GenericFileStoreBackend.cc @@ -221,8 +221,7 @@ int GenericFileStoreBackend::do_fiemap(int fd, off_t start, size_t len, struct f fiemap->fm_start = start; fiemap->fm_length = len; - - fsync(fd); /* flush extents to disk if needed */ + fiemap->fm_flags = FIEMAP_FLAG_SYNC; /* flush extents to disk if needed */ if (ioctl(fd, FS_IOC_FIEMAP, fiemap) < 0) { ret = -errno;