From 88a955733df90def58b63e31e13186f8be7252bf Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 12 Jul 2018 12:02:14 -0400 Subject: [PATCH] client: wire up ceph_ll_fallocate We have ceph_fallocate, but we need the analogous call for the lowlevel interface as well. Add ceph_ll_fallocate. Tracker: http://tracker.ceph.com/issues/24893 Signed-off-by: Jeff Layton --- src/client/Client.cc | 2 +- src/client/Client.h | 2 +- src/include/cephfs/libcephfs.h | 2 ++ src/libcephfs.cc | 6 ++++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 1dc85f056d7..b330f096e73 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -13169,7 +13169,7 @@ int Client::_fallocate(Fh *fh, int mode, int64_t offset, int64_t length) #endif -int Client::ll_fallocate(Fh *fh, int mode, loff_t offset, loff_t length) +int Client::ll_fallocate(Fh *fh, int mode, int64_t offset, int64_t length) { Mutex::Locker lock(client_lock); ldout(cct, 3) << __func__ << " " << fh << " " << fh->inode->ino << " " << dendl; diff --git a/src/client/Client.h b/src/client/Client.h index c876f09b131..24f2bcbb3af 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -1229,7 +1229,7 @@ public: int ll_flush(Fh *fh); int ll_fsync(Fh *fh, bool syncdataonly); int ll_sync_inode(Inode *in, bool syncdataonly); - int ll_fallocate(Fh *fh, int mode, loff_t offset, loff_t length); + int ll_fallocate(Fh *fh, int mode, int64_t offset, int64_t length); int ll_release(Fh *fh); int ll_getlk(Fh *fh, struct flock *fl, uint64_t owner); int ll_setlk(Fh *fh, struct flock *fl, uint64_t owner, int sleep); diff --git a/src/include/cephfs/libcephfs.h b/src/include/cephfs/libcephfs.h index 8f524ec8f31..40eaff28367 100644 --- a/src/include/cephfs/libcephfs.h +++ b/src/include/cephfs/libcephfs.h @@ -1508,6 +1508,8 @@ int ceph_ll_fsync(struct ceph_mount_info *cmount, struct Fh *fh, int syncdataonly); int ceph_ll_sync_inode(struct ceph_mount_info *cmount, struct Inode *in, int syncdataonly); +int ceph_ll_fallocate(struct ceph_mount_info *cmount, struct Fh *fh, + int mode, int64_t offset, int64_t length); int ceph_ll_write(struct ceph_mount_info *cmount, struct Fh* filehandle, int64_t off, uint64_t len, const char *data); int64_t ceph_ll_readv(struct ceph_mount_info *cmount, struct Fh *fh, diff --git a/src/libcephfs.cc b/src/libcephfs.cc index e456abd1ab2..a5e3858bcd4 100644 --- a/src/libcephfs.cc +++ b/src/libcephfs.cc @@ -1546,6 +1546,12 @@ extern "C" int ceph_ll_sync_inode(class ceph_mount_info *cmount, return (cmount->get_client()->ll_sync_inode(in, syncdataonly)); } +extern "C" int ceph_ll_fallocate(class ceph_mount_info *cmount, Fh *fh, + int mode, int64_t offset, int64_t length) +{ + return cmount->get_client()->ll_fallocate(fh, mode, offset, length); +} + extern "C" off_t ceph_ll_lseek(class ceph_mount_info *cmount, Fh *fh, off_t offset, int whence) { -- 2.39.5