return _rmdir(snapdir, name);
}
+// =============================
+// expose caps
+
+int Client::get_caps_issued(int fd) {
+
+ Mutex::Locker lock(client_lock);
+ Fh *f = get_filehandle(fd);
+ return f->inode->caps_issued();
+}
+
+int Client::get_caps_issued(const char *path) {
+
+ Mutex::Locker lock(client_lock);
+ filepath p(path);
+ Inode *in;
+ int r = path_walk(p, &in, true);
+ if (r < 0)
+ return r;
+ return in->caps_issued();
+}
// =========================================
// low level
assert(flags == CEPH_OSD_FLAG_LOCALIZE_READS);
objecter->clear_global_op_flag(flags);
}
+
int mksnap(const char *path, const char *name);
int rmsnap(const char *path, const char *name);
+ // expose caps
+ int get_caps_issued(int fd);
+ int get_caps_issued(const char *path);
+
// low-level interface
int ll_lookup(vinodeno_t parent, const char *name, struct stat *attr, int uid = -1, int gid = -1);
bool ll_forget(vinodeno_t vino, int count);
/** @} default_filelayout */
+/**
+ * Get the capabilities currently issued to the client.
+ *
+ * @param cmount the ceph mount handle to use.
+ * @param fd the file descriptor to get issued
+ * @returns the current capabilities issued to this client
+ * for the open file
+ */
+int ceph_debug_get_fd_caps(struct ceph_mount_info *cmount, int fd);
+
+/**
+ * Get the capabilities currently issued to the client.
+ *
+ * @param cmount the ceph mount handle to use.
+ * @param the path to the file
+ * @returns the current capabilities issued to this client
+ * for the file
+ */
+int ceph_debug_get_file_caps(struct ceph_mount_info *cmount, const char *path);
+
#ifdef __cplusplus
}
#endif
{
return cmount->get_ceph_context();
}
+
+extern "C" int ceph_debug_get_fd_caps(struct ceph_mount_info *cmount, int fd)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+ return cmount->get_client()->get_caps_issued(fd);
+}
+
+extern "C" int ceph_debug_get_file_caps(struct ceph_mount_info *cmount, const char *path)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+ return cmount->get_client()->get_caps_issued(path);
+}