Lines Matching refs:len
96 static __u32 get_neg_ctxt_len(struct smb2_sync_hdr *hdr, __u32 len, in get_neg_ctxt_len() argument
118 if (len < nc_offset + (neg_count * sizeof(struct smb2_neg_context))) { in get_neg_ctxt_len()
124 len - nc_offset, size_of_pad_before_neg_ctxts); in get_neg_ctxt_len()
127 return (len - nc_offset) + size_of_pad_before_neg_ctxts; in get_neg_ctxt_len()
131 smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *srvr) in smb2_check_message() argument
168 if (len < pdu_size) { in smb2_check_message()
169 if ((len >= hdr_size) in smb2_check_message()
182 if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE) { in smb2_check_message()
224 clc_len += get_neg_ctxt_len(shdr, len, clc_len); in smb2_check_message()
226 if (len != clc_len) { in smb2_check_message()
228 clc_len, len, mid); in smb2_check_message()
234 if (clc_len + 24 == len && command == SMB2_OPLOCK_BREAK_HE) in smb2_check_message()
237 if (clc_len == len + 1) in smb2_check_message()
244 if (((clc_len + 7) & ~7) == len) in smb2_check_message()
256 if (clc_len < len) { in smb2_check_message()
259 len, clc_len, command, mid); in smb2_check_message()
264 len, clc_len, command, mid); in smb2_check_message()
303 smb2_get_data_area_len(int *off, int *len, struct smb2_sync_hdr *shdr) in smb2_get_data_area_len() argument
306 *len = 0; in smb2_get_data_area_len()
323 *len = le16_to_cpu( in smb2_get_data_area_len()
329 *len = le16_to_cpu( in smb2_get_data_area_len()
335 *len = le32_to_cpu( in smb2_get_data_area_len()
341 *len = le32_to_cpu( in smb2_get_data_area_len()
347 *len = le32_to_cpu(((struct smb2_read_rsp *)shdr)->DataLength); in smb2_get_data_area_len()
352 *len = le32_to_cpu( in smb2_get_data_area_len()
358 *len = le32_to_cpu( in smb2_get_data_area_len()
374 *len = 0; in smb2_get_data_area_len()
380 *len = 0; in smb2_get_data_area_len()
381 } else if (*len < 0) { in smb2_get_data_area_len()
383 *len); in smb2_get_data_area_len()
384 *len = 0; in smb2_get_data_area_len()
385 } else if (*len > 128 * 1024) { in smb2_get_data_area_len()
386 cifs_dbg(VFS, "data area larger than 128K: %d\n", *len); in smb2_get_data_area_len()
387 *len = 0; in smb2_get_data_area_len()
391 if ((*off != 0) && (*len != 0)) in smb2_get_data_area_len()
409 int len = le16_to_cpu(shdr->StructureSize); in smb2_calc_size() local
415 len += le16_to_cpu(pdu->StructureSize2); in smb2_calc_size()
430 if (offset + 1 < len) { in smb2_calc_size()
432 offset + 1, len); in smb2_calc_size()
435 len = offset + data_length; in smb2_calc_size()
439 cifs_dbg(FYI, "SMB2 len %d\n", len); in smb2_calc_size()
440 return len; in smb2_calc_size()
447 int len; in cifs_convert_path_to_utf16() local
471 to = cifs_strndup_to_utf16(start_of_path, PATH_MAX, &len, in cifs_convert_path_to_utf16()