| 866 | } |
| 867 | |
| 868 | int dm_drop_pending_reply_cond(struct dm_cond *reply_cond) |
| 869 | { |
| 870 | struct dm_find_cond_ctx ctx; |
| 871 | unsigned int hentry; |
| 872 | |
| 873 | if (!reply_cond) |
| 874 | return 0; |
| 875 | |
| 876 | for (hentry = 0; hentry < hash_size(pending_replies); hentry++) { |
| 877 | memset(&ctx, 0, sizeof ctx); |
| 878 | ctx.cond = reply_cond; |
| 879 | |
| 880 | hash_lock(pending_replies, hentry); |
| 881 | map_for_each(pending_replies->entries[hentry], dm_match_pending_cond, &ctx); |
| 882 | if (!ctx.found) { |
| 883 | hash_unlock(pending_replies, hentry); |
| 884 | continue; |
| 885 | } |
| 886 | |
| 887 | hash_remove(pending_replies, hentry, ctx.key); |
| 888 | hash_unlock(pending_replies, hentry); |
| 889 | return 1; |
| 890 | } |
| 891 | |
| 892 | return 0; |
| 893 | } |
| 894 | |
| 895 | |
| 896 |
no test coverage detected