xref: /linux-6.15/include/linux/ceph/libceph.h (revision ee1eb8cc)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
23d14c5d2SYehuda Sadeh #ifndef _FS_CEPH_LIBCEPH_H
33d14c5d2SYehuda Sadeh #define _FS_CEPH_LIBCEPH_H
43d14c5d2SYehuda Sadeh 
5a1ce3928SDavid Howells #include <linux/ceph/ceph_debug.h>
63d14c5d2SYehuda Sadeh 
7*5f60d5f6SAl Viro #include <linux/unaligned.h>
83d14c5d2SYehuda Sadeh #include <linux/backing-dev.h>
93d14c5d2SYehuda Sadeh #include <linux/completion.h>
103d14c5d2SYehuda Sadeh #include <linux/exportfs.h>
11187f1882SPaul Gortmaker #include <linux/bug.h>
123d14c5d2SYehuda Sadeh #include <linux/fs.h>
133d14c5d2SYehuda Sadeh #include <linux/mempool.h>
143d14c5d2SYehuda Sadeh #include <linux/pagemap.h>
153d14c5d2SYehuda Sadeh #include <linux/wait.h>
163d14c5d2SYehuda Sadeh #include <linux/writeback.h>
173d14c5d2SYehuda Sadeh #include <linux/slab.h>
1806dfa963SElena Reshetova #include <linux/refcount.h>
193d14c5d2SYehuda Sadeh 
20a1ce3928SDavid Howells #include <linux/ceph/types.h>
21a1ce3928SDavid Howells #include <linux/ceph/messenger.h>
22a1ce3928SDavid Howells #include <linux/ceph/msgpool.h>
23a1ce3928SDavid Howells #include <linux/ceph/mon_client.h>
24a1ce3928SDavid Howells #include <linux/ceph/osd_client.h>
25a1ce3928SDavid Howells #include <linux/ceph/ceph_fs.h>
2651e92737SYan, Zheng #include <linux/ceph/string_table.h>
273d14c5d2SYehuda Sadeh 
283d14c5d2SYehuda Sadeh /*
293d14c5d2SYehuda Sadeh  * mount options
303d14c5d2SYehuda Sadeh  */
313d14c5d2SYehuda Sadeh #define CEPH_OPT_FSID             (1<<0)
323d14c5d2SYehuda Sadeh #define CEPH_OPT_NOSHARE          (1<<1) /* don't share client with other sbs */
333d14c5d2SYehuda Sadeh #define CEPH_OPT_MYIP             (1<<2) /* specified my ip */
34cd1a677cSIlya Dryomov #define CEPH_OPT_NOCRC            (1<<3) /* no data crc on writes (msgr1) */
35afd56e78SIlya Dryomov #define CEPH_OPT_TCP_NODELAY      (1<<4) /* TCP_NODELAY on TCP sockets */
36afd56e78SIlya Dryomov #define CEPH_OPT_NOMSGSIGN        (1<<5) /* don't sign msgs (msgr1) */
37afd56e78SIlya Dryomov #define CEPH_OPT_ABORT_ON_FULL    (1<<6) /* abort w/ ENOSPC when full */
38038b8d1dSIlya Dryomov #define CEPH_OPT_RXBOUNCE         (1<<7) /* double-buffer read data */
393d14c5d2SYehuda Sadeh 
40ba988f87SChaitanya Huilgol #define CEPH_OPT_DEFAULT   (CEPH_OPT_TCP_NODELAY)
413d14c5d2SYehuda Sadeh 
423d14c5d2SYehuda Sadeh #define ceph_set_opt(client, opt) \
433d14c5d2SYehuda Sadeh 	(client)->options->flags |= CEPH_OPT_##opt;
443d14c5d2SYehuda Sadeh #define ceph_test_opt(client, opt) \
453d14c5d2SYehuda Sadeh 	(!!((client)->options->flags & CEPH_OPT_##opt))
463d14c5d2SYehuda Sadeh 
473d14c5d2SYehuda Sadeh struct ceph_options {
483d14c5d2SYehuda Sadeh 	int flags;
493d14c5d2SYehuda Sadeh 	struct ceph_fsid fsid;
503d14c5d2SYehuda Sadeh 	struct ceph_entity_addr my_addr;
51a319bf56SIlya Dryomov 	unsigned long mount_timeout;		/* jiffies */
52a319bf56SIlya Dryomov 	unsigned long osd_idle_ttl;		/* jiffies */
53a319bf56SIlya Dryomov 	unsigned long osd_keepalive_timeout;	/* jiffies */
547cc5e38fSIlya Dryomov 	unsigned long osd_request_timeout;	/* jiffies */
5522d2cfdfSIlya Dryomov 	u32 read_from_replica;  /* CEPH_OSD_FLAG_BALANCE/LOCALIZE_READS */
5600498b99SIlya Dryomov 	int con_modes[2];  /* CEPH_CON_MODE_* */
578ad44d5eSIlya Dryomov 
583d14c5d2SYehuda Sadeh 	/*
5902b2f549SDongsheng Yang 	 * any type that can't be simply compared or doesn't need
603d14c5d2SYehuda Sadeh 	 * to be compared should go beyond this point,
613d14c5d2SYehuda Sadeh 	 * ceph_compare_options() should be updated accordingly
623d14c5d2SYehuda Sadeh 	 */
633d14c5d2SYehuda Sadeh 
643d14c5d2SYehuda Sadeh 	struct ceph_entity_addr *mon_addr; /* should be the first
653d14c5d2SYehuda Sadeh 					      pointer type of args */
663d14c5d2SYehuda Sadeh 	int num_mon;
673d14c5d2SYehuda Sadeh 	char *name;
688323c3aaSTommi Virtanen 	struct ceph_crypto_key *key;
6945e6aa9fSIlya Dryomov 	struct rb_root crush_locs;
703d14c5d2SYehuda Sadeh };
713d14c5d2SYehuda Sadeh 
723d14c5d2SYehuda Sadeh /*
733d14c5d2SYehuda Sadeh  * defaults
743d14c5d2SYehuda Sadeh  */
75a319bf56SIlya Dryomov #define CEPH_MOUNT_TIMEOUT_DEFAULT	msecs_to_jiffies(60 * 1000)
76a319bf56SIlya Dryomov #define CEPH_OSD_KEEPALIVE_DEFAULT	msecs_to_jiffies(5 * 1000)
77a319bf56SIlya Dryomov #define CEPH_OSD_IDLE_TTL_DEFAULT	msecs_to_jiffies(60 * 1000)
787cc5e38fSIlya Dryomov #define CEPH_OSD_REQUEST_TIMEOUT_DEFAULT 0  /* no timeout */
7922d2cfdfSIlya Dryomov #define CEPH_READ_FROM_REPLICA_DEFAULT	0  /* read from primary */
8058d81b12SIlya Dryomov 
81168b9090SIlya Dryomov #define CEPH_MONC_HUNT_INTERVAL		msecs_to_jiffies(3 * 1000)
8258d81b12SIlya Dryomov #define CEPH_MONC_PING_INTERVAL		msecs_to_jiffies(10 * 1000)
8358d81b12SIlya Dryomov #define CEPH_MONC_PING_TIMEOUT		msecs_to_jiffies(30 * 1000)
84168b9090SIlya Dryomov #define CEPH_MONC_HUNT_BACKOFF		2
85168b9090SIlya Dryomov #define CEPH_MONC_HUNT_MAX_MULT		10
863d14c5d2SYehuda Sadeh 
87cd1a677cSIlya Dryomov #define CEPH_MSG_MAX_CONTROL_LEN (16*1024*1024)
883d14c5d2SYehuda Sadeh #define CEPH_MSG_MAX_FRONT_LEN	(16*1024*1024)
897b11ba37SAlex Elder #define CEPH_MSG_MAX_MIDDLE_LEN	(16*1024*1024)
9094e6992bSIlya Dryomov 
9194e6992bSIlya Dryomov /*
92ef83171bSIlya Dryomov  * The largest possible rbd data object is 32M.
93ef83171bSIlya Dryomov  * The largest possible rbd object map object is 64M.
94ef83171bSIlya Dryomov  *
9594e6992bSIlya Dryomov  * There is no limit on the size of cephfs objects, but it has to obey
9694e6992bSIlya Dryomov  * rsize and wsize mount options anyway.
9794e6992bSIlya Dryomov  */
98ef83171bSIlya Dryomov #define CEPH_MSG_MAX_DATA_LEN	(64*1024*1024)
993d14c5d2SYehuda Sadeh 
1003d14c5d2SYehuda Sadeh #define CEPH_AUTH_NAME_DEFAULT   "guest"
1013d14c5d2SYehuda Sadeh 
ceph_timeout_jiffies(unsigned long timeout)102a319bf56SIlya Dryomov static inline unsigned long ceph_timeout_jiffies(unsigned long timeout)
103a319bf56SIlya Dryomov {
104a319bf56SIlya Dryomov 	return timeout ?: MAX_SCHEDULE_TIMEOUT;
105a319bf56SIlya Dryomov }
106a319bf56SIlya Dryomov 
1073d14c5d2SYehuda Sadeh struct ceph_mds_client;
1083d14c5d2SYehuda Sadeh 
1093d14c5d2SYehuda Sadeh /*
1103d14c5d2SYehuda Sadeh  * per client state
1113d14c5d2SYehuda Sadeh  *
1123d14c5d2SYehuda Sadeh  * possibly shared by multiple mount points, if they are
1133d14c5d2SYehuda Sadeh  * mounting the same ceph filesystem/cluster.
1143d14c5d2SYehuda Sadeh  */
1153d14c5d2SYehuda Sadeh struct ceph_client {
1163d14c5d2SYehuda Sadeh 	struct ceph_fsid fsid;
1173d14c5d2SYehuda Sadeh 	bool have_fsid;
1183d14c5d2SYehuda Sadeh 
1193d14c5d2SYehuda Sadeh 	void *private;
1203d14c5d2SYehuda Sadeh 
1213d14c5d2SYehuda Sadeh 	struct ceph_options *options;
1223d14c5d2SYehuda Sadeh 
1233d14c5d2SYehuda Sadeh 	struct mutex mount_mutex;      /* serialize mount attempts */
1243d14c5d2SYehuda Sadeh 	wait_queue_head_t auth_wq;
1253d14c5d2SYehuda Sadeh 	int auth_err;
1263d14c5d2SYehuda Sadeh 
1273d14c5d2SYehuda Sadeh 	int (*extra_mon_dispatch)(struct ceph_client *, struct ceph_msg *);
1283d14c5d2SYehuda Sadeh 
12912b4629aSIlya Dryomov 	u64 supported_features;
13012b4629aSIlya Dryomov 	u64 required_features;
1313d14c5d2SYehuda Sadeh 
13215d9882cSAlex Elder 	struct ceph_messenger msgr;   /* messenger instance */
1333d14c5d2SYehuda Sadeh 	struct ceph_mon_client monc;
1343d14c5d2SYehuda Sadeh 	struct ceph_osd_client osdc;
1353d14c5d2SYehuda Sadeh 
1363d14c5d2SYehuda Sadeh #ifdef CONFIG_DEBUG_FS
1373d14c5d2SYehuda Sadeh 	struct dentry *debugfs_dir;
1383d14c5d2SYehuda Sadeh 	struct dentry *debugfs_monmap;
1393d14c5d2SYehuda Sadeh 	struct dentry *debugfs_osdmap;
1405cf7bd30SIlya Dryomov 	struct dentry *debugfs_options;
1413d14c5d2SYehuda Sadeh #endif
1423d14c5d2SYehuda Sadeh };
1433d14c5d2SYehuda Sadeh 
144859bff51SIlya Dryomov #define from_msgr(ms)	container_of(ms, struct ceph_client, msgr)
1453d14c5d2SYehuda Sadeh 
ceph_msgr2(struct ceph_client * client)146cd1a677cSIlya Dryomov static inline bool ceph_msgr2(struct ceph_client *client)
147cd1a677cSIlya Dryomov {
148cd1a677cSIlya Dryomov 	return client->options->con_modes[0] != CEPH_CON_MODE_UNKNOWN;
149cd1a677cSIlya Dryomov }
1503d14c5d2SYehuda Sadeh 
1513d14c5d2SYehuda Sadeh /*
1523d14c5d2SYehuda Sadeh  * snapshots
1533d14c5d2SYehuda Sadeh  */
1543d14c5d2SYehuda Sadeh 
1553d14c5d2SYehuda Sadeh /*
1563d14c5d2SYehuda Sadeh  * A "snap context" is the set of existing snapshots when we
1573d14c5d2SYehuda Sadeh  * write data.  It is used by the OSD to guide its COW behavior.
1583d14c5d2SYehuda Sadeh  *
1593d14c5d2SYehuda Sadeh  * The ceph_snap_context is refcounted, and attached to each dirty
1603d14c5d2SYehuda Sadeh  * page, indicating which context the dirty data belonged when it was
1613d14c5d2SYehuda Sadeh  * dirtied.
1623d14c5d2SYehuda Sadeh  */
1633d14c5d2SYehuda Sadeh struct ceph_snap_context {
16406dfa963SElena Reshetova 	refcount_t nref;
1653d14c5d2SYehuda Sadeh 	u64 seq;
166aa711ee3SAlex Elder 	u32 num_snaps;
1673d14c5d2SYehuda Sadeh 	u64 snaps[];
1683d14c5d2SYehuda Sadeh };
1693d14c5d2SYehuda Sadeh 
1704f0dcb10SAlex Elder extern struct ceph_snap_context *ceph_create_snap_context(u32 snap_count,
1714f0dcb10SAlex Elder 					gfp_t gfp_flags);
1724f0dcb10SAlex Elder extern struct ceph_snap_context *ceph_get_snap_context(
1734f0dcb10SAlex Elder 					struct ceph_snap_context *sc);
1744f0dcb10SAlex Elder extern void ceph_put_snap_context(struct ceph_snap_context *sc);
1753d14c5d2SYehuda Sadeh 
1763d14c5d2SYehuda Sadeh /*
1773d14c5d2SYehuda Sadeh  * calculate the number of pages a given length and offset map onto,
1783d14c5d2SYehuda Sadeh  * if we align the data.
1793d14c5d2SYehuda Sadeh  */
calc_pages_for(u64 off,u64 len)1803d14c5d2SYehuda Sadeh static inline int calc_pages_for(u64 off, u64 len)
1813d14c5d2SYehuda Sadeh {
18209cbfeafSKirill A. Shutemov 	return ((off+len+PAGE_SIZE-1) >> PAGE_SHIFT) -
18309cbfeafSKirill A. Shutemov 		(off >> PAGE_SHIFT);
1843d14c5d2SYehuda Sadeh }
1853d14c5d2SYehuda Sadeh 
18676f827a7SIlya Dryomov #define RB_BYVAL(a)      (a)
18776f827a7SIlya Dryomov #define RB_BYPTR(a)      (&(a))
18876f827a7SIlya Dryomov #define RB_CMP3WAY(a, b) ((a) < (b) ? -1 : (a) > (b))
18976f827a7SIlya Dryomov 
19076f827a7SIlya Dryomov #define DEFINE_RB_INSDEL_FUNCS2(name, type, keyfld, cmpexp, keyexp, nodefld) \
1918a4b863cSIlya Dryomov static bool __insert_##name(struct rb_root *root, type *t)		\
192fcd00b68SIlya Dryomov {									\
193fcd00b68SIlya Dryomov 	struct rb_node **n = &root->rb_node;				\
194fcd00b68SIlya Dryomov 	struct rb_node *parent = NULL;					\
195fcd00b68SIlya Dryomov 									\
196fcd00b68SIlya Dryomov 	BUG_ON(!RB_EMPTY_NODE(&t->nodefld));				\
197fcd00b68SIlya Dryomov 									\
198fcd00b68SIlya Dryomov 	while (*n) {							\
199fcd00b68SIlya Dryomov 		type *cur = rb_entry(*n, type, nodefld);		\
20076f827a7SIlya Dryomov 		int cmp;						\
201fcd00b68SIlya Dryomov 									\
202fcd00b68SIlya Dryomov 		parent = *n;						\
20376f827a7SIlya Dryomov 		cmp = cmpexp(keyexp(t->keyfld), keyexp(cur->keyfld));	\
20476f827a7SIlya Dryomov 		if (cmp < 0)						\
205fcd00b68SIlya Dryomov 			n = &(*n)->rb_left;				\
20676f827a7SIlya Dryomov 		else if (cmp > 0)					\
207fcd00b68SIlya Dryomov 			n = &(*n)->rb_right;				\
208fcd00b68SIlya Dryomov 		else							\
2098a4b863cSIlya Dryomov 			return false;					\
210fcd00b68SIlya Dryomov 	}								\
211fcd00b68SIlya Dryomov 									\
212fcd00b68SIlya Dryomov 	rb_link_node(&t->nodefld, parent, n);				\
213fcd00b68SIlya Dryomov 	rb_insert_color(&t->nodefld, root);				\
2148a4b863cSIlya Dryomov 	return true;							\
2158a4b863cSIlya Dryomov }									\
2168a4b863cSIlya Dryomov static void __maybe_unused insert_##name(struct rb_root *root, type *t)	\
2178a4b863cSIlya Dryomov {									\
2188a4b863cSIlya Dryomov 	if (!__insert_##name(root, t))					\
2198a4b863cSIlya Dryomov 		BUG();							\
220fcd00b68SIlya Dryomov }									\
221fcd00b68SIlya Dryomov static void erase_##name(struct rb_root *root, type *t)			\
222fcd00b68SIlya Dryomov {									\
223fcd00b68SIlya Dryomov 	BUG_ON(RB_EMPTY_NODE(&t->nodefld));				\
224fcd00b68SIlya Dryomov 	rb_erase(&t->nodefld, root);					\
225fcd00b68SIlya Dryomov 	RB_CLEAR_NODE(&t->nodefld);					\
226fcd00b68SIlya Dryomov }
227fcd00b68SIlya Dryomov 
22876f827a7SIlya Dryomov /*
22976f827a7SIlya Dryomov  * @lookup_param_type is a parameter and not constructed from (@type,
23076f827a7SIlya Dryomov  * @keyfld) with typeof() because adding const is too unwieldy.
23176f827a7SIlya Dryomov  */
23276f827a7SIlya Dryomov #define DEFINE_RB_LOOKUP_FUNC2(name, type, keyfld, cmpexp, keyexp,	\
23376f827a7SIlya Dryomov 			       lookup_param_type, nodefld)		\
23476f827a7SIlya Dryomov static type *lookup_##name(struct rb_root *root, lookup_param_type key)	\
235fcd00b68SIlya Dryomov {									\
236fcd00b68SIlya Dryomov 	struct rb_node *n = root->rb_node;				\
237fcd00b68SIlya Dryomov 									\
238fcd00b68SIlya Dryomov 	while (n) {							\
239fcd00b68SIlya Dryomov 		type *cur = rb_entry(n, type, nodefld);			\
24076f827a7SIlya Dryomov 		int cmp;						\
241fcd00b68SIlya Dryomov 									\
24276f827a7SIlya Dryomov 		cmp = cmpexp(key, keyexp(cur->keyfld));			\
24376f827a7SIlya Dryomov 		if (cmp < 0)						\
244fcd00b68SIlya Dryomov 			n = n->rb_left;					\
24576f827a7SIlya Dryomov 		else if (cmp > 0)					\
246fcd00b68SIlya Dryomov 			n = n->rb_right;				\
247fcd00b68SIlya Dryomov 		else							\
248fcd00b68SIlya Dryomov 			return cur;					\
249fcd00b68SIlya Dryomov 	}								\
250fcd00b68SIlya Dryomov 									\
251fcd00b68SIlya Dryomov 	return NULL;							\
252fcd00b68SIlya Dryomov }
253fcd00b68SIlya Dryomov 
25476f827a7SIlya Dryomov #define DEFINE_RB_FUNCS2(name, type, keyfld, cmpexp, keyexp,		\
25576f827a7SIlya Dryomov 			 lookup_param_type, nodefld)			\
25676f827a7SIlya Dryomov DEFINE_RB_INSDEL_FUNCS2(name, type, keyfld, cmpexp, keyexp, nodefld)	\
25776f827a7SIlya Dryomov DEFINE_RB_LOOKUP_FUNC2(name, type, keyfld, cmpexp, keyexp,		\
25876f827a7SIlya Dryomov 		       lookup_param_type, nodefld)
25976f827a7SIlya Dryomov 
26076f827a7SIlya Dryomov /*
26176f827a7SIlya Dryomov  * Shorthands for integer keys.
26276f827a7SIlya Dryomov  */
26376f827a7SIlya Dryomov #define DEFINE_RB_INSDEL_FUNCS(name, type, keyfld, nodefld)		\
26476f827a7SIlya Dryomov DEFINE_RB_INSDEL_FUNCS2(name, type, keyfld, RB_CMP3WAY, RB_BYVAL, nodefld)
26576f827a7SIlya Dryomov 
26676f827a7SIlya Dryomov #define DEFINE_RB_LOOKUP_FUNC(name, type, keyfld, nodefld)		\
26776f827a7SIlya Dryomov extern type __lookup_##name##_key;					\
26876f827a7SIlya Dryomov DEFINE_RB_LOOKUP_FUNC2(name, type, keyfld, RB_CMP3WAY, RB_BYVAL,	\
26976f827a7SIlya Dryomov 		       typeof(__lookup_##name##_key.keyfld), nodefld)
27076f827a7SIlya Dryomov 
271fcd00b68SIlya Dryomov #define DEFINE_RB_FUNCS(name, type, keyfld, nodefld)			\
272fcd00b68SIlya Dryomov DEFINE_RB_INSDEL_FUNCS(name, type, keyfld, nodefld)			\
273fcd00b68SIlya Dryomov DEFINE_RB_LOOKUP_FUNC(name, type, keyfld, nodefld)
274fcd00b68SIlya Dryomov 
275eeb0bed5SIlya Dryomov extern struct kmem_cache *ceph_inode_cachep;
276eeb0bed5SIlya Dryomov extern struct kmem_cache *ceph_cap_cachep;
277ab58a5a1SXiubo Li extern struct kmem_cache *ceph_cap_snap_cachep;
278f66fd9f0SYan, Zheng extern struct kmem_cache *ceph_cap_flush_cachep;
279eeb0bed5SIlya Dryomov extern struct kmem_cache *ceph_dentry_cachep;
280eeb0bed5SIlya Dryomov extern struct kmem_cache *ceph_file_cachep;
281bb48bd4dSChengguang Xu extern struct kmem_cache *ceph_dir_file_cachep;
282058daab7SJeff Layton extern struct kmem_cache *ceph_mds_request_cachep;
283a0102bdaSJeff Layton extern mempool_t *ceph_wb_pagevec_pool;
284eeb0bed5SIlya Dryomov 
2853d14c5d2SYehuda Sadeh /* ceph_common.c */
28672fe25e3SAlex Elder extern bool libceph_compatible(void *data);
28772fe25e3SAlex Elder 
2883d14c5d2SYehuda Sadeh extern const char *ceph_msg_type_name(int type);
2893d14c5d2SYehuda Sadeh extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
2904153c7fcSVenky Shankar extern int ceph_parse_fsid(const char *str, struct ceph_fsid *fsid);
2913d14c5d2SYehuda Sadeh 
29282995cc6SDavid Howells struct fs_parameter;
293c80c98f0SAl Viro struct fc_log;
29482995cc6SDavid Howells struct ceph_options *ceph_alloc_options(void);
29582995cc6SDavid Howells int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,
2962d7c86a8SVenky Shankar 		       struct fc_log *l, char delim);
29782995cc6SDavid Howells int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
298c80c98f0SAl Viro 		     struct fc_log *l);
29902b2f549SDongsheng Yang int ceph_print_client_options(struct seq_file *m, struct ceph_client *client,
30002b2f549SDongsheng Yang 			      bool show_all);
3013d14c5d2SYehuda Sadeh extern void ceph_destroy_options(struct ceph_options *opt);
3023d14c5d2SYehuda Sadeh extern int ceph_compare_options(struct ceph_options *new_opt,
3033d14c5d2SYehuda Sadeh 				struct ceph_client *client);
30474da4a0fSIlya Dryomov struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private);
305005a07bfSIlya Dryomov struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client);
306033268a5SIlya Dryomov u64 ceph_client_gid(struct ceph_client *client);
3073d14c5d2SYehuda Sadeh extern void ceph_destroy_client(struct ceph_client *client);
308120a75eaSYan, Zheng extern void ceph_reset_client_addr(struct ceph_client *client);
3093d14c5d2SYehuda Sadeh extern int __ceph_open_session(struct ceph_client *client,
3103d14c5d2SYehuda Sadeh 			       unsigned long started);
3113d14c5d2SYehuda Sadeh extern int ceph_open_session(struct ceph_client *client);
312bb229bbbSIlya Dryomov int ceph_wait_for_latest_osdmap(struct ceph_client *client,
313bb229bbbSIlya Dryomov 				unsigned long timeout);
3143d14c5d2SYehuda Sadeh 
3153d14c5d2SYehuda Sadeh /* pagevec.c */
3163d14c5d2SYehuda Sadeh extern void ceph_release_page_vector(struct page **pages, int num_pages);
317b6aa5901SHenry C Chang extern void ceph_put_page_vector(struct page **pages, int num_pages,
318b6aa5901SHenry C Chang 				 bool dirty);
3193d14c5d2SYehuda Sadeh extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags);
320903bb32eSAlex Elder extern void ceph_copy_from_page_vector(struct page **pages,
321b324814eSAlex Elder 				    void *data,
3223d14c5d2SYehuda Sadeh 				    loff_t off, size_t len);
3233d14c5d2SYehuda Sadeh extern void ceph_zero_page_vector_range(int off, int len, struct page **pages);
3243d14c5d2SYehuda Sadeh 
3253d14c5d2SYehuda Sadeh 
3263d14c5d2SYehuda Sadeh #endif /* _FS_CEPH_SUPER_H */
327