ceph: request expedited service on session's last cap flush
[linux-2.6-block.git] / fs / ceph / mds_client.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
2f2dc053
SW
2#ifndef _FS_CEPH_MDS_CLIENT_H
3#define _FS_CEPH_MDS_CLIENT_H
4
5#include <linux/completion.h>
153c8e6b 6#include <linux/kref.h>
2f2dc053
SW
7#include <linux/list.h>
8#include <linux/mutex.h>
44ca18f2 9#include <linux/rbtree.h>
2f2dc053 10#include <linux/spinlock.h>
3997c01d 11#include <linux/refcount.h>
717e6f28 12#include <linux/utsname.h>
70c94820 13#include <linux/ktime.h>
2f2dc053 14
3d14c5d2
YS
15#include <linux/ceph/types.h>
16#include <linux/ceph/messenger.h>
17#include <linux/ceph/mdsmap.h>
6c4a1915 18#include <linux/ceph/auth.h>
2f2dc053 19
f9009efa
XL
20#include "metric.h"
21
342ce182 22/* The first 8 bits are reserved for old ceph releases */
9ba1e224
XL
23enum ceph_feature_type {
24 CEPHFS_FEATURE_MIMIC = 8,
25 CEPHFS_FEATURE_REPLY_ENCODING,
26 CEPHFS_FEATURE_RECLAIM_CLIENT,
27 CEPHFS_FEATURE_LAZY_CAP_WANTED,
28 CEPHFS_FEATURE_MULTI_RECONNECT,
d4846487 29 CEPHFS_FEATURE_DELEG_INO,
d2f8bb27 30
d4846487 31 CEPHFS_FEATURE_MAX = CEPHFS_FEATURE_DELEG_INO,
9ba1e224
XL
32};
33
34/*
35 * This will always have the highest feature bit value
36 * as the last element of the array.
37 */
38#define CEPHFS_FEATURES_CLIENT_SUPPORTED { \
d2f8bb27
YZ
39 0, 1, 2, 3, 4, 5, 6, 7, \
40 CEPHFS_FEATURE_MIMIC, \
b37fe1f9 41 CEPHFS_FEATURE_REPLY_ENCODING, \
d2f8bb27 42 CEPHFS_FEATURE_LAZY_CAP_WANTED, \
81c5a148 43 CEPHFS_FEATURE_MULTI_RECONNECT, \
d4846487 44 CEPHFS_FEATURE_DELEG_INO, \
9ba1e224
XL
45 \
46 CEPHFS_FEATURE_MAX, \
342ce182 47}
342ce182
YZ
48#define CEPHFS_FEATURES_CLIENT_REQUIRED {}
49
2f2dc053
SW
50/*
51 * Some lock dependencies:
52 *
53 * session->s_mutex
54 * mdsc->mutex
55 *
56 * mdsc->snap_rwsem
57 *
be655596 58 * ci->i_ceph_lock
2f2dc053
SW
59 * mdsc->snap_flush_lock
60 * mdsc->cap_delay_lock
61 *
62 */
63
3d14c5d2 64struct ceph_fs_client;
2f2dc053
SW
65struct ceph_cap;
66
67/*
68 * parsed info about a single inode. pointers are into the encoded
69 * on-wire structures within the mds reply message payload.
70 */
71struct ceph_mds_reply_info_in {
72 struct ceph_mds_reply_inode *in;
14303d20 73 struct ceph_dir_layout dir_layout;
2f2dc053
SW
74 u32 symlink_len;
75 char *symlink;
76 u32 xattr_len;
77 char *xattr_data;
fb01d1f8
YZ
78 u64 inline_version;
79 u32 inline_len;
80 char *inline_data;
5ea5c5e0 81 u32 pool_ns_len;
779fe0fb 82 char *pool_ns_data;
fb18a575
LH
83 u64 max_bytes;
84 u64 max_files;
08796873 85 s32 dir_pin;
245ce991 86 struct ceph_timespec btime;
193e7b37 87 struct ceph_timespec snap_btime;
a35ead31 88 u64 change_attr;
2f2dc053
SW
89};
90
2a5beea3
YZ
91struct ceph_mds_reply_dir_entry {
92 char *name;
93 u32 name_len;
94 struct ceph_mds_reply_lease *lease;
95 struct ceph_mds_reply_info_in inode;
8974eebd 96 loff_t offset;
2a5beea3
YZ
97};
98
2f2dc053 99/*
25933abd
HS
100 * parsed info about an mds reply, including information about
101 * either: 1) the target inode and/or its parent directory and dentry,
102 * and directory contents (for readdir results), or
103 * 2) the file range lock info (for fcntl F_GETLK results).
2f2dc053
SW
104 */
105struct ceph_mds_reply_info_parsed {
106 struct ceph_mds_reply_head *head;
107
25933abd 108 /* trace */
2f2dc053
SW
109 struct ceph_mds_reply_info_in diri, targeti;
110 struct ceph_mds_reply_dirfrag *dirfrag;
111 char *dname;
112 u32 dname_len;
113 struct ceph_mds_reply_lease *dlease;
114
25933abd
HS
115 /* extra */
116 union {
117 /* for fcntl F_GETLK results */
118 struct ceph_filelock *filelock_reply;
119
120 /* for readdir results */
121 struct {
122 struct ceph_mds_reply_dirfrag *dir_dir;
54008399 123 size_t dir_buf_size;
25933abd 124 int dir_nr;
f3c4ebe6 125 bool dir_end;
79162547 126 bool dir_complete;
f3c4ebe6 127 bool hash_order;
79162547 128 bool offset_hash;
2a5beea3 129 struct ceph_mds_reply_dir_entry *dir_entries;
25933abd 130 };
6e8575fa
SL
131
132 /* for create results */
133 struct {
134 bool has_create_ino;
135 u64 ino;
136 };
25933abd 137 };
2f2dc053
SW
138
139 /* encoded blob describing snapshot contexts for certain
140 operations (e.g., open) */
141 void *snapblob;
142 int snapblob_len;
143};
144
145
146/*
147 * cap releases are batched and sent to the MDS en masse.
92475f05
JL
148 *
149 * Account for per-message overhead of mds_cap_release header
150 * and __le32 for osd epoch barrier trailing field.
2f2dc053 151 */
92475f05 152#define CEPH_CAPS_PER_RELEASE ((PAGE_SIZE - sizeof(u32) - \
2f2dc053 153 sizeof(struct ceph_mds_cap_release)) / \
92475f05 154 sizeof(struct ceph_mds_cap_item))
2f2dc053
SW
155
156
157/*
158 * state associated with each MDS<->client session
159 */
160enum {
161 CEPH_MDS_SESSION_NEW = 1,
162 CEPH_MDS_SESSION_OPENING = 2,
163 CEPH_MDS_SESSION_OPEN = 3,
164 CEPH_MDS_SESSION_HUNG = 4,
7e6906c1
YZ
165 CEPH_MDS_SESSION_RESTARTING = 5,
166 CEPH_MDS_SESSION_RECONNECTING = 6,
167 CEPH_MDS_SESSION_CLOSING = 7,
4d681c2f
XL
168 CEPH_MDS_SESSION_CLOSED = 8,
169 CEPH_MDS_SESSION_REJECTED = 9,
2f2dc053
SW
170};
171
172struct ceph_mds_session {
173 struct ceph_mds_client *s_mdsc;
174 int s_mds;
175 int s_state;
176 unsigned long s_ttl; /* time until mds kills us */
84bf3950 177 unsigned long s_features;
2f2dc053
SW
178 u64 s_seq; /* incoming msg seq # */
179 struct mutex s_mutex; /* serialize session messages */
180
181 struct ceph_connection s_con;
182
6c4a1915 183 struct ceph_auth_handshake s_auth;
4e7a5dcd 184
d8fb02ab
AE
185 /* protected by s_gen_ttl_lock */
186 spinlock_t s_gen_ttl_lock;
2f2dc053
SW
187 u32 s_cap_gen; /* inc each time we get mds stale msg */
188 unsigned long s_cap_ttl; /* when session caps expire */
d8fb02ab
AE
189
190 /* protected by s_cap_lock */
191 spinlock_t s_cap_lock;
045100cd 192 refcount_t s_ref;
2f2dc053 193 struct list_head s_caps; /* all caps issued by this session */
e3ec8d68 194 struct ceph_cap *s_cap_iterator;
533a2818 195 int s_nr_caps;
2f2dc053 196 int s_num_cap_releases;
99a9c273 197 int s_cap_reconnect;
03f4fcb0 198 int s_readonly;
2f2dc053 199 struct list_head s_cap_releases; /* waiting cap_release messages */
e3ec8d68 200 struct work_struct s_cap_release_work;
2f2dc053 201
1cf03a68
JL
202 /* both protected by s_mdsc->cap_dirty_lock */
203 struct list_head s_cap_dirty; /* inodes w/ dirty caps */
2f2dc053 204 struct list_head s_cap_flushing; /* inodes w/ flushing caps */
1cf03a68 205
2f2dc053
SW
206 unsigned long s_renew_requested; /* last time we sent a renew req */
207 u64 s_renew_seq;
208
2f2dc053
SW
209 struct list_head s_waiting; /* waiting requests */
210 struct list_head s_unsafe; /* unsafe requests */
d4846487 211 struct xarray s_delegated_inos;
2f2dc053
SW
212};
213
214/*
215 * modes of choosing which MDS to send a request to
216 */
217enum {
218 USE_ANY_MDS,
219 USE_RANDOM_MDS,
220 USE_AUTH_MDS, /* prefer authoritative mds for this metadata item */
221};
222
223struct ceph_mds_request;
224struct ceph_mds_client;
225
226/*
227 * request completion callback
228 */
229typedef void (*ceph_mds_request_callback_t) (struct ceph_mds_client *mdsc,
230 struct ceph_mds_request *req);
9280be24
YZ
231/*
232 * wait for request completion callback
233 */
234typedef int (*ceph_mds_request_wait_callback_t) (struct ceph_mds_client *mdsc,
235 struct ceph_mds_request *req);
2f2dc053
SW
236
237/*
238 * an in-flight mds request
239 */
240struct ceph_mds_request {
241 u64 r_tid; /* transaction id */
44ca18f2 242 struct rb_node r_node;
37151668 243 struct ceph_mds_client *r_mdsc;
2f2dc053 244
045100cd 245 struct kref r_kref;
2f2dc053 246 int r_op; /* mds op code */
2f2dc053
SW
247
248 /* operation on what? */
249 struct inode *r_inode; /* arg1 */
250 struct dentry *r_dentry; /* arg1 */
251 struct dentry *r_old_dentry; /* arg2: rename from or link from */
41b02e1f 252 struct inode *r_old_dentry_dir; /* arg2: old dentry's parent dir */
2f2dc053
SW
253 char *r_path1, *r_path2;
254 struct ceph_vino r_ino1, r_ino2;
255
3dd69aab 256 struct inode *r_parent; /* parent dir inode */
2f2dc053
SW
257 struct inode *r_target_inode; /* resulting inode */
258
bc2de10d
JL
259#define CEPH_MDS_R_DIRECT_IS_HASH (1) /* r_direct_hash is valid */
260#define CEPH_MDS_R_ABORTED (2) /* call was aborted */
261#define CEPH_MDS_R_GOT_UNSAFE (3) /* got an unsafe reply */
262#define CEPH_MDS_R_GOT_SAFE (4) /* got a safe reply */
263#define CEPH_MDS_R_GOT_RESULT (5) /* got a result */
264#define CEPH_MDS_R_DID_PREPOPULATE (6) /* prepopulated readdir */
3dd69aab 265#define CEPH_MDS_R_PARENT_LOCKED (7) /* is r_parent->i_rwsem wlocked? */
3bb48b41 266#define CEPH_MDS_R_ASYNC (8) /* async request */
bc2de10d
JL
267 unsigned long r_req_flags;
268
b4556396
SW
269 struct mutex r_fill_mutex;
270
2f2dc053
SW
271 union ceph_mds_request_args r_args;
272 int r_fmode; /* file mode, if expecting cap */
ff3d0046
EB
273 kuid_t r_uid;
274 kgid_t r_gid;
c36d6414 275 int r_request_release_offset;
0ed1e90a 276 struct timespec64 r_stamp;
2f2dc053
SW
277
278 /* for choosing which mds to send this request to */
279 int r_direct_mode;
280 u32 r_direct_hash; /* choose dir frag based on this dentry hash */
2f2dc053
SW
281
282 /* data payload is used for xattr ops */
25e6bae3 283 struct ceph_pagelist *r_pagelist;
2f2dc053
SW
284
285 /* what caps shall we drop? */
286 int r_inode_drop, r_inode_unless;
287 int r_dentry_drop, r_dentry_unless;
288 int r_old_dentry_drop, r_old_dentry_unless;
289 struct inode *r_old_inode;
290 int r_old_inode_drop, r_old_inode_unless;
291
292 struct ceph_msg *r_request; /* original request */
293 struct ceph_msg *r_reply;
294 struct ceph_mds_reply_info_parsed r_reply_info;
295 int r_err;
a25949b9
JL
296
297
298 struct page *r_locked_page;
299 int r_dir_caps;
c36d6414
JL
300 int r_num_caps;
301 u32 r_readdir_offset;
2f2dc053 302
a319bf56 303 unsigned long r_timeout; /* optional. jiffies, 0 is "wait forever" */
2f2dc053 304 unsigned long r_started; /* start time to measure timeout against */
70c94820
XL
305 unsigned long r_start_latency; /* start time to measure latency */
306 unsigned long r_end_latency; /* finish time to measure latency */
2f2dc053
SW
307 unsigned long r_request_started; /* start time for mds request only,
308 used to measure lease durations */
309
310 /* link unsafe requests to parent directory, for fsync */
311 struct inode *r_unsafe_dir;
312 struct list_head r_unsafe_dir_item;
313
68cd5b4b
YZ
314 /* unsafe requests that modify the target inode */
315 struct list_head r_unsafe_target_item;
316
2f2dc053
SW
317 struct ceph_mds_session *r_session;
318
319 int r_attempts; /* resend attempts */
320 int r_num_fwd; /* number of forward attempts */
2f2dc053 321 int r_resend_mds; /* mds to resend to next, if any*/
e55b71f8 322 u32 r_sent_on_mseq; /* cap mseq request was sent at*/
6deb8008 323 u64 r_deleg_ino;
2f2dc053 324
2f2dc053
SW
325 struct list_head r_wait;
326 struct completion r_completion;
327 struct completion r_safe_completion;
328 ceph_mds_request_callback_t r_callback;
9280be24 329 ceph_mds_request_wait_callback_t r_wait_for_completion;
2f2dc053 330 struct list_head r_unsafe_item; /* per-session unsafe list item */
2f2dc053 331
fdd4e158
YZ
332 long long r_dir_release_cnt;
333 long long r_dir_ordered_cnt;
334 int r_readdir_cache_idx;
2f2dc053
SW
335
336 struct ceph_cap_reservation r_caps_reservation;
2f2dc053
SW
337};
338
10183a69
YZ
339struct ceph_pool_perm {
340 struct rb_node node;
10183a69 341 int perm;
7627151e 342 s64 pool;
779fe0fb
YZ
343 size_t pool_ns_len;
344 char pool_ns[];
10183a69
YZ
345};
346
75c9627e
YZ
347struct ceph_snapid_map {
348 struct rb_node node;
349 struct list_head lru;
350 atomic_t ref;
351 u64 snap;
352 dev_t dev;
353 unsigned long last_used;
354};
355
0c44a8e0
LH
356/*
357 * node for list of quotarealm inodes that are not visible from the filesystem
358 * mountpoint, but required to handle, e.g. quotas.
359 */
360struct ceph_quotarealm_inode {
361 struct rb_node node;
362 u64 ino;
363 unsigned long timeout; /* last time a lookup failed for this inode */
364 struct mutex mutex;
365 struct inode *inode;
366};
367
3a3430af
JL
368struct cap_wait {
369 struct list_head list;
370 unsigned long ino;
371 pid_t tgid;
372 int need;
373 int want;
374};
375
2f2dc053
SW
376/*
377 * mds client state
378 */
379struct ceph_mds_client {
3d14c5d2 380 struct ceph_fs_client *fsc;
2f2dc053
SW
381 struct mutex mutex; /* all nested structures */
382
383 struct ceph_mdsmap *mdsmap;
f3c60c59
SW
384 struct completion safe_umount_waiters;
385 wait_queue_head_t session_close_wq;
2f2dc053 386 struct list_head waiting_for_map;
430afbad 387 int mdsmap_err;
2f2dc053
SW
388
389 struct ceph_mds_session **sessions; /* NULL for mds if no session */
86d8f67b 390 atomic_t num_sessions;
2f2dc053
SW
391 int max_sessions; /* len of s_mds_sessions */
392 int stopping; /* true if shutting down */
393
d557c48d 394 atomic64_t quotarealms_count; /* # realms with quota */
0c44a8e0
LH
395 /*
396 * We keep a list of inodes we don't see in the mountpoint but that we
397 * need to track quota realms.
398 */
399 struct rb_root quotarealms_inodes;
400 struct mutex quotarealms_inodes_mutex;
d557c48d 401
2f2dc053
SW
402 /*
403 * snap_rwsem will cover cap linkage into snaprealms, and
404 * realm snap contexts. (later, we can do per-realm snap
405 * contexts locks..) the empty list contains realms with no
406 * references (implying they contain no inodes with caps) that
407 * should be destroyed.
408 */
affbc19a 409 u64 last_snap_seq;
2f2dc053 410 struct rw_semaphore snap_rwsem;
a105f00c 411 struct rb_root snap_realms;
2f2dc053 412 struct list_head snap_empty;
81c5a148 413 int num_snap_realms;
2f2dc053
SW
414 spinlock_t snap_empty_lock; /* protect snap_empty */
415
416 u64 last_tid; /* most recent mds request */
e8a7b8b1
YZ
417 u64 oldest_tid; /* oldest incomplete mds request,
418 excluding setfilelock requests */
44ca18f2 419 struct rb_root request_tree; /* pending mds requests */
2f2dc053
SW
420 struct delayed_work delayed_work; /* delayed work */
421 unsigned long last_renew_caps; /* last time we renewed our caps */
422 struct list_head cap_delay_list; /* caps with delayed release */
423 spinlock_t cap_delay_lock; /* protects cap_delay_list */
424 struct list_head snap_flush_list; /* cap_snaps ready to flush */
425 spinlock_t snap_flush_lock;
426
553adfd9 427 u64 last_cap_flush_tid;
e4500b5e 428 struct list_head cap_flush_list;
db354052 429 struct list_head cap_dirty_migrating; /* ...that are migration... */
2f2dc053
SW
430 int num_cap_flushing; /* # caps we are flushing */
431 spinlock_t cap_dirty_lock; /* protects above items */
432 wait_queue_head_t cap_flushing_wq;
433
37c4efc1 434 struct work_struct cap_reclaim_work;
fe33032d 435 atomic_t cap_reclaim_pending;
37c4efc1 436
37151668
YS
437 /*
438 * Cap reservations
439 *
440 * Maintain a global pool of preallocated struct ceph_caps, referenced
441 * by struct ceph_caps_reservations. This ensures that we preallocate
442 * memory needed to successfully process an MDS response. (If an MDS
443 * sends us cap information and we fail to process it, we will have
444 * problems due to the client and MDS being out of sync.)
445 *
446 * Reservations are 'owned' by a ceph_cap_reservation context.
447 */
448 spinlock_t caps_list_lock;
449 struct list_head caps_list; /* unused (reserved or
450 unreserved) */
3a3430af 451 struct list_head cap_wait_list;
37151668
YS
452 int caps_total_count; /* total caps allocated */
453 int caps_use_count; /* in use */
fe33032d 454 int caps_use_max; /* max used caps */
37151668
YS
455 int caps_reserve_count; /* unused, reserved */
456 int caps_avail_count; /* unused, unreserved */
457 int caps_min_count; /* keep at least this many
458 (unreserved) */
37c4efc1
YZ
459 spinlock_t dentry_list_lock;
460 struct list_head dentry_leases; /* fifo list */
461 struct list_head dentry_dir_leases; /* lru list */
10183a69 462
f9009efa
XL
463 struct ceph_client_metric metric;
464
75c9627e
YZ
465 spinlock_t snapid_map_lock;
466 struct rb_root snapid_map_tree;
467 struct list_head snapid_map_lru;
468
10183a69
YZ
469 struct rw_semaphore pool_perm_rwsem;
470 struct rb_root pool_perm_tree;
717e6f28
YZ
471
472 char nodename[__NEW_UTS_LEN + 1];
2f2dc053
SW
473};
474
475extern const char *ceph_mds_op_name(int op);
476
477extern struct ceph_mds_session *
478__ceph_lookup_mds_session(struct ceph_mds_client *, int mds);
479
a687ecaf
JS
480extern const char *ceph_session_state_name(int s);
481
5b3248c6
XL
482extern struct ceph_mds_session *
483ceph_get_mds_session(struct ceph_mds_session *s);
2f2dc053
SW
484extern void ceph_put_mds_session(struct ceph_mds_session *s);
485
486extern int ceph_send_msg_mds(struct ceph_mds_client *mdsc,
487 struct ceph_msg *msg, int mds);
488
3d14c5d2 489extern int ceph_mdsc_init(struct ceph_fs_client *fsc);
2f2dc053 490extern void ceph_mdsc_close_sessions(struct ceph_mds_client *mdsc);
48fec5d0 491extern void ceph_mdsc_force_umount(struct ceph_mds_client *mdsc);
3d14c5d2 492extern void ceph_mdsc_destroy(struct ceph_fs_client *fsc);
2f2dc053
SW
493
494extern void ceph_mdsc_sync(struct ceph_mds_client *mdsc);
495
167c9e35 496extern void ceph_invalidate_dir_request(struct ceph_mds_request *req);
54008399
YZ
497extern int ceph_alloc_readdir_reply_buffer(struct ceph_mds_request *req,
498 struct inode *dir);
2f2dc053
SW
499extern struct ceph_mds_request *
500ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode);
86bda539
JL
501extern int ceph_mdsc_submit_request(struct ceph_mds_client *mdsc,
502 struct inode *dir,
503 struct ceph_mds_request *req);
2f2dc053
SW
504extern int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
505 struct inode *dir,
506 struct ceph_mds_request *req);
a25949b9 507extern void ceph_mdsc_release_dir_caps(struct ceph_mds_request *req);
2f2dc053
SW
508static inline void ceph_mdsc_get_request(struct ceph_mds_request *req)
509{
153c8e6b
SW
510 kref_get(&req->r_kref);
511}
512extern void ceph_mdsc_release_request(struct kref *kref);
513static inline void ceph_mdsc_put_request(struct ceph_mds_request *req)
514{
515 kref_put(&req->r_kref, ceph_mdsc_release_request);
2f2dc053 516}
2f2dc053 517
e3ec8d68
YZ
518extern void __ceph_queue_cap_release(struct ceph_mds_session *session,
519 struct ceph_cap *cap);
520extern void ceph_flush_cap_releases(struct ceph_mds_client *mdsc,
521 struct ceph_mds_session *session);
37c4efc1 522extern void ceph_queue_cap_reclaim_work(struct ceph_mds_client *mdsc);
fe33032d 523extern void ceph_reclaim_caps_nr(struct ceph_mds_client *mdsc, int nr);
f5d77269
JL
524extern int ceph_iterate_session_caps(struct ceph_mds_session *session,
525 int (*cb)(struct inode *,
526 struct ceph_cap *, void *),
527 void *arg);
2f2dc053
SW
528extern void ceph_mdsc_pre_umount(struct ceph_mds_client *mdsc);
529
f77f21bb
JL
530static inline void ceph_mdsc_free_path(char *path, int len)
531{
2a575f13 532 if (!IS_ERR_OR_NULL(path))
f77f21bb
JL
533 __putname(path - (PATH_MAX - 1 - len));
534}
535
2f2dc053
SW
536extern char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *base,
537 int stop_on_nosnap);
538
539extern void __ceph_mdsc_drop_dentry_lease(struct dentry *dentry);
540extern void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
2f2dc053
SW
541 struct dentry *dentry, char action,
542 u32 seq);
543
430afbad
YZ
544extern void ceph_mdsc_handle_mdsmap(struct ceph_mds_client *mdsc,
545 struct ceph_msg *msg);
546extern void ceph_mdsc_handle_fsmap(struct ceph_mds_client *mdsc,
547 struct ceph_msg *msg);
2f2dc053 548
5d72d13c
YZ
549extern struct ceph_mds_session *
550ceph_mdsc_open_export_target_session(struct ceph_mds_client *mdsc, int target);
154f42c2
SW
551extern void ceph_mdsc_open_export_target_sessions(struct ceph_mds_client *mdsc,
552 struct ceph_mds_session *session);
553
e30ee581
ZZ
554extern int ceph_trim_caps(struct ceph_mds_client *mdsc,
555 struct ceph_mds_session *session,
556 int max_caps);
d4846487 557
891f3f5a
JL
558static inline int ceph_wait_on_async_create(struct inode *inode)
559{
560 struct ceph_inode_info *ci = ceph_inode(inode);
561
562 return wait_on_bit(&ci->i_ceph_flags, CEPH_ASYNC_CREATE_BIT,
563 TASK_INTERRUPTIBLE);
564}
d4846487
JL
565
566extern u64 ceph_get_deleg_ino(struct ceph_mds_session *session);
567extern int ceph_restore_deleg_ino(struct ceph_mds_session *session, u64 ino);
2f2dc053 568#endif