int ceph_flock(struct ceph_mount_info *cmount, int fd, int operation,
uint64_t owner);
+/**
+ * Test the existence of a record lock.
+ *
+ * @param cmount the ceph mount handle to use for performing the lock.
+ * @param fd the open file descriptor to test the existence of a record lock.
+ * @param pointer to an flock structure.
+ * @param owner the user-supplied owner identifier (an arbitrary integer)
+ * @returns 0 on success or negative error code on failure.
+ */
+ int ceph_getlk(struct ceph_mount_info *cmount, int fd, struct flock *flock,
+ uint64_t owner);
+
+/**
+ * Set a record lock.
+ *
+ * @param cmount the ceph mount handle to use for performing the lock.
+ * @param fd the open file descriptor to set a record lock
+ * @param pointer to an flock structure.
+ * @param owner the user-supplied owner identifier (an arbitrary integer)
+ * @param sleep the user-supplied sleep flag
+ * @returns 0 on success or negative error code on failure.
+ */
+
+ int ceph_setlk(struct ceph_mount_info *cmount, int fd, struct flock *flock,
+ uint64_t owner, int sleep);
+
/**
* Truncate the file to the given size. If this operation causes the
* file to expand, the empty bytes will be filled in with zeros.
return cmount->get_client()->flock(fd, operation, owner);
}
+extern "C" int ceph_getlk(struct ceph_mount_info *cmount, int fd, struct flock *fl,
+ uint64_t owner)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+ return cmount->get_client()->getlk(fd, fl, owner);
+}
+
+extern "C" int ceph_setlk(struct ceph_mount_info *cmount, int fd, struct flock *fl,
+ uint64_t owner, int sleep)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+ return cmount->get_client()->setlk(fd, fl, owner, sleep);
+}
+
extern "C" int ceph_truncate(struct ceph_mount_info *cmount, const char *path,
int64_t size)
{