diff options
author | Jeff Layton <jlayton@redhat.com> | 2017-02-01 13:49:09 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2017-02-20 06:16:08 -0500 |
commit | bc2de10dc4da5036ada3381775bd966f0c21c603 (patch) | |
tree | 5da0f735f7d5c87b23f7fef5e8fd135a39be12f7 /fs/ceph | |
parent | f5a03b080450784e671998921feb62fd3846c953 (diff) |
ceph: convert bools in ceph_mds_request to a new r_req_flags field
Currently, we have a bunch of bool flags in struct ceph_mds_request. We
need more flags though, but each bool takes (at least) a byte. Those
add up over time.
Merge all of the existing bools in this struct into a single unsigned
long, and use the set/test/clear_bit macros to manipulate them. These
are atomic operations, but that is required here to prevent
load/modify/store races. The existing flags are protected by different
locks, so we can't rely on them for that purpose.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Yan, Zheng <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/debugfs.c | 2 | ||||
-rw-r--r-- | fs/ceph/dir.c | 4 | ||||
-rw-r--r-- | fs/ceph/inode.c | 18 | ||||
-rw-r--r-- | fs/ceph/mds_client.c | 47 | ||||
-rw-r--r-- | fs/ceph/mds_client.h | 12 |
5 files changed, 45 insertions, 38 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index 39ff678e567f..f2ae393e2c31 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c | |||
@@ -70,7 +70,7 @@ static int mdsc_show(struct seq_file *s, void *p) | |||
70 | 70 | ||
71 | seq_printf(s, "%s", ceph_mds_op_name(req->r_op)); | 71 | seq_printf(s, "%s", ceph_mds_op_name(req->r_op)); |
72 | 72 | ||
73 | if (req->r_got_unsafe) | 73 | if (test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) |
74 | seq_puts(s, "\t(unsafe)"); | 74 | seq_puts(s, "\t(unsafe)"); |
75 | else | 75 | else |
76 | seq_puts(s, "\t"); | 76 | seq_puts(s, "\t"); |
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index d4385563b70a..5fb86d71220e 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -371,7 +371,7 @@ more: | |||
371 | /* hints to request -> mds selection code */ | 371 | /* hints to request -> mds selection code */ |
372 | req->r_direct_mode = USE_AUTH_MDS; | 372 | req->r_direct_mode = USE_AUTH_MDS; |
373 | req->r_direct_hash = ceph_frag_value(frag); | 373 | req->r_direct_hash = ceph_frag_value(frag); |
374 | req->r_direct_is_hash = true; | 374 | __set_bit(CEPH_MDS_R_DIRECT_IS_HASH, &req->r_req_flags); |
375 | if (fi->last_name) { | 375 | if (fi->last_name) { |
376 | req->r_path2 = kstrdup(fi->last_name, GFP_KERNEL); | 376 | req->r_path2 = kstrdup(fi->last_name, GFP_KERNEL); |
377 | if (!req->r_path2) { | 377 | if (!req->r_path2) { |
@@ -417,7 +417,7 @@ more: | |||
417 | fi->frag = frag; | 417 | fi->frag = frag; |
418 | fi->last_readdir = req; | 418 | fi->last_readdir = req; |
419 | 419 | ||
420 | if (req->r_did_prepopulate) { | 420 | if (test_bit(CEPH_MDS_R_DID_PREPOPULATE, &req->r_req_flags)) { |
421 | fi->readdir_cache_idx = req->r_readdir_cache_idx; | 421 | fi->readdir_cache_idx = req->r_readdir_cache_idx; |
422 | if (fi->readdir_cache_idx < 0) { | 422 | if (fi->readdir_cache_idx < 0) { |
423 | /* preclude from marking dir ordered */ | 423 | /* preclude from marking dir ordered */ |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index b18462c64cdd..ebfb156aba89 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1199,8 +1199,8 @@ retry_lookup: | |||
1199 | 1199 | ||
1200 | err = fill_inode(in, req->r_locked_page, &rinfo->targeti, NULL, | 1200 | err = fill_inode(in, req->r_locked_page, &rinfo->targeti, NULL, |
1201 | session, req->r_request_started, | 1201 | session, req->r_request_started, |
1202 | (!req->r_aborted && rinfo->head->result == 0) ? | 1202 | (!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags) && |
1203 | req->r_fmode : -1, | 1203 | rinfo->head->result == 0) ? req->r_fmode : -1, |
1204 | &req->r_caps_reservation); | 1204 | &req->r_caps_reservation); |
1205 | if (err < 0) { | 1205 | if (err < 0) { |
1206 | pr_err("fill_inode badness %p %llx.%llx\n", | 1206 | pr_err("fill_inode badness %p %llx.%llx\n", |
@@ -1213,8 +1213,8 @@ retry_lookup: | |||
1213 | * ignore null lease/binding on snapdir ENOENT, or else we | 1213 | * ignore null lease/binding on snapdir ENOENT, or else we |
1214 | * will have trouble splicing in the virtual snapdir later | 1214 | * will have trouble splicing in the virtual snapdir later |
1215 | */ | 1215 | */ |
1216 | if (rinfo->head->is_dentry && !req->r_aborted && | 1216 | if (rinfo->head->is_dentry && req->r_locked_dir && |
1217 | req->r_locked_dir && | 1217 | !test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags) && |
1218 | (rinfo->head->is_target || strncmp(req->r_dentry->d_name.name, | 1218 | (rinfo->head->is_target || strncmp(req->r_dentry->d_name.name, |
1219 | fsc->mount_options->snapdir_name, | 1219 | fsc->mount_options->snapdir_name, |
1220 | req->r_dentry->d_name.len))) { | 1220 | req->r_dentry->d_name.len))) { |
@@ -1317,9 +1317,9 @@ retry_lookup: | |||
1317 | update_dentry_lease(dn, rinfo->dlease, session, | 1317 | update_dentry_lease(dn, rinfo->dlease, session, |
1318 | req->r_request_started); | 1318 | req->r_request_started); |
1319 | dout(" final dn %p\n", dn); | 1319 | dout(" final dn %p\n", dn); |
1320 | } else if (!req->r_aborted && | 1320 | } else if ((req->r_op == CEPH_MDS_OP_LOOKUPSNAP || |
1321 | (req->r_op == CEPH_MDS_OP_LOOKUPSNAP || | 1321 | req->r_op == CEPH_MDS_OP_MKSNAP) && |
1322 | req->r_op == CEPH_MDS_OP_MKSNAP)) { | 1322 | !test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) { |
1323 | struct dentry *dn = req->r_dentry; | 1323 | struct dentry *dn = req->r_dentry; |
1324 | struct inode *dir = req->r_locked_dir; | 1324 | struct inode *dir = req->r_locked_dir; |
1325 | 1325 | ||
@@ -1444,7 +1444,7 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req, | |||
1444 | u32 fpos_offset; | 1444 | u32 fpos_offset; |
1445 | struct ceph_readdir_cache_control cache_ctl = {}; | 1445 | struct ceph_readdir_cache_control cache_ctl = {}; |
1446 | 1446 | ||
1447 | if (req->r_aborted) | 1447 | if (test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) |
1448 | return readdir_prepopulate_inodes_only(req, session); | 1448 | return readdir_prepopulate_inodes_only(req, session); |
1449 | 1449 | ||
1450 | if (rinfo->hash_order && req->r_path2) { | 1450 | if (rinfo->hash_order && req->r_path2) { |
@@ -1598,7 +1598,7 @@ next_item: | |||
1598 | } | 1598 | } |
1599 | out: | 1599 | out: |
1600 | if (err == 0 && skipped == 0) { | 1600 | if (err == 0 && skipped == 0) { |
1601 | req->r_did_prepopulate = true; | 1601 | set_bit(CEPH_MDS_R_DID_PREPOPULATE, &req->r_req_flags); |
1602 | req->r_readdir_cache_idx = cache_ctl.index; | 1602 | req->r_readdir_cache_idx = cache_ctl.index; |
1603 | } | 1603 | } |
1604 | ceph_readdir_cache_release(&cache_ctl); | 1604 | ceph_readdir_cache_release(&cache_ctl); |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 4a68067a76b5..ccf75a3260e8 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -644,13 +644,15 @@ static void __unregister_request(struct ceph_mds_client *mdsc, | |||
644 | 644 | ||
645 | erase_request(&mdsc->request_tree, req); | 645 | erase_request(&mdsc->request_tree, req); |
646 | 646 | ||
647 | if (req->r_unsafe_dir && req->r_got_unsafe) { | 647 | if (req->r_unsafe_dir && |
648 | test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) { | ||
648 | struct ceph_inode_info *ci = ceph_inode(req->r_unsafe_dir); | 649 | struct ceph_inode_info *ci = ceph_inode(req->r_unsafe_dir); |
649 | spin_lock(&ci->i_unsafe_lock); | 650 | spin_lock(&ci->i_unsafe_lock); |
650 | list_del_init(&req->r_unsafe_dir_item); | 651 | list_del_init(&req->r_unsafe_dir_item); |
651 | spin_unlock(&ci->i_unsafe_lock); | 652 | spin_unlock(&ci->i_unsafe_lock); |
652 | } | 653 | } |
653 | if (req->r_target_inode && req->r_got_unsafe) { | 654 | if (req->r_target_inode && |
655 | test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) { | ||
654 | struct ceph_inode_info *ci = ceph_inode(req->r_target_inode); | 656 | struct ceph_inode_info *ci = ceph_inode(req->r_target_inode); |
655 | spin_lock(&ci->i_unsafe_lock); | 657 | spin_lock(&ci->i_unsafe_lock); |
656 | list_del_init(&req->r_unsafe_target_item); | 658 | list_del_init(&req->r_unsafe_target_item); |
@@ -705,7 +707,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc, | |||
705 | int mode = req->r_direct_mode; | 707 | int mode = req->r_direct_mode; |
706 | int mds = -1; | 708 | int mds = -1; |
707 | u32 hash = req->r_direct_hash; | 709 | u32 hash = req->r_direct_hash; |
708 | bool is_hash = req->r_direct_is_hash; | 710 | bool is_hash = test_bit(CEPH_MDS_R_DIRECT_IS_HASH, &req->r_req_flags); |
709 | 711 | ||
710 | /* | 712 | /* |
711 | * is there a specific mds we should try? ignore hint if we have | 713 | * is there a specific mds we should try? ignore hint if we have |
@@ -2042,7 +2044,7 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc, | |||
2042 | dout("prepare_send_request %p tid %lld %s (attempt %d)\n", req, | 2044 | dout("prepare_send_request %p tid %lld %s (attempt %d)\n", req, |
2043 | req->r_tid, ceph_mds_op_name(req->r_op), req->r_attempts); | 2045 | req->r_tid, ceph_mds_op_name(req->r_op), req->r_attempts); |
2044 | 2046 | ||
2045 | if (req->r_got_unsafe) { | 2047 | if (test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) { |
2046 | void *p; | 2048 | void *p; |
2047 | /* | 2049 | /* |
2048 | * Replay. Do not regenerate message (and rebuild | 2050 | * Replay. Do not regenerate message (and rebuild |
@@ -2091,7 +2093,7 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc, | |||
2091 | 2093 | ||
2092 | rhead = msg->front.iov_base; | 2094 | rhead = msg->front.iov_base; |
2093 | rhead->oldest_client_tid = cpu_to_le64(__get_oldest_tid(mdsc)); | 2095 | rhead->oldest_client_tid = cpu_to_le64(__get_oldest_tid(mdsc)); |
2094 | if (req->r_got_unsafe) | 2096 | if (test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) |
2095 | flags |= CEPH_MDS_FLAG_REPLAY; | 2097 | flags |= CEPH_MDS_FLAG_REPLAY; |
2096 | if (req->r_locked_dir) | 2098 | if (req->r_locked_dir) |
2097 | flags |= CEPH_MDS_FLAG_WANT_DENTRY; | 2099 | flags |= CEPH_MDS_FLAG_WANT_DENTRY; |
@@ -2114,8 +2116,8 @@ static int __do_request(struct ceph_mds_client *mdsc, | |||
2114 | int mds = -1; | 2116 | int mds = -1; |
2115 | int err = 0; | 2117 | int err = 0; |
2116 | 2118 | ||
2117 | if (req->r_err || req->r_got_result) { | 2119 | if (req->r_err || test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)) { |
2118 | if (req->r_aborted) | 2120 | if (test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) |
2119 | __unregister_request(mdsc, req); | 2121 | __unregister_request(mdsc, req); |
2120 | goto out; | 2122 | goto out; |
2121 | } | 2123 | } |
@@ -2245,7 +2247,7 @@ static void kick_requests(struct ceph_mds_client *mdsc, int mds) | |||
2245 | while (p) { | 2247 | while (p) { |
2246 | req = rb_entry(p, struct ceph_mds_request, r_node); | 2248 | req = rb_entry(p, struct ceph_mds_request, r_node); |
2247 | p = rb_next(p); | 2249 | p = rb_next(p); |
2248 | if (req->r_got_unsafe) | 2250 | if (test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) |
2249 | continue; | 2251 | continue; |
2250 | if (req->r_attempts > 0) | 2252 | if (req->r_attempts > 0) |
2251 | continue; /* only new requests */ | 2253 | continue; /* only new requests */ |
@@ -2319,7 +2321,7 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc, | |||
2319 | mutex_lock(&mdsc->mutex); | 2321 | mutex_lock(&mdsc->mutex); |
2320 | 2322 | ||
2321 | /* only abort if we didn't race with a real reply */ | 2323 | /* only abort if we didn't race with a real reply */ |
2322 | if (req->r_got_result) { | 2324 | if (test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)) { |
2323 | err = le32_to_cpu(req->r_reply_info.head->result); | 2325 | err = le32_to_cpu(req->r_reply_info.head->result); |
2324 | } else if (err < 0) { | 2326 | } else if (err < 0) { |
2325 | dout("aborted request %lld with %d\n", req->r_tid, err); | 2327 | dout("aborted request %lld with %d\n", req->r_tid, err); |
@@ -2331,7 +2333,7 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc, | |||
2331 | */ | 2333 | */ |
2332 | mutex_lock(&req->r_fill_mutex); | 2334 | mutex_lock(&req->r_fill_mutex); |
2333 | req->r_err = err; | 2335 | req->r_err = err; |
2334 | req->r_aborted = true; | 2336 | set_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags); |
2335 | mutex_unlock(&req->r_fill_mutex); | 2337 | mutex_unlock(&req->r_fill_mutex); |
2336 | 2338 | ||
2337 | if (req->r_locked_dir && | 2339 | if (req->r_locked_dir && |
@@ -2409,14 +2411,14 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
2409 | } | 2411 | } |
2410 | 2412 | ||
2411 | /* dup? */ | 2413 | /* dup? */ |
2412 | if ((req->r_got_unsafe && !head->safe) || | 2414 | if ((test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags) && !head->safe) || |
2413 | (req->r_got_safe && head->safe)) { | 2415 | (test_bit(CEPH_MDS_R_GOT_SAFE, &req->r_req_flags) && head->safe)) { |
2414 | pr_warn("got a dup %s reply on %llu from mds%d\n", | 2416 | pr_warn("got a dup %s reply on %llu from mds%d\n", |
2415 | head->safe ? "safe" : "unsafe", tid, mds); | 2417 | head->safe ? "safe" : "unsafe", tid, mds); |
2416 | mutex_unlock(&mdsc->mutex); | 2418 | mutex_unlock(&mdsc->mutex); |
2417 | goto out; | 2419 | goto out; |
2418 | } | 2420 | } |
2419 | if (req->r_got_safe) { | 2421 | if (test_bit(CEPH_MDS_R_GOT_SAFE, &req->r_req_flags)) { |
2420 | pr_warn("got unsafe after safe on %llu from mds%d\n", | 2422 | pr_warn("got unsafe after safe on %llu from mds%d\n", |
2421 | tid, mds); | 2423 | tid, mds); |
2422 | mutex_unlock(&mdsc->mutex); | 2424 | mutex_unlock(&mdsc->mutex); |
@@ -2455,10 +2457,10 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
2455 | 2457 | ||
2456 | 2458 | ||
2457 | if (head->safe) { | 2459 | if (head->safe) { |
2458 | req->r_got_safe = true; | 2460 | set_bit(CEPH_MDS_R_GOT_SAFE, &req->r_req_flags); |
2459 | __unregister_request(mdsc, req); | 2461 | __unregister_request(mdsc, req); |
2460 | 2462 | ||
2461 | if (req->r_got_unsafe) { | 2463 | if (test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) { |
2462 | /* | 2464 | /* |
2463 | * We already handled the unsafe response, now do the | 2465 | * We already handled the unsafe response, now do the |
2464 | * cleanup. No need to examine the response; the MDS | 2466 | * cleanup. No need to examine the response; the MDS |
@@ -2476,7 +2478,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
2476 | goto out; | 2478 | goto out; |
2477 | } | 2479 | } |
2478 | } else { | 2480 | } else { |
2479 | req->r_got_unsafe = true; | 2481 | set_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags); |
2480 | list_add_tail(&req->r_unsafe_item, &req->r_session->s_unsafe); | 2482 | list_add_tail(&req->r_unsafe_item, &req->r_session->s_unsafe); |
2481 | if (req->r_unsafe_dir) { | 2483 | if (req->r_unsafe_dir) { |
2482 | struct ceph_inode_info *ci = | 2484 | struct ceph_inode_info *ci = |
@@ -2530,7 +2532,8 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
2530 | if (realm) | 2532 | if (realm) |
2531 | ceph_put_snap_realm(mdsc, realm); | 2533 | ceph_put_snap_realm(mdsc, realm); |
2532 | 2534 | ||
2533 | if (err == 0 && req->r_got_unsafe && req->r_target_inode) { | 2535 | if (err == 0 && req->r_target_inode && |
2536 | test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) { | ||
2534 | struct ceph_inode_info *ci = ceph_inode(req->r_target_inode); | 2537 | struct ceph_inode_info *ci = ceph_inode(req->r_target_inode); |
2535 | spin_lock(&ci->i_unsafe_lock); | 2538 | spin_lock(&ci->i_unsafe_lock); |
2536 | list_add_tail(&req->r_unsafe_target_item, &ci->i_unsafe_iops); | 2539 | list_add_tail(&req->r_unsafe_target_item, &ci->i_unsafe_iops); |
@@ -2538,12 +2541,12 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
2538 | } | 2541 | } |
2539 | out_err: | 2542 | out_err: |
2540 | mutex_lock(&mdsc->mutex); | 2543 | mutex_lock(&mdsc->mutex); |
2541 | if (!req->r_aborted) { | 2544 | if (!test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) { |
2542 | if (err) { | 2545 | if (err) { |
2543 | req->r_err = err; | 2546 | req->r_err = err; |
2544 | } else { | 2547 | } else { |
2545 | req->r_reply = ceph_msg_get(msg); | 2548 | req->r_reply = ceph_msg_get(msg); |
2546 | req->r_got_result = true; | 2549 | set_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags); |
2547 | } | 2550 | } |
2548 | } else { | 2551 | } else { |
2549 | dout("reply arrived after request %lld was aborted\n", tid); | 2552 | dout("reply arrived after request %lld was aborted\n", tid); |
@@ -2587,7 +2590,7 @@ static void handle_forward(struct ceph_mds_client *mdsc, | |||
2587 | goto out; /* dup reply? */ | 2590 | goto out; /* dup reply? */ |
2588 | } | 2591 | } |
2589 | 2592 | ||
2590 | if (req->r_aborted) { | 2593 | if (test_bit(CEPH_MDS_R_ABORTED, &req->r_req_flags)) { |
2591 | dout("forward tid %llu aborted, unregistering\n", tid); | 2594 | dout("forward tid %llu aborted, unregistering\n", tid); |
2592 | __unregister_request(mdsc, req); | 2595 | __unregister_request(mdsc, req); |
2593 | } else if (fwd_seq <= req->r_num_fwd) { | 2596 | } else if (fwd_seq <= req->r_num_fwd) { |
@@ -2597,7 +2600,7 @@ static void handle_forward(struct ceph_mds_client *mdsc, | |||
2597 | /* resend. forward race not possible; mds would drop */ | 2600 | /* resend. forward race not possible; mds would drop */ |
2598 | dout("forward tid %llu to mds%d (we resend)\n", tid, next_mds); | 2601 | dout("forward tid %llu to mds%d (we resend)\n", tid, next_mds); |
2599 | BUG_ON(req->r_err); | 2602 | BUG_ON(req->r_err); |
2600 | BUG_ON(req->r_got_result); | 2603 | BUG_ON(test_bit(CEPH_MDS_R_GOT_RESULT, &req->r_req_flags)); |
2601 | req->r_attempts = 0; | 2604 | req->r_attempts = 0; |
2602 | req->r_num_fwd = fwd_seq; | 2605 | req->r_num_fwd = fwd_seq; |
2603 | req->r_resend_mds = next_mds; | 2606 | req->r_resend_mds = next_mds; |
@@ -2762,7 +2765,7 @@ static void replay_unsafe_requests(struct ceph_mds_client *mdsc, | |||
2762 | while (p) { | 2765 | while (p) { |
2763 | req = rb_entry(p, struct ceph_mds_request, r_node); | 2766 | req = rb_entry(p, struct ceph_mds_request, r_node); |
2764 | p = rb_next(p); | 2767 | p = rb_next(p); |
2765 | if (req->r_got_unsafe) | 2768 | if (test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) |
2766 | continue; | 2769 | continue; |
2767 | if (req->r_attempts == 0) | 2770 | if (req->r_attempts == 0) |
2768 | continue; /* only old requests */ | 2771 | continue; /* only old requests */ |
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index 3c6f77b7bb02..409b0e3c3b7a 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h | |||
@@ -205,6 +205,14 @@ struct ceph_mds_request { | |||
205 | struct inode *r_locked_dir; /* dir (if any) i_mutex locked by vfs */ | 205 | struct inode *r_locked_dir; /* dir (if any) i_mutex locked by vfs */ |
206 | struct inode *r_target_inode; /* resulting inode */ | 206 | struct inode *r_target_inode; /* resulting inode */ |
207 | 207 | ||
208 | #define CEPH_MDS_R_DIRECT_IS_HASH (1) /* r_direct_hash is valid */ | ||
209 | #define CEPH_MDS_R_ABORTED (2) /* call was aborted */ | ||
210 | #define CEPH_MDS_R_GOT_UNSAFE (3) /* got an unsafe reply */ | ||
211 | #define CEPH_MDS_R_GOT_SAFE (4) /* got a safe reply */ | ||
212 | #define CEPH_MDS_R_GOT_RESULT (5) /* got a result */ | ||
213 | #define CEPH_MDS_R_DID_PREPOPULATE (6) /* prepopulated readdir */ | ||
214 | unsigned long r_req_flags; | ||
215 | |||
208 | struct mutex r_fill_mutex; | 216 | struct mutex r_fill_mutex; |
209 | 217 | ||
210 | union ceph_mds_request_args r_args; | 218 | union ceph_mds_request_args r_args; |
@@ -216,7 +224,6 @@ struct ceph_mds_request { | |||
216 | /* for choosing which mds to send this request to */ | 224 | /* for choosing which mds to send this request to */ |
217 | int r_direct_mode; | 225 | int r_direct_mode; |
218 | u32 r_direct_hash; /* choose dir frag based on this dentry hash */ | 226 | u32 r_direct_hash; /* choose dir frag based on this dentry hash */ |
219 | bool r_direct_is_hash; /* true if r_direct_hash is valid */ | ||
220 | 227 | ||
221 | /* data payload is used for xattr ops */ | 228 | /* data payload is used for xattr ops */ |
222 | struct ceph_pagelist *r_pagelist; | 229 | struct ceph_pagelist *r_pagelist; |
@@ -234,7 +241,6 @@ struct ceph_mds_request { | |||
234 | struct ceph_mds_reply_info_parsed r_reply_info; | 241 | struct ceph_mds_reply_info_parsed r_reply_info; |
235 | struct page *r_locked_page; | 242 | struct page *r_locked_page; |
236 | int r_err; | 243 | int r_err; |
237 | bool r_aborted; | ||
238 | 244 | ||
239 | unsigned long r_timeout; /* optional. jiffies, 0 is "wait forever" */ | 245 | unsigned long r_timeout; /* optional. jiffies, 0 is "wait forever" */ |
240 | unsigned long r_started; /* start time to measure timeout against */ | 246 | unsigned long r_started; /* start time to measure timeout against */ |
@@ -262,9 +268,7 @@ struct ceph_mds_request { | |||
262 | ceph_mds_request_callback_t r_callback; | 268 | ceph_mds_request_callback_t r_callback; |
263 | ceph_mds_request_wait_callback_t r_wait_for_completion; | 269 | ceph_mds_request_wait_callback_t r_wait_for_completion; |
264 | struct list_head r_unsafe_item; /* per-session unsafe list item */ | 270 | struct list_head r_unsafe_item; /* per-session unsafe list item */ |
265 | bool r_got_unsafe, r_got_safe, r_got_result; | ||
266 | 271 | ||
267 | bool r_did_prepopulate; | ||
268 | long long r_dir_release_cnt; | 272 | long long r_dir_release_cnt; |
269 | long long r_dir_ordered_cnt; | 273 | long long r_dir_ordered_cnt; |
270 | int r_readdir_cache_idx; | 274 | int r_readdir_cache_idx; |