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->conn) || in check_conn_state()
97 ksmbd_conn_need_reconnect(work->conn)) { in check_conn_state()
98 rsp_hdr = work->response_buf; in check_conn_state()
108 static int __process_request(struct ksmbd_work *work, struct ksmbd_conn *conn, in __process_request() argument
115 if (check_conn_state(work)) in __process_request()
118 if (ksmbd_verify_smb_message(work)) { in __process_request()
119 conn->ops->set_rsp_status(work, STATUS_INVALID_PARAMETER); in __process_request()
123 command = conn->ops->get_cmd_val(work); in __process_request()
128 conn->ops->set_rsp_status(work, STATUS_INVALID_PARAMETER); in __process_request()
135 conn->ops->set_rsp_status(work, STATUS_NOT_IMPLEMENTED); in __process_request()
139 if (work->sess && conn->ops->is_sign_req(work, command)) { in __process_request()
140 ret = conn->ops->check_sign_req(work); in __process_request()
142 conn->ops->set_rsp_status(work, STATUS_ACCESS_DENIED); in __process_request()
147 ret = cmds->proc(work); in __process_request()
158 if (work->send_no_response) in __process_request()
163 static void __handle_ksmbd_work(struct ksmbd_work *work, in __handle_ksmbd_work() argument
170 if (conn->ops->allocate_rsp_buf(work)) in __handle_ksmbd_work()
174 conn->ops->is_transform_hdr(work->request_buf)) { in __handle_ksmbd_work()
175 rc = conn->ops->decrypt_req(work); in __handle_ksmbd_work()
177 conn->ops->set_rsp_status(work, STATUS_DATA_ERROR); in __handle_ksmbd_work()
181 work->encrypted = true; in __handle_ksmbd_work()
184 rc = conn->ops->init_rsp_hdr(work); in __handle_ksmbd_work()
187 conn->ops->set_rsp_status(work, STATUS_INVALID_HANDLE); in __handle_ksmbd_work()
193 rc = conn->ops->check_user_session(work); in __handle_ksmbd_work()
196 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
199 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
203 rc = conn->ops->get_ksmbd_tcon(work); in __handle_ksmbd_work()
206 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
209 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
216 rc = __process_request(work, conn, &command); in __handle_ksmbd_work()
226 rc = conn->ops->set_rsp_credits(work); in __handle_ksmbd_work()
229 conn->ops->set_rsp_status(work, in __handle_ksmbd_work()
235 is_chained = is_chained_smb2_message(work); in __handle_ksmbd_work()
237 if (work->sess && in __handle_ksmbd_work()
238 (work->sess->sign || smb3_11_final_sess_setup_resp(work) || in __handle_ksmbd_work()
239 conn->ops->is_sign_req(work, command))) in __handle_ksmbd_work()
240 conn->ops->set_sign_rsp(work); in __handle_ksmbd_work()
244 if (work->tcon) in __handle_ksmbd_work()
245 ksmbd_tree_connect_put(work->tcon); in __handle_ksmbd_work()
246 smb3_preauth_hash_rsp(work); in __handle_ksmbd_work()
247 if (work->sess && work->sess->enc && work->encrypted && in __handle_ksmbd_work()
249 rc = conn->ops->encrypt_resp(work); in __handle_ksmbd_work()
251 conn->ops->set_rsp_status(work, STATUS_DATA_ERROR); in __handle_ksmbd_work()
254 ksmbd_conn_write(work); in __handle_ksmbd_work()
265 struct ksmbd_work *work = container_of(wk, struct ksmbd_work, work); in handle_ksmbd_work() local
266 struct ksmbd_conn *conn = work->conn; in handle_ksmbd_work()
270 __handle_ksmbd_work(work, conn); in handle_ksmbd_work()
272 ksmbd_conn_try_dequeue_request(work); in handle_ksmbd_work()
273 ksmbd_free_work_struct(work); in handle_ksmbd_work()
292 struct ksmbd_work *work; in queue_ksmbd_work() local
295 work = ksmbd_alloc_work_struct(); in queue_ksmbd_work()
296 if (!work) { in queue_ksmbd_work()
301 work->conn = conn; in queue_ksmbd_work()
302 work->request_buf = conn->request_buf; in queue_ksmbd_work()
305 err = ksmbd_init_smb_server(work); in queue_ksmbd_work()
307 ksmbd_free_work_struct(work); in queue_ksmbd_work()
311 ksmbd_conn_enqueue_request(work); in queue_ksmbd_work()
315 INIT_WORK(&work->work, handle_ksmbd_work); in queue_ksmbd_work()
316 ksmbd_queue_work(work); in queue_ksmbd_work()
388 static void server_ctrl_handle_work(struct work_struct *work) in server_ctrl_handle_work() argument
392 ctrl = container_of(work, struct server_ctrl_struct, ctrl_work); in server_ctrl_handle_work()