hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/ceph/libceph.h
....@@ -35,6 +35,7 @@
3535 #define CEPH_OPT_NOMSGAUTH (1<<4) /* don't require msg signing feat */
3636 #define CEPH_OPT_TCP_NODELAY (1<<5) /* TCP_NODELAY on TCP sockets */
3737 #define CEPH_OPT_NOMSGSIGN (1<<6) /* don't sign msgs */
38
+#define CEPH_OPT_ABORT_ON_FULL (1<<7) /* abort w/ ENOSPC when full */
3839
3940 #define CEPH_OPT_DEFAULT (CEPH_OPT_TCP_NODELAY)
4041
....@@ -51,9 +52,10 @@
5152 unsigned long osd_idle_ttl; /* jiffies */
5253 unsigned long osd_keepalive_timeout; /* jiffies */
5354 unsigned long osd_request_timeout; /* jiffies */
55
+ u32 read_from_replica; /* CEPH_OSD_FLAG_BALANCE/LOCALIZE_READS */
5456
5557 /*
56
- * any type that can't be simply compared or doesn't need need
58
+ * any type that can't be simply compared or doesn't need
5759 * to be compared should go beyond this point,
5860 * ceph_compare_options() should be updated accordingly
5961 */
....@@ -63,6 +65,7 @@
6365 int num_mon;
6466 char *name;
6567 struct ceph_crypto_key *key;
68
+ struct rb_root crush_locs;
6669 };
6770
6871 /*
....@@ -72,6 +75,7 @@
7275 #define CEPH_OSD_KEEPALIVE_DEFAULT msecs_to_jiffies(5 * 1000)
7376 #define CEPH_OSD_IDLE_TTL_DEFAULT msecs_to_jiffies(60 * 1000)
7477 #define CEPH_OSD_REQUEST_TIMEOUT_DEFAULT 0 /* no timeout */
78
+#define CEPH_READ_FROM_REPLICA_DEFAULT 0 /* read from primary */
7579
7680 #define CEPH_MONC_HUNT_INTERVAL msecs_to_jiffies(3 * 1000)
7781 #define CEPH_MONC_PING_INTERVAL msecs_to_jiffies(10 * 1000)
....@@ -83,11 +87,13 @@
8387 #define CEPH_MSG_MAX_MIDDLE_LEN (16*1024*1024)
8488
8589 /*
86
- * Handle the largest possible rbd object in one message.
90
+ * The largest possible rbd data object is 32M.
91
+ * The largest possible rbd object map object is 64M.
92
+ *
8793 * There is no limit on the size of cephfs objects, but it has to obey
8894 * rsize and wsize mount options anyway.
8995 */
90
-#define CEPH_MSG_MAX_DATA_LEN (32*1024*1024)
96
+#define CEPH_MSG_MAX_DATA_LEN (64*1024*1024)
9197
9298 #define CEPH_AUTH_NAME_DEFAULT "guest"
9399
....@@ -185,7 +191,7 @@
185191 #define RB_CMP3WAY(a, b) ((a) < (b) ? -1 : (a) > (b))
186192
187193 #define DEFINE_RB_INSDEL_FUNCS2(name, type, keyfld, cmpexp, keyexp, nodefld) \
188
-static void insert_##name(struct rb_root *root, type *t) \
194
+static bool __insert_##name(struct rb_root *root, type *t) \
189195 { \
190196 struct rb_node **n = &root->rb_node; \
191197 struct rb_node *parent = NULL; \
....@@ -203,11 +209,17 @@
203209 else if (cmp > 0) \
204210 n = &(*n)->rb_right; \
205211 else \
206
- BUG(); \
212
+ return false; \
207213 } \
208214 \
209215 rb_link_node(&t->nodefld, parent, n); \
210216 rb_insert_color(&t->nodefld, root); \
217
+ return true; \
218
+} \
219
+static void __maybe_unused insert_##name(struct rb_root *root, type *t) \
220
+{ \
221
+ if (!__insert_##name(root, t)) \
222
+ BUG(); \
211223 } \
212224 static void erase_##name(struct rb_root *root, type *t) \
213225 { \
....@@ -269,6 +281,8 @@
269281 extern struct kmem_cache *ceph_dentry_cachep;
270282 extern struct kmem_cache *ceph_file_cachep;
271283 extern struct kmem_cache *ceph_dir_file_cachep;
284
+extern struct kmem_cache *ceph_mds_request_cachep;
285
+extern mempool_t *ceph_wb_pagevec_pool;
272286
273287 /* ceph_common.c */
274288 extern bool libceph_compatible(void *data);
....@@ -277,11 +291,15 @@
277291 extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
278292 extern void *ceph_kvmalloc(size_t size, gfp_t flags);
279293
280
-extern struct ceph_options *ceph_parse_options(char *options,
281
- const char *dev_name, const char *dev_name_end,
282
- int (*parse_extra_token)(char *c, void *private),
283
- void *private);
284
-int ceph_print_client_options(struct seq_file *m, struct ceph_client *client);
294
+struct fs_parameter;
295
+struct fc_log;
296
+struct ceph_options *ceph_alloc_options(void);
297
+int ceph_parse_mon_ips(const char *buf, size_t len, struct ceph_options *opt,
298
+ struct fc_log *l);
299
+int ceph_parse_param(struct fs_parameter *param, struct ceph_options *opt,
300
+ struct fc_log *l);
301
+int ceph_print_client_options(struct seq_file *m, struct ceph_client *client,
302
+ bool show_all);
285303 extern void ceph_destroy_options(struct ceph_options *opt);
286304 extern int ceph_compare_options(struct ceph_options *new_opt,
287305 struct ceph_client *client);
....@@ -289,6 +307,7 @@
289307 struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client);
290308 u64 ceph_client_gid(struct ceph_client *client);
291309 extern void ceph_destroy_client(struct ceph_client *client);
310
+extern void ceph_reset_client_addr(struct ceph_client *client);
292311 extern int __ceph_open_session(struct ceph_client *client,
293312 unsigned long started);
294313 extern int ceph_open_session(struct ceph_client *client);
....@@ -297,10 +316,6 @@
297316
298317 /* pagevec.c */
299318 extern void ceph_release_page_vector(struct page **pages, int num_pages);
300
-
301
-extern struct page **ceph_get_direct_page_vector(const void __user *data,
302
- int num_pages,
303
- bool write_page);
304319 extern void ceph_put_page_vector(struct page **pages, int num_pages,
305320 bool dirty);
306321 extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags);