aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/osd_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r--net/ceph/osd_client.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index d5d2be3bd113..6202923b41ff 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1029,12 +1029,23 @@ static void remove_all_osds(struct ceph_osd_client *osdc)
1029static void __move_osd_to_lru(struct ceph_osd_client *osdc, 1029static void __move_osd_to_lru(struct ceph_osd_client *osdc,
1030 struct ceph_osd *osd) 1030 struct ceph_osd *osd)
1031{ 1031{
1032 dout("__move_osd_to_lru %p\n", osd); 1032 dout("%s %p\n", __func__, osd);
1033 BUG_ON(!list_empty(&osd->o_osd_lru)); 1033 BUG_ON(!list_empty(&osd->o_osd_lru));
1034
1034 list_add_tail(&osd->o_osd_lru, &osdc->osd_lru); 1035 list_add_tail(&osd->o_osd_lru, &osdc->osd_lru);
1035 osd->lru_ttl = jiffies + osdc->client->options->osd_idle_ttl * HZ; 1036 osd->lru_ttl = jiffies + osdc->client->options->osd_idle_ttl * HZ;
1036} 1037}
1037 1038
1039static void maybe_move_osd_to_lru(struct ceph_osd_client *osdc,
1040 struct ceph_osd *osd)
1041{
1042 dout("%s %p\n", __func__, osd);
1043
1044 if (list_empty(&osd->o_requests) &&
1045 list_empty(&osd->o_linger_requests))
1046 __move_osd_to_lru(osdc, osd);
1047}
1048
1038static void __remove_osd_from_lru(struct ceph_osd *osd) 1049static void __remove_osd_from_lru(struct ceph_osd *osd)
1039{ 1050{
1040 dout("__remove_osd_from_lru %p\n", osd); 1051 dout("__remove_osd_from_lru %p\n", osd);
@@ -1182,11 +1193,7 @@ static void __unregister_request(struct ceph_osd_client *osdc,
1182 ceph_msg_revoke(req->r_request); 1193 ceph_msg_revoke(req->r_request);
1183 1194
1184 list_del_init(&req->r_osd_item); 1195 list_del_init(&req->r_osd_item);
1185 if (list_empty(&req->r_osd->o_requests) && 1196 maybe_move_osd_to_lru(osdc, req->r_osd);
1186 list_empty(&req->r_osd->o_linger_requests)) {
1187 dout("moving osd to %p lru\n", req->r_osd);
1188 __move_osd_to_lru(osdc, req->r_osd);
1189 }
1190 if (list_empty(&req->r_linger_item)) 1197 if (list_empty(&req->r_linger_item))
1191 req->r_osd = NULL; 1198 req->r_osd = NULL;
1192 } 1199 }
@@ -1229,12 +1236,7 @@ static void __unregister_linger_request(struct ceph_osd_client *osdc,
1229 list_del_init(&req->r_linger_item); 1236 list_del_init(&req->r_linger_item);
1230 if (req->r_osd) { 1237 if (req->r_osd) {
1231 list_del_init(&req->r_linger_osd_item); 1238 list_del_init(&req->r_linger_osd_item);
1232 1239 maybe_move_osd_to_lru(osdc, req->r_osd);
1233 if (list_empty(&req->r_osd->o_requests) &&
1234 list_empty(&req->r_osd->o_linger_requests)) {
1235 dout("moving osd to %p lru\n", req->r_osd);
1236 __move_osd_to_lru(osdc, req->r_osd);
1237 }
1238 if (list_empty(&req->r_osd_item)) 1240 if (list_empty(&req->r_osd_item))
1239 req->r_osd = NULL; 1241 req->r_osd = NULL;
1240 } 1242 }