aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pagelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/pagelist.c')
-rw-r--r--fs/nfs/pagelist.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 66a5c5d4a777..b8301c40dd78 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -297,8 +297,8 @@ out:
297 297
298static struct nfs_page * 298static struct nfs_page *
299__nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page, 299__nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page,
300 struct nfs_page *last, unsigned int pgbase, 300 unsigned int pgbase, unsigned int offset,
301 unsigned int offset, unsigned int count) 301 unsigned int count)
302{ 302{
303 struct nfs_page *req; 303 struct nfs_page *req;
304 struct nfs_open_context *ctx = l_ctx->open_context; 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,
327 req->wb_bytes = count; 327 req->wb_bytes = count;
328 req->wb_context = get_nfs_open_context(ctx); 328 req->wb_context = get_nfs_open_context(ctx);
329 kref_init(&req->wb_kref); 329 kref_init(&req->wb_kref);
330 nfs_page_group_init(req, last);
331 return req; 330 return req;
332} 331}
333 332
@@ -335,7 +334,6 @@ __nfs_create_request(struct nfs_lock_context *l_ctx, struct page *page,
335 * nfs_create_request - Create an NFS read/write request. 334 * nfs_create_request - Create an NFS read/write request.
336 * @ctx: open context to use 335 * @ctx: open context to use
337 * @page: page to write 336 * @page: page to write
338 * @last: last nfs request created for this page group or NULL if head
339 * @offset: starting offset within the page for the write 337 * @offset: starting offset within the page for the write
340 * @count: number of bytes to read/write 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,
345 */ 343 */
346struct nfs_page * 344struct nfs_page *
347nfs_create_request(struct nfs_open_context *ctx, struct page *page, 345nfs_create_request(struct nfs_open_context *ctx, struct page *page,
348 struct nfs_page *last, unsigned int offset, 346 unsigned int offset, unsigned int count)
349 unsigned int count)
350{ 347{
351 struct nfs_lock_context *l_ctx = nfs_get_lock_context(ctx); 348 struct nfs_lock_context *l_ctx = nfs_get_lock_context(ctx);
352 struct nfs_page *ret; 349 struct nfs_page *ret;
353 350
354 if (IS_ERR(l_ctx)) 351 if (IS_ERR(l_ctx))
355 return ERR_CAST(l_ctx); 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 nfs_put_lock_context(l_ctx); 356 nfs_put_lock_context(l_ctx);
358 return ret; 357 return ret;
359} 358}
@@ -365,11 +364,12 @@ nfs_create_subreq(struct nfs_page *req, struct nfs_page *last,
365{ 364{
366 struct nfs_page *ret; 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 pgbase, offset, count); 368 pgbase, offset, count);
370 if (!IS_ERR(ret)) { 369 if (!IS_ERR(ret)) {
371 nfs_lock_request(ret); 370 nfs_lock_request(ret);
372 ret->wb_index = req->wb_index; 371 ret->wb_index = req->wb_index;
372 nfs_page_group_init(ret, last);
373 } 373 }
374 return ret; 374 return ret;
375} 375}