All the callers of nfs_create_request() are now creating page group heads, so we can remove the redundant 'last' page argument.
Unified · Split
| @@ -492,7 +492,7 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq, · 491 unmodified lines | ||
| 492 | 492 | struct nfs_page *req; |
| 493 | 493 | unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase); |
| 494 | 494 | /* XXX do we need to do the eof zeroing found in async_filler? */ |
| 495 | − req = nfs_create_request(dreq->ctx, pagevec[i], NULL, | |
| 495 | + req = nfs_create_request(dreq->ctx, pagevec[i], | |
| 496 | 496 | pgbase, req_len); |
| 497 | 497 | if (IS_ERR(req)) { |
| 498 | 498 | result = PTR_ERR(req); |
| @@ -899,7 +899,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq, · 400 unmodified lines | ||
| 899 | 899 | struct nfs_page *req; |
| 900 | 900 | unsigned int req_len = min_t(size_t, bytes, PAGE_SIZE - pgbase); |
| 901 | 901 | |
| 902 | − req = nfs_create_request(dreq->ctx, pagevec[i], NULL, | |
| 902 | + req = nfs_create_request(dreq->ctx, pagevec[i], | |
| 903 | 903 | pgbase, req_len); |
| 904 | 904 | if (IS_ERR(req)) { |
| 905 | 905 | result = PTR_ERR(req); |
| @@ -297,8 +297,8 @@ out: · 296 unmodified lines | ||
| 297 | 297 | |
| 298 | 298 | static struct nfs_page * |
| 299 | 299 | __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, |
| 300 | − struct nfs_page *last, unsigned int pgbase, | |
| 301 | − unsigned int offset, unsigned int count) | |
| 300 | + unsigned int pgbase, unsigned int offset, | |
| 301 | + unsigned int count) | |
| 302 | 302 | { |
| 303 | 303 | struct nfs_page *req; |
| 304 | 304 | struct nfs_open_context *ctx = l_ctx->open_context; |
| @@ -327,7 +327,6 @@ __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, · 22 unmodified lines | ||
| 327 | 327 | req->wb_bytes = count; |
| 328 | 328 | req->wb_context = get_nfs_open_context(ctx); |
| 329 | 329 | kref_init(&req->wb_kref); |
| 330 | − nfs_page_group_init(req, last); | |
| 331 | 330 | return req; |
| 332 | 331 | } |
| 333 | 332 | |
| @@ -335,7 +334,6 @@ __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, · 1 unmodified line | ||
| 335 | 334 | * nfs_create_request - Create an NFS read/write request. |
| 336 | 335 | * @ctx: open context to use |
| 337 | 336 | * @page: page to write |
| 338 | − * @last: last nfs request created for this page group or NULL if head | |
| 339 | 337 | * @offset: starting offset within the page for the write |
| 340 | 338 | * @count: number of bytes to read/write |
| 341 | 339 | * |
| @@ -345,15 +343,16 @@ __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, · 3 unmodified lines | ||
| 345 | 343 | */ |
| 346 | 344 | struct nfs_page * |
| 347 | 345 | nfs_create_request(struct nfs_open_context *ctx, struct page *page, |
| 348 | − struct nfs_page *last, unsigned int offset, | |
| 349 | − unsigned int count) | |
| 346 | + unsigned int offset, unsigned int count) | |
| 350 | 347 | { |
| 351 | 348 | struct nfs_lock_context *l_ctx = nfs_get_lock_context(ctx); |
| 352 | 349 | struct nfs_page *ret; |
| 353 | 350 | |
| 354 | 351 | if (IS_ERR(l_ctx)) |
| 355 | 352 | return ERR_CAST(l_ctx); |
| 356 | − ret = __nfs_create_request(l_ctx, page, last, offset, offset, count); | |
| 353 | + ret = __nfs_create_request(l_ctx, page, offset, offset, count); | |
| 354 | + if (!IS_ERR(ret)) | |
| 355 | + nfs_page_group_init(ret, NULL); | |
| 357 | 356 | nfs_put_lock_context(l_ctx); |
| 358 | 357 | return ret; |
| 359 | 358 | } |
| @@ -365,11 +364,12 @@ nfs_create_subreq(struct nfs_page *req, struct nfs_page *last, · 5 unmodified lines | ||
| 365 | 364 | { |
| 366 | 365 | struct nfs_page *ret; |
| 367 | 366 | |
| 368 | − ret = __nfs_create_request(req->wb_lock_context, req->wb_page, last, | |
| 367 | + ret = __nfs_create_request(req->wb_lock_context, req->wb_page, | |
| 369 | 368 | pgbase, offset, count); |
| 370 | 369 | if (!IS_ERR(ret)) { |
| 371 | 370 | nfs_lock_request(ret); |
| 372 | 371 | ret->wb_index = req->wb_index; |
| 372 | + nfs_page_group_init(ret, last); | |
| 373 | 373 | } |
| 374 | 374 | return ret; |
| 375 | 375 | } |
| @@ -118,7 +118,7 @@ int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode, · 117 unmodified lines | ||
| 118 | 118 | len = nfs_page_length(page); |
| 119 | 119 | if (len == 0) |
| 120 | 120 | return nfs_return_empty_page(page); |
| 121 | − new = nfs_create_request(ctx, page, NULL, 0, len); | |
| 121 | + new = nfs_create_request(ctx, page, 0, len); | |
| 122 | 122 | if (IS_ERR(new)) { |
| 123 | 123 | unlock_page(page); |
| 124 | 124 | return PTR_ERR(new); |
| @@ -363,7 +363,7 @@ readpage_async_filler(void *data, struct page *page) · 238 unmodified lines | ||
| 363 | 363 | if (len == 0) |
| 364 | 364 | return nfs_return_empty_page(page); |
| 365 | 365 | |
| 366 | − new = nfs_create_request(desc->ctx, page, NULL, 0, len); | |
| 366 | + new = nfs_create_request(desc->ctx, page, 0, len); | |
| 367 | 367 | if (IS_ERR(new)) |
| 368 | 368 | goto out_error; |
| 369 | 369 | |
| @@ -1171,7 +1171,7 @@ static struct nfs_page * nfs_setup_write_request(struct nfs_open_context* ctx, · 1170 unmodified lines | ||
| 1171 | 1171 | req = nfs_try_to_update_request(inode, page, offset, bytes); |
| 1172 | 1172 | if (req != NULL) |
| 1173 | 1173 | goto out; |
| 1174 | − req = nfs_create_request(ctx, page, NULL, offset, bytes); | |
| 1174 | + req = nfs_create_request(ctx, page, offset, bytes); | |
| 1175 | 1175 | if (IS_ERR(req)) |
| 1176 | 1176 | goto out; |
| 1177 | 1177 | nfs_inode_add_request(inode, req); |
| @@ -114,7 +114,6 @@ struct nfs_pageio_descriptor { · 113 unmodified lines | ||
| 114 | 114 | |
| 115 | 115 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, |
| 116 | 116 | struct page *page, |
| 117 | − struct nfs_page *last, | |
| 118 | 117 | unsigned int offset, |
| 119 | 118 | unsigned int count); |
| 120 | 119 | extern void nfs_release_request(struct nfs_page *); |