*/
int ceph_rmsnap(struct ceph_mount_info *cmount, const char *path, const char *name);
+/**
+ * Add, update or remove snapshot metadata.
+ *
+ * @param cmount the ceph mount handle to use for making the directory.
+ * @param path the path of the snapshot. This must be either an absolute
+ * path or a path relative to CWD.
+ * @param mds_key key for the key-value pair in snapshot metadata.
+ * @param mds_val value for the key-value pair in snapshot metadata.
+ * @param op_flag unsigned integer to indicate whether metadata op is create,
+ * update or remove.
+ * @returns 0 on success or a negative return value on error.
+ */
+int ceph_do_snap_md_op(struct ceph_mount_info* cmount, const char* path,
+ const char* md_key, const char* md_val,
+ const unsigned int op_flag);
+
/**
* Create multiple directories at once.
*
return cmount->get_client()->rmsnap(path, name, cmount->default_perms, true);
}
+extern "C" int ceph_do_snap_md_op(struct ceph_mount_info* cmount,
+ const char* path, const char* md_key,
+ const char* md_val,
+ const unsigned int op_flag)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+
+ return cmount->get_client()->do_snap_md_op(path, md_key, md_val, op_flag,
+ cmount->default_perms);
+}
+
extern "C" int ceph_mkdirs(struct ceph_mount_info *cmount, const char *path, mode_t mode)
{
if (!cmount->is_mounted())