Merge PR #20913 into master

* refs/pull/20913/head:
	client: add ceph_ll_sync_inode

Reviewed-by: John Spray <john.spray@redhat.com>
Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Zheng Yan <zyan@redhat.com>
This commit is contained in:
Patrick Donnelly 2018-03-27 14:54:21 -07:00
commit 5a6c248fa0
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB
4 changed files with 22 additions and 0 deletions

View File

@ -12956,6 +12956,19 @@ int Client::ll_fsync(Fh *fh, bool syncdataonly)
return r;
}
int Client::ll_sync_inode(Inode *in, bool syncdataonly)
{
Mutex::Locker lock(client_lock);
ldout(cct, 3) << "ll_sync_inode " << *in << " " << dendl;
tout(cct) << "ll_sync_inode" << std::endl;
tout(cct) << (unsigned long)in << std::endl;
if (unmounting)
return -ENOTCONN;
return _fsync(in, syncdataonly);
}
#ifdef FALLOC_FL_PUNCH_HOLE
int Client::_fallocate(Fh *fh, int mode, int64_t offset, int64_t length)

View File

@ -1230,6 +1230,7 @@ public:
loff_t ll_lseek(Fh *fh, loff_t offset, int whence);
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_release(Fh *fh);
int ll_getlk(Fh *fh, struct flock *fl, uint64_t owner);

View File

@ -1487,6 +1487,8 @@ int ceph_ll_read(struct ceph_mount_info *cmount, struct Fh* filehandle,
int64_t off, uint64_t len, char* buf);
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_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,

View File

@ -1520,6 +1520,12 @@ extern "C" int ceph_ll_fsync(class ceph_mount_info *cmount,
return (cmount->get_client()->ll_fsync(fh, syncdataonly));
}
extern "C" int ceph_ll_sync_inode(class ceph_mount_info *cmount,
Inode *in, int syncdataonly)
{
return (cmount->get_client()->ll_sync_inode(in, syncdataonly));
}
extern "C" off_t ceph_ll_lseek(class ceph_mount_info *cmount,
Fh *fh, off_t offset, int whence)
{