1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * scalable distributed file system
6 * Copyright (C) Jeff Layton <jlayton@redhat.com>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
14 #ifndef CEPH_CEPH_LL_CLIENT_H
15 #define CEPH_CEPH_LL_CLIENT_H
19 #include "include/win32/fs_compat.h"
29 typedef struct vinodeno_t vinodeno
;
31 #else /* __cplusplus */
35 typedef struct inodeno_t
{
39 typedef struct _snapid_t
{
43 typedef struct vinodeno_t
{
48 #endif /* __cplusplus */
51 * Heavily borrowed from David Howells' draft statx patchset.
53 * Since the xstat patches are still a work in progress, we borrow its data
54 * structures and #defines to implement ceph_getattrx. Once the xstat stuff
55 * has been merged we should drop this and switch over to using that instead.
69 struct timespec stx_atime
;
70 struct timespec stx_ctime
;
71 struct timespec stx_mtime
;
72 struct timespec stx_btime
;
76 #define CEPH_STATX_MODE 0x00000001U /* Want/got stx_mode */
77 #define CEPH_STATX_NLINK 0x00000002U /* Want/got stx_nlink */
78 #define CEPH_STATX_UID 0x00000004U /* Want/got stx_uid */
79 #define CEPH_STATX_GID 0x00000008U /* Want/got stx_gid */
80 #define CEPH_STATX_RDEV 0x00000010U /* Want/got stx_rdev */
81 #define CEPH_STATX_ATIME 0x00000020U /* Want/got stx_atime */
82 #define CEPH_STATX_MTIME 0x00000040U /* Want/got stx_mtime */
83 #define CEPH_STATX_CTIME 0x00000080U /* Want/got stx_ctime */
84 #define CEPH_STATX_INO 0x00000100U /* Want/got stx_ino */
85 #define CEPH_STATX_SIZE 0x00000200U /* Want/got stx_size */
86 #define CEPH_STATX_BLOCKS 0x00000400U /* Want/got stx_blocks */
87 #define CEPH_STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */
88 #define CEPH_STATX_BTIME 0x00000800U /* Want/got stx_btime */
89 #define CEPH_STATX_VERSION 0x00001000U /* Want/got stx_version */
90 #define CEPH_STATX_ALL_STATS 0x00001fffU /* All supported stats */
93 * Compatibility macros until these defines make their way into glibc
95 #ifndef AT_NO_ATTR_SYNC
96 #define AT_NO_ATTR_SYNC 0x4000 /* Don't sync attributes with the server */
100 * The statx interfaces only allow these flags. In order to allow us to add
101 * others in the future, we disallow setting any that aren't recognized.
103 #define CEPH_REQ_FLAG_MASK (AT_SYMLINK_NOFOLLOW|AT_NO_ATTR_SYNC)
105 /* delegation recalls */
106 typedef void (*ceph_deleg_cb_t
)(Fh
*fh
, void *priv
);
108 /* inode data/metadata invalidation */
109 typedef void (*client_ino_callback_t
)(void *handle
, vinodeno_t ino
,
110 int64_t off
, int64_t len
);
112 /* dentry invalidation */
113 typedef void (*client_dentry_callback_t
)(void *handle
, vinodeno_t dirino
,
114 vinodeno_t ino
, const char *name
,
117 /* remount entire fs */
118 typedef int (*client_remount_callback_t
)(void *handle
);
120 /* lock request interrupted */
121 typedef void (*client_switch_interrupt_callback_t
)(void *handle
, void *data
);
123 /* fetch umask of actor */
124 typedef mode_t (*client_umask_callback_t
)(void *handle
);
126 /* request that application release Inode references */
127 typedef void (*client_ino_release_t
)(void *handle
, vinodeno_t ino
);
130 * The handle is an opaque value that gets passed to some callbacks. Any fields
131 * set to NULL will be left alone. There is no way to unregister callbacks.
133 struct ceph_client_callback_args
{
135 client_ino_callback_t ino_cb
;
136 client_dentry_callback_t dentry_cb
;
137 client_switch_interrupt_callback_t switch_intr_cb
;
138 client_remount_callback_t remount_cb
;
139 client_umask_callback_t umask_cb
;
140 client_ino_release_t ino_release_cb
;
147 #endif /* CEPH_STATX_H */