diff options
| -rw-r--r-- | drivers/block/rbd.c | 22 | ||||
| -rw-r--r-- | fs/ceph/caps.c | 22 | ||||
| -rw-r--r-- | fs/ceph/locks.c | 2 | ||||
| -rw-r--r-- | fs/ceph/super.h | 1 |
4 files changed, 23 insertions, 24 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d94529d5c8e9..bc67a93aa4f4 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -523,6 +523,7 @@ void rbd_warn(struct rbd_device *rbd_dev, const char *fmt, ...) | |||
| 523 | # define rbd_assert(expr) ((void) 0) | 523 | # define rbd_assert(expr) ((void) 0) |
| 524 | #endif /* !RBD_DEBUG */ | 524 | #endif /* !RBD_DEBUG */ |
| 525 | 525 | ||
| 526 | static void rbd_osd_copyup_callback(struct rbd_obj_request *obj_request); | ||
| 526 | static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request); | 527 | static int rbd_img_obj_request_submit(struct rbd_obj_request *obj_request); |
| 527 | static void rbd_img_parent_read(struct rbd_obj_request *obj_request); | 528 | static void rbd_img_parent_read(struct rbd_obj_request *obj_request); |
| 528 | static void rbd_dev_remove_parent(struct rbd_device *rbd_dev); | 529 | static void rbd_dev_remove_parent(struct rbd_device *rbd_dev); |
| @@ -1818,6 +1819,16 @@ static void rbd_osd_stat_callback(struct rbd_obj_request *obj_request) | |||
| 1818 | obj_request_done_set(obj_request); | 1819 | obj_request_done_set(obj_request); |
| 1819 | } | 1820 | } |
| 1820 | 1821 | ||
| 1822 | static void rbd_osd_call_callback(struct rbd_obj_request *obj_request) | ||
| 1823 | { | ||
| 1824 | dout("%s: obj %p\n", __func__, obj_request); | ||
| 1825 | |||
| 1826 | if (obj_request_img_data_test(obj_request)) | ||
| 1827 | rbd_osd_copyup_callback(obj_request); | ||
| 1828 | else | ||
| 1829 | obj_request_done_set(obj_request); | ||
| 1830 | } | ||
| 1831 | |||
| 1821 | static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, | 1832 | static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, |
| 1822 | struct ceph_msg *msg) | 1833 | struct ceph_msg *msg) |
| 1823 | { | 1834 | { |
| @@ -1866,6 +1877,8 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, | |||
| 1866 | rbd_osd_discard_callback(obj_request); | 1877 | rbd_osd_discard_callback(obj_request); |
| 1867 | break; | 1878 | break; |
| 1868 | case CEPH_OSD_OP_CALL: | 1879 | case CEPH_OSD_OP_CALL: |
| 1880 | rbd_osd_call_callback(obj_request); | ||
| 1881 | break; | ||
| 1869 | case CEPH_OSD_OP_NOTIFY_ACK: | 1882 | case CEPH_OSD_OP_NOTIFY_ACK: |
| 1870 | case CEPH_OSD_OP_WATCH: | 1883 | case CEPH_OSD_OP_WATCH: |
| 1871 | rbd_osd_trivial_callback(obj_request); | 1884 | rbd_osd_trivial_callback(obj_request); |
| @@ -2530,13 +2543,15 @@ out_unwind: | |||
| 2530 | } | 2543 | } |
| 2531 | 2544 | ||
| 2532 | static void | 2545 | static void |
| 2533 | rbd_img_obj_copyup_callback(struct rbd_obj_request *obj_request) | 2546 | rbd_osd_copyup_callback(struct rbd_obj_request *obj_request) |
| 2534 | { | 2547 | { |
| 2535 | struct rbd_img_request *img_request; | 2548 | struct rbd_img_request *img_request; |
| 2536 | struct rbd_device *rbd_dev; | 2549 | struct rbd_device *rbd_dev; |
| 2537 | struct page **pages; | 2550 | struct page **pages; |
| 2538 | u32 page_count; | 2551 | u32 page_count; |
| 2539 | 2552 | ||
| 2553 | dout("%s: obj %p\n", __func__, obj_request); | ||
| 2554 | |||
| 2540 | rbd_assert(obj_request->type == OBJ_REQUEST_BIO || | 2555 | rbd_assert(obj_request->type == OBJ_REQUEST_BIO || |
| 2541 | obj_request->type == OBJ_REQUEST_NODATA); | 2556 | obj_request->type == OBJ_REQUEST_NODATA); |
| 2542 | rbd_assert(obj_request_img_data_test(obj_request)); | 2557 | rbd_assert(obj_request_img_data_test(obj_request)); |
| @@ -2563,9 +2578,7 @@ rbd_img_obj_copyup_callback(struct rbd_obj_request *obj_request) | |||
| 2563 | if (!obj_request->result) | 2578 | if (!obj_request->result) |
| 2564 | obj_request->xferred = obj_request->length; | 2579 | obj_request->xferred = obj_request->length; |
| 2565 | 2580 | ||
| 2566 | /* Finish up with the normal image object callback */ | 2581 | obj_request_done_set(obj_request); |
| 2567 | |||
| 2568 | rbd_img_obj_callback(obj_request); | ||
| 2569 | } | 2582 | } |
| 2570 | 2583 | ||
| 2571 | static void | 2584 | static void |
| @@ -2650,7 +2663,6 @@ rbd_img_obj_parent_read_full_callback(struct rbd_img_request *img_request) | |||
| 2650 | 2663 | ||
| 2651 | /* All set, send it off. */ | 2664 | /* All set, send it off. */ |
| 2652 | 2665 | ||
| 2653 | orig_request->callback = rbd_img_obj_copyup_callback; | ||
| 2654 | osdc = &rbd_dev->rbd_client->client->osdc; | 2666 | osdc = &rbd_dev->rbd_client->client->osdc; |
| 2655 | img_result = rbd_obj_request_submit(osdc, orig_request); | 2667 | img_result = rbd_obj_request_submit(osdc, orig_request); |
| 2656 | if (!img_result) | 2668 | if (!img_result) |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index dc10c9dd36c1..ddd5e9471290 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
| @@ -1506,7 +1506,6 @@ static int __mark_caps_flushing(struct inode *inode, | |||
| 1506 | 1506 | ||
| 1507 | swap(cf, ci->i_prealloc_cap_flush); | 1507 | swap(cf, ci->i_prealloc_cap_flush); |
| 1508 | cf->caps = flushing; | 1508 | cf->caps = flushing; |
| 1509 | cf->kick = false; | ||
| 1510 | 1509 | ||
| 1511 | spin_lock(&mdsc->cap_dirty_lock); | 1510 | spin_lock(&mdsc->cap_dirty_lock); |
| 1512 | list_del_init(&ci->i_dirty_item); | 1511 | list_del_init(&ci->i_dirty_item); |
| @@ -2123,8 +2122,7 @@ static void kick_flushing_capsnaps(struct ceph_mds_client *mdsc, | |||
| 2123 | 2122 | ||
| 2124 | static int __kick_flushing_caps(struct ceph_mds_client *mdsc, | 2123 | static int __kick_flushing_caps(struct ceph_mds_client *mdsc, |
| 2125 | struct ceph_mds_session *session, | 2124 | struct ceph_mds_session *session, |
| 2126 | struct ceph_inode_info *ci, | 2125 | struct ceph_inode_info *ci) |
| 2127 | bool kick_all) | ||
| 2128 | { | 2126 | { |
| 2129 | struct inode *inode = &ci->vfs_inode; | 2127 | struct inode *inode = &ci->vfs_inode; |
| 2130 | struct ceph_cap *cap; | 2128 | struct ceph_cap *cap; |
| @@ -2150,9 +2148,7 @@ static int __kick_flushing_caps(struct ceph_mds_client *mdsc, | |||
| 2150 | 2148 | ||
| 2151 | for (n = rb_first(&ci->i_cap_flush_tree); n; n = rb_next(n)) { | 2149 | for (n = rb_first(&ci->i_cap_flush_tree); n; n = rb_next(n)) { |
| 2152 | cf = rb_entry(n, struct ceph_cap_flush, i_node); | 2150 | cf = rb_entry(n, struct ceph_cap_flush, i_node); |
| 2153 | if (cf->tid < first_tid) | 2151 | if (cf->tid >= first_tid) |
| 2154 | continue; | ||
| 2155 | if (kick_all || cf->kick) | ||
| 2156 | break; | 2152 | break; |
| 2157 | } | 2153 | } |
| 2158 | if (!n) { | 2154 | if (!n) { |
| @@ -2161,7 +2157,6 @@ static int __kick_flushing_caps(struct ceph_mds_client *mdsc, | |||
| 2161 | } | 2157 | } |
| 2162 | 2158 | ||
| 2163 | cf = rb_entry(n, struct ceph_cap_flush, i_node); | 2159 | cf = rb_entry(n, struct ceph_cap_flush, i_node); |
| 2164 | cf->kick = false; | ||
| 2165 | 2160 | ||
| 2166 | first_tid = cf->tid + 1; | 2161 | first_tid = cf->tid + 1; |
| 2167 | 2162 | ||
| @@ -2181,8 +2176,6 @@ void ceph_early_kick_flushing_caps(struct ceph_mds_client *mdsc, | |||
| 2181 | { | 2176 | { |
| 2182 | struct ceph_inode_info *ci; | 2177 | struct ceph_inode_info *ci; |
| 2183 | struct ceph_cap *cap; | 2178 | struct ceph_cap *cap; |
| 2184 | struct ceph_cap_flush *cf; | ||
| 2185 | struct rb_node *n; | ||
| 2186 | 2179 | ||
| 2187 | dout("early_kick_flushing_caps mds%d\n", session->s_mds); | 2180 | dout("early_kick_flushing_caps mds%d\n", session->s_mds); |
| 2188 | list_for_each_entry(ci, &session->s_cap_flushing, i_flushing_item) { | 2181 | list_for_each_entry(ci, &session->s_cap_flushing, i_flushing_item) { |
| @@ -2205,16 +2198,11 @@ void ceph_early_kick_flushing_caps(struct ceph_mds_client *mdsc, | |||
| 2205 | if ((cap->issued & ci->i_flushing_caps) != | 2198 | if ((cap->issued & ci->i_flushing_caps) != |
| 2206 | ci->i_flushing_caps) { | 2199 | ci->i_flushing_caps) { |
| 2207 | spin_unlock(&ci->i_ceph_lock); | 2200 | spin_unlock(&ci->i_ceph_lock); |
| 2208 | if (!__kick_flushing_caps(mdsc, session, ci, true)) | 2201 | if (!__kick_flushing_caps(mdsc, session, ci)) |
| 2209 | continue; | 2202 | continue; |
| 2210 | spin_lock(&ci->i_ceph_lock); | 2203 | spin_lock(&ci->i_ceph_lock); |
| 2211 | } | 2204 | } |
| 2212 | 2205 | ||
| 2213 | for (n = rb_first(&ci->i_cap_flush_tree); n; n = rb_next(n)) { | ||
| 2214 | cf = rb_entry(n, struct ceph_cap_flush, i_node); | ||
| 2215 | cf->kick = true; | ||
| 2216 | } | ||
| 2217 | |||
| 2218 | spin_unlock(&ci->i_ceph_lock); | 2206 | spin_unlock(&ci->i_ceph_lock); |
| 2219 | } | 2207 | } |
| 2220 | } | 2208 | } |
| @@ -2228,7 +2216,7 @@ void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc, | |||
| 2228 | 2216 | ||
| 2229 | dout("kick_flushing_caps mds%d\n", session->s_mds); | 2217 | dout("kick_flushing_caps mds%d\n", session->s_mds); |
| 2230 | list_for_each_entry(ci, &session->s_cap_flushing, i_flushing_item) { | 2218 | list_for_each_entry(ci, &session->s_cap_flushing, i_flushing_item) { |
| 2231 | int delayed = __kick_flushing_caps(mdsc, session, ci, false); | 2219 | int delayed = __kick_flushing_caps(mdsc, session, ci); |
| 2232 | if (delayed) { | 2220 | if (delayed) { |
| 2233 | spin_lock(&ci->i_ceph_lock); | 2221 | spin_lock(&ci->i_ceph_lock); |
| 2234 | __cap_delay_requeue(mdsc, ci); | 2222 | __cap_delay_requeue(mdsc, ci); |
| @@ -2261,7 +2249,7 @@ static void kick_flushing_inode_caps(struct ceph_mds_client *mdsc, | |||
| 2261 | 2249 | ||
| 2262 | spin_unlock(&ci->i_ceph_lock); | 2250 | spin_unlock(&ci->i_ceph_lock); |
| 2263 | 2251 | ||
| 2264 | delayed = __kick_flushing_caps(mdsc, session, ci, true); | 2252 | delayed = __kick_flushing_caps(mdsc, session, ci); |
| 2265 | if (delayed) { | 2253 | if (delayed) { |
| 2266 | spin_lock(&ci->i_ceph_lock); | 2254 | spin_lock(&ci->i_ceph_lock); |
| 2267 | __cap_delay_requeue(mdsc, ci); | 2255 | __cap_delay_requeue(mdsc, ci); |
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index 4347039ecc18..6706bde9ad1b 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c | |||
| @@ -287,7 +287,7 @@ int ceph_encode_locks_to_buffer(struct inode *inode, | |||
| 287 | return 0; | 287 | return 0; |
| 288 | 288 | ||
| 289 | spin_lock(&ctx->flc_lock); | 289 | spin_lock(&ctx->flc_lock); |
| 290 | list_for_each_entry(lock, &ctx->flc_flock, fl_list) { | 290 | list_for_each_entry(lock, &ctx->flc_posix, fl_list) { |
| 291 | ++seen_fcntl; | 291 | ++seen_fcntl; |
| 292 | if (seen_fcntl > num_fcntl_locks) { | 292 | if (seen_fcntl > num_fcntl_locks) { |
| 293 | err = -ENOSPC; | 293 | err = -ENOSPC; |
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 860cc016e70d..2f2460d23a06 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
| @@ -189,7 +189,6 @@ static inline void ceph_put_cap_snap(struct ceph_cap_snap *capsnap) | |||
| 189 | struct ceph_cap_flush { | 189 | struct ceph_cap_flush { |
| 190 | u64 tid; | 190 | u64 tid; |
| 191 | int caps; | 191 | int caps; |
| 192 | bool kick; | ||
| 193 | struct rb_node g_node; // global | 192 | struct rb_node g_node; // global |
| 194 | union { | 193 | union { |
| 195 | struct rb_node i_node; // inode | 194 | struct rb_node i_node; // inode |
