| 921 | } |
| 922 | |
| 923 | int |
| 924 | fail_point_sysctl_status(SYSCTL_HANDLER_ARGS) |
| 925 | { |
| 926 | struct fail_point *fp; |
| 927 | struct sbuf sb, *sb_check; |
| 928 | |
| 929 | fp = arg1; |
| 930 | |
| 931 | sb_check = sbuf_new(&sb, NULL, 1024, SBUF_AUTOEXTEND); |
| 932 | if (sb_check != &sb) |
| 933 | return (ENOMEM); |
| 934 | |
| 935 | sbuf_set_drain(&sb, (sbuf_drain_func *)fail_sysctl_drain_func, req); |
| 936 | |
| 937 | /* Retrieving. */ |
| 938 | fail_point_get(fp, &sb, true); |
| 939 | |
| 940 | sbuf_finish(&sb); |
| 941 | sbuf_delete(&sb); |
| 942 | |
| 943 | /** |
| 944 | * Lock protects any new entries from being garbage collected before we |
| 945 | * can link them to the fail point. |
| 946 | */ |
| 947 | sx_xlock(&sx_fp_set); |
| 948 | fail_point_garbage_collect(); |
| 949 | sx_xunlock(&sx_fp_set); |
| 950 | |
| 951 | return (0); |
| 952 | } |
| 953 | |
| 954 | int |
| 955 | fail_sysctl_drain_func(void *sysctl_args, const char *buf, int len) |
nothing calls this directly
no test coverage detected