Lines Matching full:hdr

37 	struct zfcp_diag_header *hdr;  in zfcp_diag_adapter_setup()  local
46 hdr = &diag->port_data.header; in zfcp_diag_adapter_setup()
48 spin_lock_init(&hdr->access_lock); in zfcp_diag_adapter_setup()
49 hdr->buffer = &diag->port_data.data; in zfcp_diag_adapter_setup()
50 hdr->buffer_size = sizeof(diag->port_data.data); in zfcp_diag_adapter_setup()
52 hdr->timestamp = jiffies - msecs_to_jiffies(diag->max_age); in zfcp_diag_adapter_setup()
55 hdr = &diag->config_data.header; in zfcp_diag_adapter_setup()
57 spin_lock_init(&hdr->access_lock); in zfcp_diag_adapter_setup()
58 hdr->buffer = &diag->config_data.data; in zfcp_diag_adapter_setup()
59 hdr->buffer_size = sizeof(diag->config_data.data); in zfcp_diag_adapter_setup()
61 hdr->timestamp = jiffies - msecs_to_jiffies(diag->max_age); in zfcp_diag_adapter_setup()
82 * @hdr: the meta data to update.
86 void zfcp_diag_update_xdata(struct zfcp_diag_header *const hdr, in zfcp_diag_update_xdata() argument
92 spin_lock_irqsave(&hdr->access_lock, flags); in zfcp_diag_update_xdata()
95 if (!time_after_eq(capture_timestamp, hdr->timestamp)) in zfcp_diag_update_xdata()
98 hdr->timestamp = capture_timestamp; in zfcp_diag_update_xdata()
99 hdr->incomplete = incomplete; in zfcp_diag_update_xdata()
100 memcpy(hdr->buffer, data, hdr->buffer_size); in zfcp_diag_update_xdata()
102 spin_unlock_irqrestore(&hdr->access_lock, flags); in zfcp_diag_update_xdata()
166 struct zfcp_diag_header *const hdr, in __zfcp_diag_update_buffer() argument
169 __must_hold(hdr->access_lock) in __zfcp_diag_update_buffer()
173 if (hdr->updating == 1) { in __zfcp_diag_update_buffer()
175 hdr->updating == 0, in __zfcp_diag_update_buffer()
176 hdr->access_lock); in __zfcp_diag_update_buffer()
179 hdr->updating = 1; in __zfcp_diag_update_buffer()
180 spin_unlock_irqrestore(&hdr->access_lock, *flags); in __zfcp_diag_update_buffer()
185 spin_lock_irqsave(&hdr->access_lock, *flags); in __zfcp_diag_update_buffer()
186 hdr->updating = 0; in __zfcp_diag_update_buffer()
200 const struct zfcp_diag_header *const hdr) in __zfcp_diag_test_buffer_age_isfresh() argument
201 __must_hold(hdr->access_lock) in __zfcp_diag_test_buffer_age_isfresh()
209 if (!time_after_eq(now, hdr->timestamp)) in __zfcp_diag_test_buffer_age_isfresh()
212 if (jiffies_to_msecs(now - hdr->timestamp) >= diag->max_age) in __zfcp_diag_test_buffer_age_isfresh()
222 * @hdr: buffer-header for which to update with the collected diagnostics.
225 * This function will cause an update of the given @hdr by calling the also
243 struct zfcp_diag_header *const hdr, in zfcp_diag_update_buffer_limited() argument
249 spin_lock_irqsave(&hdr->access_lock, flags); in zfcp_diag_update_buffer_limited()
252 !__zfcp_diag_test_buffer_age_isfresh(adapter->diagnostics, hdr); in zfcp_diag_update_buffer_limited()
254 rc = __zfcp_diag_update_buffer(adapter, hdr, buffer_update, in zfcp_diag_update_buffer_limited()
260 spin_unlock_irqrestore(&hdr->access_lock, flags); in zfcp_diag_update_buffer_limited()