Lines Matching refs:work

92 static inline int check_conn_state(struct ksmbd_work *work)  in check_conn_state()  argument
96 if (ksmbd_conn_exiting(work) || ksmbd_conn_need_reconnect(work)) { in check_conn_state()
97 rsp_hdr = work->response_buf; in check_conn_state()
107 static int __process_request(struct ksmbd_work *work, struct ksmbd_conn *conn, in __process_request() argument
114 if (check_conn_state(work)) in __process_request()
117 if (ksmbd_verify_smb_message(work)) in __process_request()
120 command = conn->ops->get_cmd_val(work); in __process_request()
125 conn->ops->set_rsp_status(work, STATUS_INVALID_PARAMETER); in __process_request()
132 conn->ops->set_rsp_status(work, STATUS_NOT_IMPLEMENTED); in __process_request()
136 if (work->sess && conn->ops->is_sign_req(work, command)) { in __process_request()
137 ret = conn->ops->check_sign_req(work); in __process_request()
139 conn->ops->set_rsp_status(work, STATUS_ACCESS_DENIED); in __process_request()
144 ret = cmds->proc(work); in __process_request()
155 if (work->send_no_response) in __process_request()
160 static void __handle_ksmbd_work(struct ksmbd_work *work, in __handle_ksmbd_work() argument
166 if (conn->ops->allocate_rsp_buf(work)) in __handle_ksmbd_work()
170 conn->ops->is_transform_hdr(work->request_buf)) { in __handle_ksmbd_work()
171 rc = conn->ops->decrypt_req(work); in __handle_ksmbd_work()
173 conn->ops->set_rsp_status(work, STATUS_DATA_ERROR); in __handle_ksmbd_work()
177 work->encrypted = true; in __handle_ksmbd_work()
180 rc = conn->ops->init_rsp_hdr(work); in __handle_ksmbd_work()
183 conn->ops->set_rsp_status(work, STATUS_INVALID_HANDLE); in __handle_ksmbd_work()
188 rc = conn->ops->check_user_session(work); in __handle_ksmbd_work()
190 command = conn->ops->get_cmd_val(work); in __handle_ksmbd_work()
191 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
195 rc = conn->ops->get_ksmbd_tcon(work); in __handle_ksmbd_work()
197 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
205 rc = __process_request(work, conn, &command); in __handle_ksmbd_work()
215 rc = conn->ops->set_rsp_credits(work); in __handle_ksmbd_work()
218 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
224 if (work->sess && in __handle_ksmbd_work()
225 (work->sess->sign || smb3_11_final_sess_setup_resp(work) || in __handle_ksmbd_work()
226 conn->ops->is_sign_req(work, command))) in __handle_ksmbd_work()
227 conn->ops->set_sign_rsp(work); in __handle_ksmbd_work()
228 } while (is_chained_smb2_message(work)); in __handle_ksmbd_work()
230 if (work->send_no_response) in __handle_ksmbd_work()
234 smb3_preauth_hash_rsp(work); in __handle_ksmbd_work()
235 if (work->sess && work->sess->enc && work->encrypted && in __handle_ksmbd_work()
237 rc = conn->ops->encrypt_resp(work); in __handle_ksmbd_work()
239 conn->ops->set_rsp_status(work, STATUS_DATA_ERROR); in __handle_ksmbd_work()
244 ksmbd_conn_write(work); in __handle_ksmbd_work()
255 struct ksmbd_work *work = container_of(wk, struct ksmbd_work, work); in handle_ksmbd_work() local
256 struct ksmbd_conn *conn = work->conn; in handle_ksmbd_work()
260 __handle_ksmbd_work(work, conn); in handle_ksmbd_work()
262 ksmbd_conn_try_dequeue_request(work); in handle_ksmbd_work()
263 ksmbd_free_work_struct(work); in handle_ksmbd_work()
276 struct ksmbd_work *work; in queue_ksmbd_work() local
278 work = ksmbd_alloc_work_struct(); in queue_ksmbd_work()
279 if (!work) { in queue_ksmbd_work()
284 work->conn = conn; in queue_ksmbd_work()
285 work->request_buf = conn->request_buf; in queue_ksmbd_work()
288 if (ksmbd_init_smb_server(work)) { in queue_ksmbd_work()
289 ksmbd_free_work_struct(work); in queue_ksmbd_work()
293 ksmbd_conn_enqueue_request(work); in queue_ksmbd_work()
297 INIT_WORK(&work->work, handle_ksmbd_work); in queue_ksmbd_work()
298 ksmbd_queue_work(work); in queue_ksmbd_work()
370 static void server_ctrl_handle_work(struct work_struct *work) in server_ctrl_handle_work() argument
374 ctrl = container_of(work, struct server_ctrl_struct, ctrl_work); in server_ctrl_handle_work()