12 #include <linux/slab.h>
14 #include <linux/sched.h>
16 #include <linux/nfs.h>
17 #include <linux/nfs3.h>
18 #include <linux/nfs4.h>
20 #include <linux/nfs_fs.h>
22 #include <linux/export.h>
48 hdr->
cred = hdr->
req->wb_context->cred;
62 spin_lock(&hdr->
lock);
69 spin_unlock(&hdr->
lock);
108 req = nfs_page_alloc();
116 return ERR_CAST(l_ctx);
124 req->
wb_index = page_file_index(page);
167 static void nfs_clear_request(
struct nfs_page *
req)
194 static void nfs_free_request(
struct kref *
kref)
199 nfs_clear_request(req);
205 kref_put(&req->
wb_kref, nfs_free_request);
208 static int nfs_wait_bit_uninterruptible(
void *
word)
225 nfs_wait_bit_uninterruptible,
260 INIT_LIST_HEAD(&desc->
pg_list);
289 static bool nfs_can_coalesce_requests(
struct nfs_page *
prev,
305 if (req_offset(req) != req_offset(prev) + prev->
wb_bytes)
307 return pgio->
pg_ops->pg_test(pgio, prev, req);
324 prev = nfs_list_entry(desc->
pg_list.prev);
325 if (!nfs_can_coalesce_requests(prev, req, desc))
328 if (desc->
pg_ops->pg_init)
329 desc->
pg_ops->pg_init(desc, req);
332 nfs_list_remove_request(req);
333 nfs_list_add_request(req, &desc->
pg_list);
343 if (!list_empty(&desc->
pg_list)) {
350 if (list_empty(&desc->
pg_list)) {
367 while (!nfs_pageio_do_add_request(desc, req)) {
369 nfs_pageio_doio(desc);
390 while (!list_empty(&
head)) {
394 nfs_list_remove_request(req);
395 if (__nfs_pageio_add_request(desc, req))
411 ret = __nfs_pageio_add_request(desc, req);
416 ret = nfs_do_recoalesce(desc);
429 nfs_pageio_doio(desc);
432 if (!nfs_do_recoalesce(desc))
451 if (!list_empty(&desc->
pg_list)) {
464 if (nfs_page_cachep ==
NULL)