return statfs(0, stbuf, perms);
}
-void Client::ll_register_callbacks(struct client_callback_args *args)
+void Client::ll_register_callbacks(struct ceph_client_callback_args *args)
{
if (!args)
return;
struct MetaRequest;
class ceph_lock_state_t;
-
-typedef void (*client_ino_callback_t)(void *handle, vinodeno_t ino, int64_t off, int64_t len);
-
-typedef void (*client_dentry_callback_t)(void *handle, vinodeno_t dirino,
- vinodeno_t ino, const char *name,
- size_t len);
-typedef int (*client_remount_callback_t)(void *handle);
-
-typedef void(*client_switch_interrupt_callback_t)(void *handle, void *data);
-typedef mode_t (*client_umask_callback_t)(void *handle);
-
-/* Callback for delegation recalls */
-typedef void (*ceph_deleg_cb_t)(Fh *fh, void *priv);
-
-struct client_callback_args {
- void *handle;
- client_ino_callback_t ino_cb;
- client_dentry_callback_t dentry_cb;
- client_switch_interrupt_callback_t switch_intr_cb;
- client_remount_callback_t remount_cb;
- client_umask_callback_t umask_cb;
-};
-
// ========================================================
// client interface
int ll_osdaddr(int osd, uint32_t *addr);
int ll_osdaddr(int osd, char* buf, size_t size);
- void ll_register_callbacks(struct client_callback_args *args);
+ void ll_register_callbacks(struct ceph_client_callback_args *args);
int test_dentry_handling(bool can_invalidate);
const char** get_tracked_conf_keys() const override;
#include "common/Clock.h"
#include "common/Timer.h"
-
-class Fh;
+#include "include/cephfs/ceph_ll_client.h"
/* Commands for manipulating delegation state */
#ifndef CEPH_DELEGATION_NONE
# define CEPH_DELEGATION_WR 2
#endif
-/* Callback for delegation recalls */
-typedef void (*ceph_deleg_cb_t)(Fh *fh, void *priv);
-
/* Converts CEPH_DELEGATION_* to cap mask */
int ceph_deleg_caps_for_type(unsigned type);
#endif
- struct client_callback_args args = {
+ struct ceph_client_callback_args args = {
handle: this,
ino_cb: client->cct->_conf.get_val<bool>("fuse_use_invalidate_cb") ?
ino_invalidate_cb : NULL,
#ifdef __cplusplus
extern "C" {
-#endif
+
+class Fh;
+
+struct inodeno_t;
+struct vinodeno_t;
+typedef struct vinodeno_t vinodeno;
+
+#else /* __cplusplus */
+
+typedef struct Fh Fh;
+
+typedef struct inodeno_t {
+ uint64_t val;
+} inodeno_t;
+
+typedef struct _snapid_t {
+ uint64_t val;
+} snapid_t;
+
+typedef struct vinodeno_t {
+ inodeno_t ino;
+ snapid_t snapid;
+} vinodeno_t;
+
+#endif /* __cplusplus */
/*
* Heavily borrowed from David Howells' draft statx patchset.
*/
#define CEPH_REQ_FLAG_MASK (AT_SYMLINK_NOFOLLOW|AT_NO_ATTR_SYNC)
+/* delegation recalls */
+typedef void (*ceph_deleg_cb_t)(Fh *fh, void *priv);
+
+/* inode data/metadata invalidation */
+typedef void (*client_ino_callback_t)(void *handle, vinodeno_t ino,
+ int64_t off, int64_t len);
+
+/* dentry invalidation */
+typedef void (*client_dentry_callback_t)(void *handle, vinodeno_t dirino,
+ vinodeno_t ino, const char *name,
+ size_t len);
+
+/* remount entire fs */
+typedef int (*client_remount_callback_t)(void *handle);
+
+/* lock request interrupted */
+typedef void (*client_switch_interrupt_callback_t)(void *handle, void *data);
+
+/* fetch umask of actor */
+typedef mode_t (*client_umask_callback_t)(void *handle);
+
+/*
+ * The handle is an opaque value that gets passed to some callbacks. Any fields
+ * set to NULL will be left alone. There is no way to unregister callbacks.
+ */
+struct ceph_client_callback_args {
+ void *handle;
+ client_ino_callback_t ino_cb;
+ client_dentry_callback_t dentry_cb;
+ client_switch_interrupt_callback_t switch_intr_cb;
+ client_remount_callback_t remount_cb;
+ client_umask_callback_t umask_cb;
+};
+
#ifdef __cplusplus
}
#endif
uint32_t fl_pg_pool; /* namespace, crush ruleset, rep level */
} __attribute__ ((packed));
-
-typedef struct inodeno_t {
- uint64_t val;
-} inodeno_t;
-
-typedef struct _snapid_t {
- uint64_t val;
-} snapid_t;
-
-typedef struct vinodeno_t {
- inodeno_t ino;
- snapid_t snapid;
-} vinodeno_t;
-
-typedef struct Fh Fh;
-#else /* _cplusplus */
-
-struct inodeno_t;
-struct vinodeno_t;
-typedef struct vinodeno_t vinodeno;
-
#endif /* ! __cplusplus */
struct UserPerm;
* needs, but it should take care to choose a value that allows it to avoid
* forcible eviction from the cluster in the event of an application bug.
*/
-typedef void (*ceph_deleg_cb_t)(struct Fh *fh, void *priv);
/* Commands for manipulating delegation state */
#ifndef CEPH_DELEGATION_NONE
goto fail;
{
- client_callback_args args = {};
+ ceph_client_callback_args args = {};
args.handle = this;
args.umask_cb = umask_cb;
client->ll_register_callbacks(&args);