Lines Matching refs:req
61 struct nfs_page *req; in nfs_create_request() local
64 req = nfs_page_alloc(); in nfs_create_request()
65 if (req == NULL) in nfs_create_request()
69 req->wb_lock_context = nfs_get_lock_context(ctx); in nfs_create_request()
70 if (req->wb_lock_context == NULL) { in nfs_create_request()
71 nfs_page_free(req); in nfs_create_request()
78 req->wb_page = page; in nfs_create_request()
79 atomic_set(&req->wb_complete, 0); in nfs_create_request()
80 req->wb_index = page->index; in nfs_create_request()
85 req->wb_offset = offset; in nfs_create_request()
86 req->wb_pgbase = offset; in nfs_create_request()
87 req->wb_bytes = count; in nfs_create_request()
88 req->wb_context = get_nfs_open_context(ctx); in nfs_create_request()
89 kref_init(&req->wb_kref); in nfs_create_request()
90 return req; in nfs_create_request()
97 void nfs_unlock_request(struct nfs_page *req) in nfs_unlock_request() argument
99 if (!NFS_WBACK_BUSY(req)) { in nfs_unlock_request()
104 clear_bit(PG_BUSY, &req->wb_flags); in nfs_unlock_request()
106 wake_up_bit(&req->wb_flags, PG_BUSY); in nfs_unlock_request()
107 nfs_release_request(req); in nfs_unlock_request()
117 static void nfs_clear_request(struct nfs_page *req) in nfs_clear_request() argument
119 struct page *page = req->wb_page; in nfs_clear_request()
120 struct nfs_open_context *ctx = req->wb_context; in nfs_clear_request()
121 struct nfs_lock_context *l_ctx = req->wb_lock_context; in nfs_clear_request()
125 req->wb_page = NULL; in nfs_clear_request()
129 req->wb_lock_context = NULL; in nfs_clear_request()
133 req->wb_context = NULL; in nfs_clear_request()
146 struct nfs_page *req = container_of(kref, struct nfs_page, wb_kref); in nfs_free_request() local
149 nfs_clear_request(req); in nfs_free_request()
150 nfs_page_free(req); in nfs_free_request()
153 void nfs_release_request(struct nfs_page *req) in nfs_release_request() argument
155 kref_put(&req->wb_kref, nfs_free_request); in nfs_release_request()
172 nfs_wait_on_request(struct nfs_page *req) in nfs_wait_on_request() argument
174 return wait_on_bit(&req->wb_flags, PG_BUSY, in nfs_wait_on_request()
179 …fs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_page *prev, struct nfs_page *req) in nfs_generic_pg_test() argument
191 return desc->pg_count + req->wb_bytes <= desc->pg_bsize; in nfs_generic_pg_test()
235 struct nfs_page *req, in nfs_can_coalesce_requests() argument
238 if (req->wb_context->cred != prev->wb_context->cred) in nfs_can_coalesce_requests()
240 if (req->wb_lock_context->lockowner != prev->wb_lock_context->lockowner) in nfs_can_coalesce_requests()
242 if (req->wb_context->state != prev->wb_context->state) in nfs_can_coalesce_requests()
244 if (req->wb_index != (prev->wb_index + 1)) in nfs_can_coalesce_requests()
246 if (req->wb_pgbase != 0) in nfs_can_coalesce_requests()
250 return pgio->pg_ops->pg_test(pgio, prev, req); in nfs_can_coalesce_requests()
262 struct nfs_page *req) in nfs_pageio_do_add_request() argument
268 if (!nfs_can_coalesce_requests(prev, req, desc)) in nfs_pageio_do_add_request()
272 desc->pg_ops->pg_init(desc, req); in nfs_pageio_do_add_request()
273 desc->pg_base = req->wb_pgbase; in nfs_pageio_do_add_request()
275 nfs_list_remove_request(req); in nfs_pageio_do_add_request()
276 nfs_list_add_request(req, &desc->pg_list); in nfs_pageio_do_add_request()
277 desc->pg_count += req->wb_bytes; in nfs_pageio_do_add_request()
308 struct nfs_page *req) in __nfs_pageio_add_request() argument
310 while (!nfs_pageio_do_add_request(desc, req)) { in __nfs_pageio_add_request()
334 struct nfs_page *req; in nfs_do_recoalesce() local
336 req = list_first_entry(&head, struct nfs_page, wb_list); in nfs_do_recoalesce()
337 nfs_list_remove_request(req); in nfs_do_recoalesce()
338 if (__nfs_pageio_add_request(desc, req)) in nfs_do_recoalesce()
349 struct nfs_page *req) in nfs_pageio_add_request() argument
354 ret = __nfs_pageio_add_request(desc, req); in nfs_pageio_add_request()