static uint64_t onefs_get_alloc_size(struct vfs_handle_struct *handle, files_struct *fsp, const SMB_STRUCT_STAT *sbuf) { uint64_t result; START_PROFILE(syscall_get_alloc_size); if(S_ISDIR(sbuf->st_mode)) { result = 0; goto out; } /* Just use the file size since st_blocks is unreliable on OneFS. */ result = get_file_size_stat(sbuf); if (fsp && fsp->initial_allocation_size) result = MAX(result,fsp->initial_allocation_size); result = smb_roundup(handle->conn, result); out: END_PROFILE(syscall_get_alloc_size); return result; }
static bool collect_one_stream(struct ea_struct *ea, void *private_data) { struct streaminfo_state *state = (struct streaminfo_state *)private_data; if (!add_one_stream(state->mem_ctx, &state->num_streams, &state->streams, ea->name, ea->value.length-1, smb_roundup(state->handle->conn, ea->value.length-1))) { state->status = NT_STATUS_NO_MEMORY; return false; } return true; }