| .. | .. |
|---|
| 35 | 35 | #define CEPH_OPT_NOMSGAUTH (1<<4) /* don't require msg signing feat */ |
|---|
| 36 | 36 | #define CEPH_OPT_TCP_NODELAY (1<<5) /* TCP_NODELAY on TCP sockets */ |
|---|
| 37 | 37 | #define CEPH_OPT_NOMSGSIGN (1<<6) /* don't sign msgs */ |
|---|
| 38 | +#define CEPH_OPT_ABORT_ON_FULL (1<<7) /* abort w/ ENOSPC when full */ |
|---|
| 38 | 39 | |
|---|
| 39 | 40 | #define CEPH_OPT_DEFAULT (CEPH_OPT_TCP_NODELAY) |
|---|
| 40 | 41 | |
|---|
| .. | .. |
|---|
| 51 | 52 | unsigned long osd_idle_ttl; /* jiffies */ |
|---|
| 52 | 53 | unsigned long osd_keepalive_timeout; /* jiffies */ |
|---|
| 53 | 54 | unsigned long osd_request_timeout; /* jiffies */ |
|---|
| 55 | + u32 read_from_replica; /* CEPH_OSD_FLAG_BALANCE/LOCALIZE_READS */ |
|---|
| 54 | 56 | |
|---|
| 55 | 57 | /* |
|---|
| 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 |
|---|
| 57 | 59 | * to be compared should go beyond this point, |
|---|
| 58 | 60 | * ceph_compare_options() should be updated accordingly |
|---|
| 59 | 61 | */ |
|---|
| .. | .. |
|---|
| 63 | 65 | int num_mon; |
|---|
| 64 | 66 | char *name; |
|---|
| 65 | 67 | struct ceph_crypto_key *key; |
|---|
| 68 | + struct rb_root crush_locs; |
|---|
| 66 | 69 | }; |
|---|
| 67 | 70 | |
|---|
| 68 | 71 | /* |
|---|
| .. | .. |
|---|
| 72 | 75 | #define CEPH_OSD_KEEPALIVE_DEFAULT msecs_to_jiffies(5 * 1000) |
|---|
| 73 | 76 | #define CEPH_OSD_IDLE_TTL_DEFAULT msecs_to_jiffies(60 * 1000) |
|---|
| 74 | 77 | #define CEPH_OSD_REQUEST_TIMEOUT_DEFAULT 0 /* no timeout */ |
|---|
| 78 | +#define CEPH_READ_FROM_REPLICA_DEFAULT 0 /* read from primary */ |
|---|
| 75 | 79 | |
|---|
| 76 | 80 | #define CEPH_MONC_HUNT_INTERVAL msecs_to_jiffies(3 * 1000) |
|---|
| 77 | 81 | #define CEPH_MONC_PING_INTERVAL msecs_to_jiffies(10 * 1000) |
|---|
| .. | .. |
|---|
| 83 | 87 | #define CEPH_MSG_MAX_MIDDLE_LEN (16*1024*1024) |
|---|
| 84 | 88 | |
|---|
| 85 | 89 | /* |
|---|
| 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 | + * |
|---|
| 87 | 93 | * There is no limit on the size of cephfs objects, but it has to obey |
|---|
| 88 | 94 | * rsize and wsize mount options anyway. |
|---|
| 89 | 95 | */ |
|---|
| 90 | | -#define CEPH_MSG_MAX_DATA_LEN (32*1024*1024) |
|---|
| 96 | +#define CEPH_MSG_MAX_DATA_LEN (64*1024*1024) |
|---|
| 91 | 97 | |
|---|
| 92 | 98 | #define CEPH_AUTH_NAME_DEFAULT "guest" |
|---|
| 93 | 99 | |
|---|
| .. | .. |
|---|
| 185 | 191 | #define RB_CMP3WAY(a, b) ((a) < (b) ? -1 : (a) > (b)) |
|---|
| 186 | 192 | |
|---|
| 187 | 193 | #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) \ |
|---|
| 189 | 195 | { \ |
|---|
| 190 | 196 | struct rb_node **n = &root->rb_node; \ |
|---|
| 191 | 197 | struct rb_node *parent = NULL; \ |
|---|
| .. | .. |
|---|
| 203 | 209 | else if (cmp > 0) \ |
|---|
| 204 | 210 | n = &(*n)->rb_right; \ |
|---|
| 205 | 211 | else \ |
|---|
| 206 | | - BUG(); \ |
|---|
| 212 | + return false; \ |
|---|
| 207 | 213 | } \ |
|---|
| 208 | 214 | \ |
|---|
| 209 | 215 | rb_link_node(&t->nodefld, parent, n); \ |
|---|
| 210 | 216 | 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(); \ |
|---|
| 211 | 223 | } \ |
|---|
| 212 | 224 | static void erase_##name(struct rb_root *root, type *t) \ |
|---|
| 213 | 225 | { \ |
|---|
| .. | .. |
|---|
| 269 | 281 | extern struct kmem_cache *ceph_dentry_cachep; |
|---|
| 270 | 282 | extern struct kmem_cache *ceph_file_cachep; |
|---|
| 271 | 283 | 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; |
|---|
| 272 | 286 | |
|---|
| 273 | 287 | /* ceph_common.c */ |
|---|
| 274 | 288 | extern bool libceph_compatible(void *data); |
|---|
| .. | .. |
|---|
| 277 | 291 | extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); |
|---|
| 278 | 292 | extern void *ceph_kvmalloc(size_t size, gfp_t flags); |
|---|
| 279 | 293 | |
|---|
| 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); |
|---|
| 285 | 303 | extern void ceph_destroy_options(struct ceph_options *opt); |
|---|
| 286 | 304 | extern int ceph_compare_options(struct ceph_options *new_opt, |
|---|
| 287 | 305 | struct ceph_client *client); |
|---|
| .. | .. |
|---|
| 289 | 307 | struct ceph_entity_addr *ceph_client_addr(struct ceph_client *client); |
|---|
| 290 | 308 | u64 ceph_client_gid(struct ceph_client *client); |
|---|
| 291 | 309 | extern void ceph_destroy_client(struct ceph_client *client); |
|---|
| 310 | +extern void ceph_reset_client_addr(struct ceph_client *client); |
|---|
| 292 | 311 | extern int __ceph_open_session(struct ceph_client *client, |
|---|
| 293 | 312 | unsigned long started); |
|---|
| 294 | 313 | extern int ceph_open_session(struct ceph_client *client); |
|---|
| .. | .. |
|---|
| 297 | 316 | |
|---|
| 298 | 317 | /* pagevec.c */ |
|---|
| 299 | 318 | 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); |
|---|
| 304 | 319 | extern void ceph_put_page_vector(struct page **pages, int num_pages, |
|---|
| 305 | 320 | bool dirty); |
|---|
| 306 | 321 | extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); |
|---|